diff options
author | shreyagupta30 <shreyagupta3011@gmail.com> | 2021-09-27 14:35:36 +0530 |
---|---|---|
committer | shreyagupta30 <shreyagupta3011@gmail.com> | 2021-10-11 23:16:53 +0530 |
commit | eef9fef1141c6295b824b884ad86d645cd1c094f (patch) | |
tree | 1d1b6a8b08015eb190bb6cfbd56536ac4f10ad2d /tools/k8s/app-deployment/helm/charts | |
parent | 17e20bfa70d1a9ce5e6ee6687245e3e22f3633a8 (diff) |
Automated deployment of helm charts with python
This patch adds demo helm charts and a python script that automatically deploys any helm chart of user's choice and print all the useful information about the chart.
Signed-off-by: Shreya Gupta <shreyagupta3011@gmail.com>
Change-Id: I06e3a8012602e09f601f70def386ef267c870e94
Diffstat (limited to 'tools/k8s/app-deployment/helm/charts')
17 files changed, 303 insertions, 0 deletions
diff --git a/tools/k8s/app-deployment/helm/charts/mynet.yaml b/tools/k8s/app-deployment/helm/charts/mynet.yaml new file mode 100644 index 00000000..ca3af9a7 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/mynet.yaml @@ -0,0 +1,20 @@ +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: mynet +spec: + config: '{ + "cniVersion":"0.3.0" + "name":"mynet" + "plugins":[ + { + "bridge":"kube-bridge", + "ipam":{ + "subnet":10.244.0.0/24", + "type":"host-local" + }, + "isDefaultGateway":true, + "type":"bridge" + } + ] + }' diff --git a/tools/k8s/app-deployment/helm/charts/pod.yaml b/tools/k8s/app-deployment/helm/charts/pod.yaml new file mode 100644 index 00000000..942c8f97 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/pod.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Pod +metadata: + name: nginx + annotations: + k8s.v1.cni.cncf.io/networks: mynet + +spec: + containers: + - name: prox + image: opnfv/rapid:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + - name: nginx + image: nginx:alpine + ports: + - containerPort: 80 diff --git a/tools/k8s/app-deployment/helm/charts/proxchart/Chart.yaml b/tools/k8s/app-deployment/helm/charts/proxchart/Chart.yaml new file mode 100644 index 00000000..6acc06f4 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/proxchart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: proxchart +version: 0.1.0 +appVersion: "1.0" +description: To deploy prox diff --git a/tools/k8s/app-deployment/helm/charts/proxchart/templates/daemonset.yaml b/tools/k8s/app-deployment/helm/charts/proxchart/templates/daemonset.yaml new file mode 100644 index 00000000..e1d3a563 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/proxchart/templates/daemonset.yaml @@ -0,0 +1,25 @@ +{{- if eq .Values.kind "DaemonSet"}} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: prox + annotations: + k8s.v1.cni.cncf.io/networks: "{{- join "\",\"" .Values.extraInterfaces }}" +spec: + selector: + matchLabels: + app: prox + template: + metadata: + labels: + app: prox + spec: + containers: + - name: prox + image: opnfv/rapid:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + nodeSelector: + {{- .Values.nodeSelector.matchLables | toYaml | nindent 12 }} +{{- end }} diff --git a/tools/k8s/app-deployment/helm/charts/proxchart/templates/deployment.yaml b/tools/k8s/app-deployment/helm/charts/proxchart/templates/deployment.yaml new file mode 100644 index 00000000..235b02cd --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/proxchart/templates/deployment.yaml @@ -0,0 +1,30 @@ +{{- if eq .Values.kind "Deployment"}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: prox + annotations: + k8s.v1.cni.cncf.io/networks: "{{- join "\",\"" .Values.extraInterfaces | toYaml | nindent 8}}" +spec: + selector: + matchLabels: + app: prox + replicas: {{ .Values.replicas }} + template: + metadata: + labels: + app: prox + spec: + containers: + - name: prox + image: opnfv/rapid:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + - name: nginx + image: nginx:alpine + ports: + - containerPort: 80 + nodeSelector: + {{- .Values.nodeSelector.matchLables | toYaml | nindent 12 }} +{{- end }} diff --git a/tools/k8s/app-deployment/helm/charts/proxchart/templates/service.yaml b/tools/k8s/app-deployment/helm/charts/proxchart/templates/service.yaml new file mode 100644 index 00000000..15215f35 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/proxchart/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: proxchart +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http diff --git a/tools/k8s/app-deployment/helm/charts/proxchart/values.yaml b/tools/k8s/app-deployment/helm/charts/proxchart/values.yaml new file mode 100644 index 00000000..405e4c25 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/proxchart/values.yaml @@ -0,0 +1,20 @@ +# daemonset, deployment +kind: Deployment + +# Nodes to deploy on +nodeSelector: {} + # matchLables: + # key1: value1 + # key2: value2 + +# multus +metacniType: multus +extraInterfaces: + net-attach-def1 + net-attach-def2 + +replicas: 1 + +service: + type: NodePort + port: 8081 diff --git a/tools/k8s/app-deployment/helm/charts/testpmdchart/Chart.yaml b/tools/k8s/app-deployment/helm/charts/testpmdchart/Chart.yaml new file mode 100644 index 00000000..85e8f7d0 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/testpmdchart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: testpmdchart +version: 0.1.0 +appVersion: "1.0" +description: To deploy test pmd diff --git a/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/daemonset.yaml b/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/daemonset.yaml new file mode 100644 index 00000000..10a812f6 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/daemonset.yaml @@ -0,0 +1,25 @@ +{{- if eq .Values.kind "DaemonSet"}} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: testpmd + annotations: + k8s.v1.cni.cncf.io/networks: "{{- join "\",\"" .Values.extraInterfaces }}" +spec: + selector: + matchLabels: + app: testpmd + template: + metadata: + labels: + app: testpmd + spec: + containers: + - name: testpmd + image: ovsperf/dpdkfwd:lakelse + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + nodeSelector: + {{- .Values.nodeSelector.matchLables | toYaml | nindent 12 }} +{{- end }} diff --git a/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/deployment.yaml b/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/deployment.yaml new file mode 100644 index 00000000..6df47ff1 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/deployment.yaml @@ -0,0 +1,26 @@ +{{- if eq .Values.kind "Deployment"}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: testpmd + annotations: + k8s.v1.cni.cncf.io/networks: "{{- join "\",\"" .Values.extraInterfaces | toYaml | nindent 8}}" +spec: + selector: + matchLabels: + app: testpmd + replicas: {{ .Values.replicas }} + template: + metadata: + labels: + app: testpmd + spec: + containers: + - name: testpmd + image: vsperf/dpdkfwd:lakelse + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + nodeSelector: + {{- .Values.nodeSelector.matchLables | toYaml | nindent 12 }} +{{- end }} diff --git a/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/service.yaml b/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/service.yaml new file mode 100644 index 00000000..50f75629 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/testpmdchart/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: testpmdchart +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http diff --git a/tools/k8s/app-deployment/helm/charts/testpmdchart/values.yaml b/tools/k8s/app-deployment/helm/charts/testpmdchart/values.yaml new file mode 100644 index 00000000..af6be613 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/testpmdchart/values.yaml @@ -0,0 +1,20 @@ +# daemonset, deployment +kind: Deployment + +# Nodes to deploy on +nodeSelector: + # matchLables: + # key1: value1 + # key2: value2 + +# multus +metacniType: multus +extraInterfaces: + net-attach-def1 + net-attach-def2 + +replicas: 1 + +service: + type: NodePort + port: 8081 diff --git a/tools/k8s/app-deployment/helm/charts/trexchart/Chart.yaml b/tools/k8s/app-deployment/helm/charts/trexchart/Chart.yaml new file mode 100644 index 00000000..1dfb7b0b --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/trexchart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: trexchart +description: A Helm chart for trex Deployment +version: 0.1.0 +appVersion: "1.0" diff --git a/tools/k8s/app-deployment/helm/charts/trexchart/templates/daemonset.yaml b/tools/k8s/app-deployment/helm/charts/trexchart/templates/daemonset.yaml new file mode 100644 index 00000000..39d4662f --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/trexchart/templates/daemonset.yaml @@ -0,0 +1,25 @@ +{{- if eq .Values.kind "DaemonSet"}} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: trex + annotations: + k8s.v1.cni.cncf.io/networks: "{{- join "\",\"" .Values.extraInterfaces }}" +spec: + selector: + matchLabels: + app: trex + template: + metadata: + labels: + app: trex + spec: + containers: + - name: trex + image: vsperf/trex:lakelse + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + nodeSelector: + {{- .Values.nodeSelector.matchLables | toYaml | nindent 12 }} +{{- end }} diff --git a/tools/k8s/app-deployment/helm/charts/trexchart/templates/deployment.yaml b/tools/k8s/app-deployment/helm/charts/trexchart/templates/deployment.yaml new file mode 100644 index 00000000..8b0f447e --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/trexchart/templates/deployment.yaml @@ -0,0 +1,26 @@ +{{- if eq .Values.kind "Deployment"}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: trex + annotations: + k8s.v1.cni.cncf.io/networks: "{{- join "\",\"" .Values.extraInterfaces | toYaml | nindent 8}}" +spec: + selector: + matchLabels: + app: trex + replicas: {{ .Values.replicas }} + template: + metadata: + labels: + app: trex + spec: + containers: + - name: trex + image: vsperf/trex:lakelse + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + nodeSelector: + {{- .Values.nodeSelector.matchLables | toYaml | nindent 12 }} +{{- end }} diff --git a/tools/k8s/app-deployment/helm/charts/trexchart/templates/service.yaml b/tools/k8s/app-deployment/helm/charts/trexchart/templates/service.yaml new file mode 100644 index 00000000..8965194d --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/trexchart/templates/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: trexchart +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http diff --git a/tools/k8s/app-deployment/helm/charts/trexchart/values.yaml b/tools/k8s/app-deployment/helm/charts/trexchart/values.yaml new file mode 100644 index 00000000..ed289cf9 --- /dev/null +++ b/tools/k8s/app-deployment/helm/charts/trexchart/values.yaml @@ -0,0 +1,20 @@ +# daemonset, deployment +kind: DaemonSet + +# Nodes to deploy on +nodeSelector: + # matchLables: + # key1: value1 + # key2: value2 + +# multus +metacniType: multus +extraInterfaces: + net-attach-def1 + net-attach-def2 + +replicas: 1 + +service: + type: NodePort + port: 8081 |