Skip to content
Snippets Groups Projects
Commit 1b4cee10 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NFV-SDN'22:

- Created initial scenario deployment scripts and manifests
parent 99e0d57a
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!24Integrate NFV-SDN'22 demo
Showing
with 792 additions and 41 deletions
...@@ -60,43 +60,43 @@ spec: ...@@ -60,43 +60,43 @@ spec:
limits: limits:
cpu: 700m cpu: 700m
memory: 1024Mi memory: 1024Mi
- name: grafana # - name: grafana
image: grafana/grafana:8.5.11 # image: grafana/grafana:8.5.11
imagePullPolicy: IfNotPresent # imagePullPolicy: IfNotPresent
ports: # ports:
- containerPort: 3000 # - containerPort: 3000
name: http-grafana # name: http-grafana
protocol: TCP # protocol: TCP
env: # env:
- name: GF_SERVER_ROOT_URL # - name: GF_SERVER_ROOT_URL
value: "http://0.0.0.0:3000/grafana/" # value: "http://0.0.0.0:3000/grafana/"
- name: GF_SERVER_SERVE_FROM_SUB_PATH # - name: GF_SERVER_SERVE_FROM_SUB_PATH
value: "true" # value: "true"
readinessProbe: # readinessProbe:
failureThreshold: 3 # failureThreshold: 3
httpGet: # httpGet:
path: /robots.txt # path: /robots.txt
port: 3000 # port: 3000
scheme: HTTP # scheme: HTTP
initialDelaySeconds: 10 # initialDelaySeconds: 10
periodSeconds: 30 # periodSeconds: 30
successThreshold: 1 # successThreshold: 1
timeoutSeconds: 2 # timeoutSeconds: 2
livenessProbe: # livenessProbe:
failureThreshold: 3 # failureThreshold: 3
initialDelaySeconds: 30 # initialDelaySeconds: 30
periodSeconds: 10 # periodSeconds: 10
successThreshold: 1 # successThreshold: 1
tcpSocket: # tcpSocket:
port: 3000 # port: 3000
timeoutSeconds: 1 # timeoutSeconds: 1
resources: # resources:
requests: # requests:
cpu: 250m # cpu: 250m
memory: 750Mi # memory: 750Mi
limits: # limits:
cpu: 700m # cpu: 700m
memory: 1024Mi # memory: 1024Mi
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
...@@ -110,6 +110,6 @@ spec: ...@@ -110,6 +110,6 @@ spec:
- name: webui - name: webui
port: 8004 port: 8004
targetPort: 8004 targetPort: 8004
- name: grafana # - name: grafana
port: 3000 # port: 3000
targetPort: 3000 # targetPort: 3000
# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc.
descriptors_real.json
# Scenario 2 - ...
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# Delete old namespaces
kubectl delete namespace tfs-dom1 tfs-dom2 tfs-dom3 tfs-dom4
# Delete secondary ingress controllers
kubectl delete -f nfvsdn22/nginx-ingress-controller-dom1.yaml
kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml
kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml
kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml
# Create secondary ingress controllers
kubectl apply -f nfvsdn22/nginx-ingress-controller-dom1.yaml
kubectl apply -f nfvsdn22/nginx-ingress-controller-dom2.yaml
kubectl apply -f nfvsdn22/nginx-ingress-controller-dom3.yaml
kubectl apply -f nfvsdn22/nginx-ingress-controller-dom4.yaml
# Deploy TFS for Domain 1
source nfvsdn22/deploy_specs_dom1.sh
./deploy.sh
# Deploy TFS for Domain 2
source nfvsdn22/deploy_specs_dom2.sh
./deploy.sh
# Deploy TFS for Domain 3
source nfvsdn22/deploy_specs_dom3.sh
./deploy.sh
# Deploy TFS for Domain 4
source nfvsdn22/deploy_specs_dom4.sh
./deploy.sh
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
export TFS_COMPONENTS="context device pathcomp service slice webui"
# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
# Set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE="tfs-dom1"
# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom1.yaml"
# Set the neew Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
export TFS_COMPONENTS="context device pathcomp service slice webui"
# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
# Set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE="tfs-dom2"
# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom2.yaml"
# Set the neew Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
export TFS_COMPONENTS="context device pathcomp service slice webui"
# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
# Set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE="tfs-dom3"
# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom3.yaml"
# Set the neew Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
export TFS_COMPONENTS="context device pathcomp service slice webui"
# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
# Set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE="tfs-dom4"
# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom4.yaml"
# Set the neew Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-load-balancer-microk8s-conf-dom1
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-udp-microk8s-conf-dom1
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-tcp-microk8s-conf-dom1
namespace: ingress
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: tfs-ingress-class-dom1
annotations:
ingressclass.kubernetes.io/is-default-class: "false"
spec:
controller: tfs.etsi.org/controller-class-dom1
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-ingress-microk8s-controller-dom1
namespace: ingress
labels:
microk8s-application: nginx-ingress-microk8s-dom1
spec:
selector:
matchLabels:
name: nginx-ingress-microk8s-dom1
updateStrategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: nginx-ingress-microk8s-dom1
spec:
terminationGracePeriodSeconds: 60
restartPolicy: Always
serviceAccountName: nginx-ingress-microk8s-serviceaccount
containers:
- image: k8s.gcr.io/ingress-nginx/controller:v1.2.0
imagePullPolicy: IfNotPresent
name: nginx-ingress-microk8s
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
lifecycle:
preStop:
exec:
command:
- /wait-shutdown
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
runAsUser: 101 # www-data
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
hostPort: 8001
protocol: TCP
- name: https
containerPort: 443
hostPort: 4431
protocol: TCP
- name: health
containerPort: 10254
hostPort: 12541
protocol: TCP
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom1
- --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom1
- --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom1
- --election-id=ingress-controller-leader-dom1
- --controller-class=tfs.etsi.org/controller-class-dom1
- --ingress-class=tfs-ingress-class-dom1
- ' '
- --publish-status-address=127.0.0.1
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-load-balancer-microk8s-conf-dom2
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-udp-microk8s-conf-dom2
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-tcp-microk8s-conf-dom2
namespace: ingress
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: tfs-ingress-class-dom2
annotations:
ingressclass.kubernetes.io/is-default-class: "false"
spec:
controller: tfs.etsi.org/controller-class-dom2
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-ingress-microk8s-controller-dom2
namespace: ingress
labels:
microk8s-application: nginx-ingress-microk8s-dom2
spec:
selector:
matchLabels:
name: nginx-ingress-microk8s-dom2
updateStrategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: nginx-ingress-microk8s-dom2
spec:
terminationGracePeriodSeconds: 60
restartPolicy: Always
serviceAccountName: nginx-ingress-microk8s-serviceaccount
containers:
- image: k8s.gcr.io/ingress-nginx/controller:v1.2.0
imagePullPolicy: IfNotPresent
name: nginx-ingress-microk8s
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
lifecycle:
preStop:
exec:
command:
- /wait-shutdown
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
runAsUser: 101 # www-data
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
hostPort: 8002
protocol: TCP
- name: https
containerPort: 443
hostPort: 4432
protocol: TCP
- name: health
containerPort: 10254
hostPort: 12542
protocol: TCP
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom2
- --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom2
- --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom2
- --election-id=ingress-controller-leader-dom2
- --controller-class=tfs.etsi.org/controller-class-dom2
- --ingress-class=tfs-ingress-class-dom2
- ' '
- --publish-status-address=127.0.0.1
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-load-balancer-microk8s-conf-dom3
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-udp-microk8s-conf-dom3
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-tcp-microk8s-conf-dom3
namespace: ingress
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: tfs-ingress-class-dom3
annotations:
ingressclass.kubernetes.io/is-default-class: "false"
spec:
controller: tfs.etsi.org/controller-class-dom3
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-ingress-microk8s-controller-dom3
namespace: ingress
labels:
microk8s-application: nginx-ingress-microk8s-dom3
spec:
selector:
matchLabels:
name: nginx-ingress-microk8s-dom3
updateStrategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: nginx-ingress-microk8s-dom3
spec:
terminationGracePeriodSeconds: 60
restartPolicy: Always
serviceAccountName: nginx-ingress-microk8s-serviceaccount
containers:
- image: k8s.gcr.io/ingress-nginx/controller:v1.2.0
imagePullPolicy: IfNotPresent
name: nginx-ingress-microk8s
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
lifecycle:
preStop:
exec:
command:
- /wait-shutdown
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
runAsUser: 101 # www-data
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
hostPort: 8003
protocol: TCP
- name: https
containerPort: 443
hostPort: 4433
protocol: TCP
- name: health
containerPort: 10254
hostPort: 12543
protocol: TCP
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom3
- --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom3
- --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom3
- --election-id=ingress-controller-leader-dom3
- --controller-class=tfs.etsi.org/controller-class-dom3
- --ingress-class=tfs-ingress-class-dom3
- ' '
- --publish-status-address=127.0.0.1
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-load-balancer-microk8s-conf-dom4
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-udp-microk8s-conf-dom4
namespace: ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-tcp-microk8s-conf-dom4
namespace: ingress
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: tfs-ingress-class-dom4
annotations:
ingressclass.kubernetes.io/is-default-class: "false"
spec:
controller: tfs.etsi.org/controller-class-dom4
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-ingress-microk8s-controller-dom4
namespace: ingress
labels:
microk8s-application: nginx-ingress-microk8s-dom4
spec:
selector:
matchLabels:
name: nginx-ingress-microk8s-dom4
updateStrategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: nginx-ingress-microk8s-dom4
spec:
terminationGracePeriodSeconds: 60
restartPolicy: Always
serviceAccountName: nginx-ingress-microk8s-serviceaccount
containers:
- image: k8s.gcr.io/ingress-nginx/controller:v1.2.0
imagePullPolicy: IfNotPresent
name: nginx-ingress-microk8s
livenessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 5
lifecycle:
preStop:
exec:
command:
- /wait-shutdown
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
runAsUser: 101 # www-data
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
hostPort: 8004
protocol: TCP
- name: https
containerPort: 443
hostPort: 4434
protocol: TCP
- name: health
containerPort: 10254
hostPort: 12544
protocol: TCP
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom4
- --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom4
- --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom4
- --election-id=ingress-controller-leader-dom4
- --controller-class=tfs.etsi.org/controller-class-dom4
- --ingress-class=tfs-ingress-class-dom4
- ' '
- --publish-status-address=127.0.0.1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tfs-ingress-dom1
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: tfs-ingress-class-dom1
rules:
- http:
paths:
- path: /webui(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 8004
- path: /grafana(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 3000
- path: /context(/|$)(.*)
pathType: Prefix
backend:
service:
name: contextservice
port:
number: 8080
- path: /()(restconf/.*)
pathType: Prefix
backend:
service:
name: computeservice
port:
number: 8080
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tfs-ingress-dom2
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: tfs-ingress-class-dom2
rules:
- http:
paths:
- path: /webui(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 8004
- path: /grafana(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 3000
- path: /context(/|$)(.*)
pathType: Prefix
backend:
service:
name: contextservice
port:
number: 8080
- path: /()(restconf/.*)
pathType: Prefix
backend:
service:
name: computeservice
port:
number: 8080
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tfs-ingress-dom3
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: tfs-ingress-class-dom3
rules:
- http:
paths:
- path: /webui(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 8004
- path: /grafana(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 3000
- path: /context(/|$)(.*)
pathType: Prefix
backend:
service:
name: contextservice
port:
number: 8080
- path: /()(restconf/.*)
pathType: Prefix
backend:
service:
name: computeservice
port:
number: 8080
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tfs-ingress-dom4
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: tfs-ingress-class-dom4
rules:
- http:
paths:
- path: /webui(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 8004
- path: /grafana(/|$)(.*)
pathType: Prefix
backend:
service:
name: webuiservice
port:
number: 3000
- path: /context(/|$)(.*)
pathType: Prefix
backend:
service:
name: contextservice
port:
number: 8080
- path: /()(restconf/.*)
pathType: Prefix
backend:
service:
name: computeservice
port:
number: 8080
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment