default storageclass and nfs provisioner 03/83203/3
authorsushil masal <sushil.masal@amdocs.com>
Mon, 25 Mar 2019 13:02:16 +0000 (18:32 +0530)
committerSushil Masal <sushil.masal@amdocs.com>
Wed, 10 Apr 2019 14:08:19 +0000 (14:08 +0000)
Issue-ID: OOM-1500

Change-Id: I15dd98ea8042914220f1b6025e93f65224bb9adb
Signed-off-by: sushil masal <sushil.masal@amdocs.com>
kubernetes/common/nfs-provisioner/Chart.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/requirements.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/templates/service.yaml [new file with mode: 0644]
kubernetes/common/nfs-provisioner/values.yaml [new file with mode: 0644]
kubernetes/onap/requirements.yaml
kubernetes/onap/templates/storageclass.yaml [new file with mode: 0644]
kubernetes/onap/values.yaml

diff --git a/kubernetes/common/nfs-provisioner/Chart.yaml b/kubernetes/common/nfs-provisioner/Chart.yaml
new file mode 100644 (file)
index 0000000..fcb69b3
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+description: NFS provisioner
+name: nfs-provisioner
+version: 4.0.0
diff --git a/kubernetes/common/nfs-provisioner/requirements.yaml b/kubernetes/common/nfs-provisioner/requirements.yaml
new file mode 100644 (file)
index 0000000..d175386
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+dependencies:
+  - name: common
+    version: ~4.x-0
+    repository: '@local'
diff --git a/kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml b/kubernetes/common/nfs-provisioner/templates/nfs-provisoner.yaml
new file mode 100644 (file)
index 0000000..58cf7a3
--- /dev/null
@@ -0,0 +1,78 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: {{ include "common.fullname" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  strategy:
+    type: Recreate
+  template:
+    metadata:
+      labels:
+        app: {{ include "common.fullname" . }}
+        release: {{ .Release.Name }}
+    spec:
+      containers:
+        - name: {{ include "common.fullname" . }}
+          image: "{{ .Values.global.nfsprovisionerRepository | default .Values.nfsprovisionerRepository }}/{{ .Values.nfsprovisionerImage }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          ports:
+            - name: nfs
+              containerPort: {{ .Values.service.nfsPort }}
+            - name: mountd
+              containerPort: {{ .Values.service.mountdPort }}
+            - name: rpcbind
+              containerPort: {{ .Values.service.rpcbindPort }}
+            - name: rpcbind-udp
+              containerPort: {{ .Values.service.rpcbindUdpPort }}
+              protocol: UDP
+          securityContext:
+            capabilities:
+              add:
+                - DAC_READ_SEARCH
+                - SYS_RESOURCE
+          args:
+            - "-provisioner={{ include "common.namespace" . }}/nfs"
+          env:
+            - name: POD_IP
+              valueFrom:
+                fieldRef:
+                  fieldPath: status.podIP
+            - name: SERVICE_NAME
+              value: {{ include "common.servicename" . }}
+            - name: POD_NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+          volumeMounts:
+            - name: export-volume
+              mountPath: /export
+      {{- if .Values.affinity }}
+      affinity:
+      {{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
+      volumes:
+        - name: export-volume
+          hostPath:
+            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}
diff --git a/kubernetes/common/nfs-provisioner/templates/service.yaml b/kubernetes/common/nfs-provisioner/templates/service.yaml
new file mode 100644 (file)
index 0000000..f9bba0f
--- /dev/null
@@ -0,0 +1,39 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+kind: Service
+apiVersion: v1
+metadata:
+  name: {{ include "common.servicename" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.fullname" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  ports:
+    - name: nfs
+      port: {{ .Values.service.nfsPort }}
+    - name: mountd
+      port: {{ .Values.service.mountdPort }}
+    - name: rpcbind
+      port: {{ .Values.service.rpcbindPort }}
+    - name: rpcbind-udp
+      port: {{ .Values.service.rpcbindUdpPort }}
+      protocol: UDP
+  selector:
+    app: {{ include "common.fullname" . }}
\ No newline at end of file
diff --git a/kubernetes/common/nfs-provisioner/values.yaml b/kubernetes/common/nfs-provisioner/values.yaml
new file mode 100644 (file)
index 0000000..687219d
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright © 2019 Amdocs, Bell Canada\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+#################################################################\r
+# Global configuration defaults.\r
+#################################################################\r
+global:\r
+  persistence:\r
+    mountPath: /dockerdata-nfs\r
+\r
+#################################################################\r
+# Application configuration defaults.\r
+#################################################################\r
+\r
+dockerHubRepository: registry.hub.docker.com\r
+pullPolicy: Always\r
+\r
+# default number of instances\r
+\r
+nodeSelector: {}\r
+\r
+affinity: {}\r
+\r
+service:\r
+  name: nfs-provisioner\r
+  nfsPort: 2049\r
+  mountdPort: 20048\r
+  rpcbindPort: 111\r
+  rpcbindUdpPort: 111\r
+\r
+## Persist data to a persitent volume\r
+persistence:\r
+  enabled: true\r
+  mountPath: /dockerdata-nfs\r
+\r
+## NFS provisioner image properties\r
+nfsprovisionerRepository: quay.io\r
+nfsprovisionerImage: kubernetes_incubator/nfs-provisioner:v1.0.8\r
+\r
index 43794d2..ad6aada 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -88,6 +88,10 @@ dependencies:
     version: ~4.x-0
     repository: '@local'
     condition: nbi.enabled
+  - name: nfs-provisioner
+    version: ~4.x-0
+    repository: '@local'
+    condition: nfs-provisioner.enabled
   - name: pnda
     version: ~4.x-0
     repository: '@local'
diff --git a/kubernetes/onap/templates/storageclass.yaml b/kubernetes/onap/templates/storageclass.yaml
new file mode 100644 (file)
index 0000000..5418da7
--- /dev/null
@@ -0,0 +1,34 @@
+{{/*
+# Copyright © 2019 Amdocs, Bell Canada
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+{{ if .Values.global.persistence.enableDefaultStorageclass }}
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+  name: "{{ include "common.namespace" . }}-default-storageclass"
+  namespace: {{ include "common.namespace" . }}
+  annotations:
+    storageclass.kubernetes.io/is-default-class: "true"
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+provisioner: {{ .Values.global.persistence.storageclassProvisioner }}
+reclaimPolicy: {{ .Values.global.persistence.volumeReclaimPolicy }}
+parameters:
+{{ toYaml .Values.global.persistence.parameters | indent 2 }}
+{{ end }}
index 6b283db..b62606e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2018 Amdocs, Bell Canada
+# Copyright © 2019 Amdocs, Bell Canada
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -46,6 +46,10 @@ global:
   # by persistent volumes and log files
   persistence:
     mountPath: /dockerdata-nfs
+    enableDefaultStorageclass: false
+    parameters: {}
+    storageclassProvisioner: kubernetes.io/no-provisioner
+    volumeReclaimPolicy: Retain
 
   # override default resource limit flavor for all charts
   flavor: unlimited
@@ -107,6 +111,8 @@ nbi:
     # openstack configuration
     openStackRegion: "Yolo"
     openStackVNFTenantId: "1234"
+nfs-provisioner:
+  enabled: true
 policy:
   enabled: false
 pomba: