diff --git a/CHANGELOG.md b/CHANGELOG.md index f11ecf4..8fbad2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## pre 1.0 +### 0.4.0 +* Add initScript container capability +* Bump nettools container image v1.10.0 -> v1.11.0 + ### 0.3.2 * add .helmignore for a clean chart diff --git a/Chart.yaml b/Chart.yaml index 9ad3857..b32018b 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: A helm chart for a SFTP server name: sftp-server -version: 0.3.2 +version: 0.4.0 diff --git a/templates/deployment.yaml b/templates/deployment.yaml index bf44fd4..ed20497 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -25,7 +25,7 @@ spec: {{- end }} annotations: {{- if .Values.vxlanController.enabled }} - {{ .Values.vxlanController.annotationKey }}: | + {{ .Values.vxlanController.annotationKey }}: | {{ .Values.vxlanController.network }} {{ if .Values.vxlanController.ip -}} ip= {{- .Values.vxlanController.ip }} {{- end}} {{ if .Values.vxlanController.route -}} route= {{- .Values.vxlanController.route }} {{- end}} @@ -42,6 +42,29 @@ spec: capabilities: add: ["NET_ADMIN"] {{- end }} + {{- if .Values.initScript.enabled }} + - name: init-script + image: {{ .Values.initScript.image.repository }}:{{ .Values.initScript.image.tag }} + imagePullPolicy: {{ .Values.initScript.image.pullPolicy | quote }} + resources: + {{- toYaml .Values.resources.initScript | trimSuffix "\n" | nindent 10 }} + securityContext: + capabilities: + add: ["NET_ADMIN"] + {{- if .Values.initScript.additionalSecurityContext }} + {{- toYaml .Values.initScript.additionalSecurityContext | trimSuffix "\n" | indent 10 }} + {{- end }} + envFrom: + - configMapRef: + name: {{ template "chart.fullname" . }}-init-script-env + command: + - sh + - /opt/initScript/initScript.sh + volumeMounts: + - name: init-script + mountPath: /opt/initScript/ + readOnly: true + {{- end }} containers: {{- if .Values.debug.enabled }} - name: debug diff --git a/templates/init-script-config.yaml b/templates/init-script-config.yaml new file mode 100644 index 0000000..139a42a --- /dev/null +++ b/templates/init-script-config.yaml @@ -0,0 +1,19 @@ +{{- if .Values.initScript.enabled }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "chart.fullname" . }}-init-script + labels: + {{- if .Values.labels }} + {{- toYaml .Values.labels | trimSuffix "\n" | nindent 4 }} + {{- end }} + app: {{ template "chart.fullname" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + cennso.net/cnf: smc +data: + initScript.sh: | + {{- .Values.initScript.script | trimSuffix "\n" | nindent 4 -}} +{{- end }} \ No newline at end of file diff --git a/templates/init-script-env.yaml b/templates/init-script-env.yaml new file mode 100644 index 0000000..0cdac2e --- /dev/null +++ b/templates/init-script-env.yaml @@ -0,0 +1,18 @@ +--- +{{- if .Values.initScript.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "chart.fullname" . }}-init-script-env + labels: + {{- if .Values.labels }} + {{- toYaml .Values.labels | trimSuffix "\n" | nindent 4 }} + {{- end }} + app: {{ template "chart.fullname" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + cennso.net/cnf: smc +data: +{{- toYaml .Values.initScript.env | trimSuffix "\n" | nindent 2 }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index da4fc60..2d1922d 100644 --- a/values.yaml +++ b/values.yaml @@ -28,11 +28,21 @@ sftpConfig: #- ssh_host_ed25519_key authorizedKeys: {} +initScript: + enabled: false + env: {} + image: + repository: quay.io/travelping/nettools + tag: v1.11.0 + pullPolicy: IfNotPresent + script: | + echo "script configuration is missing" + debug: enabled: false image: repository: quay.io/travelping/nettools - tag: v1.10.0 + tag: v1.11.0 pullPolicy: IfNotPresent persistentVolume: @@ -79,6 +89,13 @@ resources: requests: cpu: 50m memory: 32Mi + networkInit: + limits: + cpu: 500m + memory: 192Mi + requests: + cpu: 500m + memory: 192Mi nodeSelector: {}