Skip to content

Commit

Permalink
ikukantai v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bonavadeur committed Jul 28, 2024
1 parent 5d1176f commit 230c538
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 228 deletions.
135 changes: 5 additions & 130 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@

[![LICENSE](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
![Kubernetes](https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=for-the-badge&logo=kubernetes&logoColor=white)
<<<<<<< HEAD
![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)
![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)

`ikukantai` is a Knative Serving based Serverless Platform designed for Distributed System.

![](images/ikukantai_wp.jpg)
=======
![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)
![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)
![Prometheus](https://img.shields.io/badge/Prometheus-E6522C?style=for-the-badge&logo=Prometheus&logoColor=white)

`FaaSt` is a Knative Serving based Serverless Platform designed for Distributed System.

This repo is a copy from official repo: [ikukantai](https://github.com/bonavadeur/ikukantai.git), for publication purpose.
`ikukantai` is a Knative Serving based Serverless Platform designed for Distributed System.

<p align="center">
<img src="images/logo.jpg" />
</p>
>>>>>>> faast
![ikukantai](images/ikukantai_wp.jpg)

## 1. Motivation

Expand All @@ -31,19 +18,11 @@ If we want to use Kubernetes and Knative in Edge-Cloud, we need a more intellige

Many related works work in deploying Knative in Edge-Cloud, but all of them are not unified-system approach. They don’t show the latency exitsts in Knative internally.

<<<<<<< HEAD
We propose an approach which improves Knative from inside. It is a Unified Serverless System for Distributed System. It is ikukantai (行く艦隊 - the iku fleet, translated from Japanese).

## 2. Architecture

---> picture
=======
We propose an approach which improves Knative from inside. It is a Unified Serverless System for Distributed System. It is FaaSt (fast Function as a Service).

## 2. Architecture

![Arch](images/arch.png)
>>>>>>> faast

## 3. Installation

Expand All @@ -55,11 +34,6 @@ We propose an approach which improves Knative from inside. It is a Unified Serve
+ Calico installed on Kubernetes cluster
+ MetalLB installed on Kubernetes cluster

<<<<<<< HEAD
### 3.2. Install Knative Serving with Kourier is networking option

In this step we install Knative Serving's components (CRD, Knative's Pod) by applying .yaml files. Notes that the applied manifest is modified by ours, we not use the original image. We develop extra features base on [Knative-Serving](https://github.com/knative/serving/tree/release-1.12) version 1.12.1 and [Kourier](https://github.com/knative-extensions/net-kourier/tree/release-1.12) version 1.12.1
=======
### 3.2. Install monlat - the Latency Monitoring system

#### 3.2.1. Install Prometheus
Expand All @@ -84,30 +58,21 @@ We develop a Latency Monitoring system, for more detail and installation please
### 3.3. Install Knative Serving with Kourier is networking option and Our Extra-Controller

In this step we install Knative Serving's components (CRD, Knative's Pod) by applying .yaml files. Notes that the applied manifest is modified by ours, we do not use the original image. We develop extra features base on [Knative-Serving](https://github.com/knative/serving/tree/release-1.12) version 1.12.1 and [Kourier](https://github.com/knative-extensions/net-kourier/tree/release-1.12) version 1.12.1
>>>>>>> faast

```bash
# Install CRD
kubectl apply -f manifest/1-serving-crd.yaml
# Install Knative's Pod
kubectl apply -f manifest/2-serving-core.yaml
<<<<<<< HEAD
=======
# Extra configmap and RBAC
kubectl apply -f manifest/extra-controller/configmap.yaml
kubectl apply -f manifest/extra-controller/rbac.yaml
>>>>>>> faast
kubectl apply -f manifest/miporin/configmap.yaml
kubectl apply -f manifest/miporin/rbac.yaml
# Install Networking Plugin
kubectl apply -f manifest/3-kourier.yaml
# Run domain config job
kubectl apply -f manifest/4-serving-default-domain.yaml
```

<<<<<<< HEAD
### 3.3. Making some changes

#### 3.3.1. Kourier Gateway
=======
Wait until default-domain job is success

```bash
Expand All @@ -124,13 +89,12 @@ kubectl -n knative-serving patch deploy net-kourier-controller --patch '{"spec":
Install remaining components

```bash
kubectl apply -f manifest/extra-controller/extra-controller.yaml
kubectl apply -f manifest/miporin/miporin.yaml
```

### 3.4. Making some changes

#### 3.4.1. Kourier Gateway
>>>>>>> faast

```bash
# replicate 3scale-gateway pod to 3 replicas
Expand All @@ -143,11 +107,7 @@ kubectl -n kourier-system patch service kourier-internal --patch '{"spec":{"inte

Note that fill correct nodename in your cluster into second command. Let fill all nodenames.

<<<<<<< HEAD
#### 3.3.2. Activator
=======
#### 3.4.2. Activator
>>>>>>> faast

```bash
# replicate activator pod to 3 replicas
Expand All @@ -157,11 +117,7 @@ kubectl -n knative-serving patch deploy activator --patch '{"spec":{"template":{

Note that fill correct nodename in your cluster into second command. Let fill all nodenames.

<<<<<<< HEAD
#### 3.3.3. Check your setup
=======
#### 3.4.3. Check your setup
>>>>>>> faast

You must see **3scale-gateway** and **activator** present in all nodes, each node has one **activator** and one **3scale-gateway**

Expand All @@ -176,125 +132,44 @@ NAME READY STATUS RESTARTS AGE
3scale-kourier-gateway-864554589-5dgxl 1/1 Running 11 (5h26m ago) 2d5h 10.233.75.28 node2 <none> <none>
3scale-kourier-gateway-864554589-btfqf 1/1 Running 12 (5h21m ago) 2d5h 10.233.71.29 node3 <none> <none>
3scale-kourier-gateway-864554589-p7q56 1/1 Running 13 (5h29m ago) 2d5h 10.233.102.176 node1 <none> <none>
<<<<<<< HEAD
```

### 3.4. Install our extra controller

```bash
# Install extra controller
ubuntu@node1:~$ kubectl apply -f manifest/extra-controller/configmap.yaml
ubuntu@node1:~$ kubectl apply -f manifest/extra-controller/rbac.yaml
ubuntu@node1:~$ kubectl apply -f manifest/extra-controller/extra-controller.yaml

ubuntu@node1:~$ kubectl -n knative-serving get pod | grep miporin
miporin-597dcddbc-qvlc6 1/1 Running 0 143m
```
### 3.5. Install monlat - the Latency Monitoring system

#### 3.5.1. Install Prometheus

We follow Prometheus's installation guide in [Knative's Docs](https://knative.dev/docs/serving/observability/metrics/collecting-metrics/)

Create values.yaml first

```yaml
kube-state-metrics:
metricLabelsAllowlist:
- pods=[*]
- deployments=[app.kubernetes.io/name,app.kubernetes.io/component,app.kubernetes.io/instance]
prometheus:
prometheusSpec:
serviceMonitorSelectorNilUsesHelmValues: false
podMonitorSelectorNilUsesHelmValues: false
grafana:
sidecar:
dashboards:
enabled: true
searchNamespace: ALL
```
Then install Prometheus
```bash
$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
$ helm repo update
$ helm install prometheus prometheus-community/kube-prometheus-stack -n default -f values.yaml

$ kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/grafana/dashboards.yaml

$ kubectl create namespace metrics
$ kubectl apply -f https://raw.githubusercontent.com/knative/docs/main/docs/serving/observability/metrics/collector.yaml
```

#### 3.5.2. Install monlat

We develop a Latency Monitoring system, for more detail and installation please visit [monlat](https://github.com/bonavadeur/monlat).

## 4. Experiments
=======

# miporin is our extra-controller
ubuntu@node1:~$ kubectl -n knative-serving get pod | grep miporin
miporin-597dcddbc-qvlc6 1/1 Running 0 143m
```

## 4. Try it out
>>>>>>> faast

### 4.1. Deploy hello-application

```bash
# install a demoapp
<<<<<<< HEAD
$ kubectl apply -f manifest/demo_app/hello.yaml
=======
$ kubectl apply -f manifest/demo/hello.yaml
>>>>>>> faast
```

### 4.2. Check system operation

```bash
# check ksvc is ready
<<<<<<< HEAD
$ kubectl get ksvc,pod -o wide | grep hello
service.serving.knative.dev/hello http://hello.default.192.168.133.2.sslip.io hello-00001 he
llo-00001 True
pod/hello-00001-deployment-7484848464-8btwr 2/2 Running 0 5m4
6s 10.233.71.1 node3 <none> <none>
pod/hello-00001-deployment-7484848464-dlsh5 2/2 Running 0 5m5
0s 10.233.102.184 node1 <none> <none>
pod/hello-00001-deployment-7484848464-vpbxg 2/2 Running 0 5m4
7s 10.233.75.7 node2 <none> <none>
=======
$ kubectl get ksvc,servicemonitor,pod -o wide | grep hello
service.serving.knative.dev/hello http://hello.default.192.168.133.2.sslip.io hello-00001 hello-00001 True
servicemonitor.monitoring.coreos.com/hello
pod/hello-00001-deployment-7484848464-8btwr 2/2 Running 0 5m46s 10.233.71.1 node3 <none> <none>
pod/hello-00001-deployment-7484848464-dlsh5 2/2 Running 0 5m50s 10.233.102.184 node1 <none> <none>
pod/hello-00001-deployment-7484848464-vpbxg 2/2 Running 0 5m47s 10.233.75.7 node2 <none> <none>
>>>>>>> faast
# curl to app
$ curl hello.default.svc.cluster.local
Konnichiwa from hello-00001-deployment-7484848464-dlsh5 in node1
```

### 4.3. Perform your experiments

<<<<<<< HEAD
=======
Perform your experiments

>>>>>>> faast
## 5. Contributor

Đào Hiệp - Bonavadeur

The Future Internet Laboratory, Room E711, C7 Building, Hanoi University of Science and Technology, Vietnam.

<<<<<<< HEAD
![](images/github-wp.png)
=======
This repo is a copy from official repo: [ikukantai](https://github.com/bonavadeur/ikukantai.git), for publication purpose.
>>>>>>> faast
Binary file removed images/logo.jpg
Binary file not shown.
23 changes: 0 additions & 23 deletions manifest/2-serving-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,7 @@ spec:
# This is the Go import path for the binary that is containerized
# and substituted here.
# image: gcr.io/knative-releases/knative.dev/serving/cmd/activator@sha256:4cdbe7acc718f55005c0fed4633e9e9feb64f03830132b5dd007e4088a0b2e9f
<<<<<<< HEAD
image: docker.io/bonavadeur/ikukantai-activator:v1.1-faast-15nov24
=======
image: docker.io/bonavadeur/ikukantai-activator:v1.2-cnsm-15nov24
>>>>>>> faast
# The numbers are based on performance test results from
# https://github.com/knative/serving/issues/1625#issuecomment-511930023
resources:
Expand All @@ -423,12 +419,9 @@ spec:
limits:
cpu: 1000m
memory: 600Mi
<<<<<<< HEAD
=======
envFrom:
- configMapRef:
name: config-ikukantai
>>>>>>> faast
env:
# Run Activator with GC collection when newly generated memory is 500%.
- name: GOGC
Expand Down Expand Up @@ -4941,11 +4934,7 @@ spec:
# This is the Go import path for the binary that is containerized
# and substituted here.
# image: gcr.io/knative-releases/knative.dev/serving/cmd/queue@sha256:7f1dd4cce2f85d31be8350420a528cc5c7d8b1bf5979ec77c29dc1293f82dc83
<<<<<<< HEAD
image: docker.io/bonavadeur/ikukantai-queue:v1.1-faast-15nov24
=======
image: docker.io/bonavadeur/ikukantai-queue:v1.2-cnsm-15nov24
>>>>>>> faast
---
# Copyright 2018 The Knative Authors
#
Expand Down Expand Up @@ -5343,11 +5332,7 @@ data:
# This is the Go import path for the binary that is containerized
# and substituted here.
# queue-sidecar-image: gcr.io/knative-releases/knative.dev/serving/cmd/queue@sha256:7f1dd4cce2f85d31be8350420a528cc5c7d8b1bf5979ec77c29dc1293f82dc83
<<<<<<< HEAD
queue-sidecar-image: docker.io/bonavadeur/ikukantai-queue:v1.1-faast-15nov24
=======
queue-sidecar-image: docker.io/bonavadeur/ikukantai-queue:v1.2-cnsm-15nov24
>>>>>>> faast
_example: |-
################################
# #
Expand Down Expand Up @@ -6443,11 +6428,7 @@ spec:
# This is the Go import path for the binary that is containerized
# and substituted here.
# image: gcr.io/knative-releases/knative.dev/serving/cmd/autoscaler@sha256:28f45751cac2090019a74ec2801d1f8cd18210ae55159cacd0c9baf74ccc9d7c
<<<<<<< HEAD
image: docker.io/bonavadeur/ikukantai-autoscaler:v1.1-faast-15nov24
=======
image: docker.io/bonavadeur/ikukantai-autoscaler:v1.2-cnsm-15nov24
>>>>>>> faast
resources:
requests:
cpu: 100m
Expand Down Expand Up @@ -6592,11 +6573,7 @@ spec:
# This is the Go import path for the binary that is containerized
# and substituted here.
# image: gcr.io/knative-releases/knative.dev/serving/cmd/controller@sha256:5d9b948e78bb4f54b602d98e02dedd291689b90295dadab10992f0d9ef2aa1d8
<<<<<<< HEAD
image: docker.io/bonavadeur/ikukantai-controller:v1.1-faast-15nov24
=======
image: docker.io/bonavadeur/ikukantai-controller:v1.2-cnsm-15nov24
>>>>>>> faast
resources:
requests:
cpu: 100m
Expand Down
5 changes: 0 additions & 5 deletions manifest/3-kourier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,11 @@ spec:
kubernetes.io/hostname: node1
containers:
- name: controller
<<<<<<< HEAD:manifest/3-kourier.yaml
# image: gcr.io/knative-releases/knative.dev/net-kourier/cmd/kourier@sha256:9cd4d69a708a8cf8e597efe3f511494d71cf8eab1b2fd85545097069ad47d3f6
image: docker.io/bonavadeur/ikukantai-net-kourier:v1.1-faast-15nov24
=======
image: gcr.io/knative-releases/knative.dev/net-kourier/cmd/kourier@sha256:9cd4d69a708a8cf8e597efe3f511494d71cf8eab1b2fd85545097069ad47d3f6
# image: docker.io/bonavadeur/ikukantai-kourier:v1.2-cnsm-15nov24
envFrom:
- configMapRef:
name: config-ikukantai
>>>>>>> faast:manifest/4-kourier.yaml
env:
- name: CERTS_SECRET_NAMESPACE
value: ""
Expand Down
Loading

0 comments on commit 230c538

Please sign in to comment.