Andy Bavier | 7a08049 | 2018-08-30 14:26:09 -0700 | [diff] [blame] | 1 | --- |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | apiVersion: apps/v1beta2 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ template "mininet.fullname" . }} |
| 20 | labels: |
| 21 | app: {{ template "mininet.name" . }} |
| 22 | chart: {{ template "mininet.chart" . }} |
| 23 | release: {{ .Release.Name }} |
| 24 | heritage: {{ .Release.Service }} |
| 25 | spec: |
| 26 | replicas: {{ .Values.replicaCount }} |
| 27 | selector: |
| 28 | matchLabels: |
| 29 | app: {{ template "mininet.name" . }} |
| 30 | release: {{ .Release.Name }} |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ template "mininet.name" . }} |
| 35 | release: {{ .Release.Name }} |
Andy Bavier | 7a08049 | 2018-08-30 14:26:09 -0700 | [diff] [blame] | 36 | annotations: |
Andy Bavier | e21a5f5 | 2019-05-28 15:39:52 -0700 | [diff] [blame] | 37 | cni: {{ template "mininet.cni" . }} |
Andy Bavier | 7a08049 | 2018-08-30 14:26:09 -0700 | [diff] [blame] | 38 | spec: |
| 39 | containers: |
| 40 | - name: {{ .Chart.Name }} |
Andy Bavier | f4d29c5 | 2019-09-05 15:40:09 -0700 | [diff] [blame] | 41 | image: "{{ .Values.global.registry }}{{ .Values.images.mininet.repository }}:{{ tpl .Values.images.mininet.tag . }}" |
| 42 | imagePullPolicy: {{ .Values.images.mininet.pullPolicy }} |
Daniele Moro | d4218c1 | 2020-01-22 10:09:13 -0800 | [diff] [blame] | 43 | {{- if gt ($.Values.mnStratumSwitchCount|int) 0 }} |
Daniele Moro | 93c2c50 | 2019-11-05 16:01:36 -0800 | [diff] [blame] | 44 | command: ["python"] |
| 45 | {{- end }} |
| 46 | args: [{{ .Values.topoScript }}] |
Andy Bavier | 7a08049 | 2018-08-30 14:26:09 -0700 | [diff] [blame] | 47 | stdin: true |
| 48 | tty: true |
| 49 | securityContext: |
| 50 | privileged: true |
| 51 | volumeMounts: |
| 52 | - name: "topo-config" |
| 53 | mountPath: "/toposcripts" |
| 54 | resources: |
| 55 | {{ toYaml .Values.resources | indent 12 }} |
| 56 | volumes: |
| 57 | - name: "topo-config" |
| 58 | configMap: |
| 59 | name: "{{ .Release.Name }}-configmap" |
| 60 | defaultMode: 0755 |
| 61 | {{- with .Values.nodeSelector }} |
| 62 | nodeSelector: |
| 63 | {{ toYaml . | indent 8 }} |
| 64 | {{- end }} |
| 65 | {{- with .Values.affinity }} |
| 66 | affinity: |
| 67 | {{ toYaml . | indent 8 }} |
| 68 | {{- end }} |
| 69 | {{- with .Values.tolerations }} |
| 70 | tolerations: |
| 71 | {{ toYaml . | indent 8 }} |
| 72 | {{- end }} |