default storageclass and nfs provisioner
[oom.git] / kubernetes / common / nfs-provisioner / templates / nfs-provisoner.yaml
1 {{/*
2 # Copyright © 2019 Amdocs, Bell Canada
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
17 apiVersion: extensions/v1beta1
18 kind: Deployment
19 metadata:
20   name: {{ include "common.fullname" . }}
21   namespace: {{ include "common.namespace" . }}
22   labels:
23     app: {{ include "common.name" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ .Release.Name }}
26     heritage: {{ .Release.Service }}
27 spec:
28   strategy:
29     type: Recreate
30   template:
31     metadata:
32       labels:
33         app: {{ include "common.fullname" . }}
34         release: {{ .Release.Name }}
35     spec:
36       containers:
37         - name: {{ include "common.fullname" . }}
38           image: "{{ .Values.global.nfsprovisionerRepository | default .Values.nfsprovisionerRepository }}/{{ .Values.nfsprovisionerImage }}"
39           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40           ports:
41             - name: nfs
42               containerPort: {{ .Values.service.nfsPort }}
43             - name: mountd
44               containerPort: {{ .Values.service.mountdPort }}
45             - name: rpcbind
46               containerPort: {{ .Values.service.rpcbindPort }}
47             - name: rpcbind-udp
48               containerPort: {{ .Values.service.rpcbindUdpPort }}
49               protocol: UDP
50           securityContext:
51             capabilities:
52               add:
53                 - DAC_READ_SEARCH
54                 - SYS_RESOURCE
55           args:
56             - "-provisioner={{ include "common.namespace" . }}/nfs"
57           env:
58             - name: POD_IP
59               valueFrom:
60                 fieldRef:
61                   fieldPath: status.podIP
62             - name: SERVICE_NAME
63               value: {{ include "common.servicename" . }}
64             - name: POD_NAMESPACE
65               valueFrom:
66                 fieldRef:
67                   fieldPath: metadata.namespace
68           volumeMounts:
69             - name: export-volume
70               mountPath: /export
71       {{- if .Values.affinity }}
72       affinity:
73       {{ toYaml .Values.affinity | indent 8 }}
74       {{- end }}
75       volumes:
76         - name: export-volume
77           hostPath:
78             path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}