blob: ba653b73eceb55bb4172255ab442a27ce8a9246b [file] [log] [blame]
Andy Bavier7a080492018-08-30 14:26:09 -07001---
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
16apiVersion: apps/v1beta2
17kind: Deployment
18metadata:
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 }}
25spec:
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 Bavier7a080492018-08-30 14:26:09 -070036 annotations:
Andy Baviere21a5f52019-05-28 15:39:52 -070037 cni: {{ template "mininet.cni" . }}
Andy Bavier7a080492018-08-30 14:26:09 -070038 spec:
39 containers:
40 - name: {{ .Chart.Name }}
Andy Bavierf4d29c52019-09-05 15:40:09 -070041 image: "{{ .Values.global.registry }}{{ .Values.images.mininet.repository }}:{{ tpl .Values.images.mininet.tag . }}"
42 imagePullPolicy: {{ .Values.images.mininet.pullPolicy }}
Daniele Morod4218c12020-01-22 10:09:13 -080043{{- if gt ($.Values.mnStratumSwitchCount|int) 0 }}
Daniele Moro93c2c502019-11-05 16:01:36 -080044 command: ["python"]
45{{- end }}
46 args: [{{ .Values.topoScript }}]
Andy Bavier7a080492018-08-30 14:26:09 -070047 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 }}