Restore pv and pvc in mysql chart 97/41597/5
authorjmac <james.macnider@amdocs.com>
Sun, 8 Apr 2018 19:28:01 +0000 (19:28 +0000)
committerBorislavG <Borislav.Glozman@amdocs.com>
Tue, 10 Apr 2018 07:54:36 +0000 (07:54 +0000)
This change restores the pv.yaml and pvc.yaml that were previously
removed.  These are required for the case when the NFS provisioner is
disabled.  I've added a condition to these files such that they should
be disabled if the NFS provisioner is enabled.  The two ways of
managing entities need to be mutually exclusive.

Borislav: Solution for directory creation problem
  upon first deployment with persistence enabled

Borislav: Fixed licenses for mysql

Change-Id: I9879b3b6574f8026a28793b9d86d6ef3ec9ce2e9
Signed-off-by: jmac <james.macnider@amdocs.com>
Issue-ID: OOM-889

12 files changed:
kubernetes/appc/values.yaml
kubernetes/common/mysql/Chart.yaml
kubernetes/common/mysql/requirements.yaml
kubernetes/common/mysql/templates/configmap.yaml
kubernetes/common/mysql/templates/nfs-provisoner.yaml
kubernetes/common/mysql/templates/pv.yaml [new file with mode: 0644]
kubernetes/common/mysql/templates/pvc.yaml [new file with mode: 0644]
kubernetes/common/mysql/templates/secrets.yaml
kubernetes/common/mysql/templates/service.yaml
kubernetes/common/mysql/templates/statefulset.yaml
kubernetes/common/mysql/templates/storageclass.yaml
kubernetes/common/mysql/values.yaml

index ea3239e..1330bd2 100644 (file)
@@ -19,7 +19,7 @@ global:
   nodePortPrefix: 302
   repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
   readinessRepository: oomk8s
-  readinessImage: readiness-check:1.1.0
+  readinessImage: readiness-check:1.1.1
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
   persistence:
index 99e7c44..b2e7d4a 100644 (file)
@@ -1,3 +1,17 @@
+# Copyright © 2017 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: MySQL Server
 name: mysql
index acca8ef..ce82a2f 100644 (file)
@@ -1,4 +1,18 @@
+# Copyright © 2017 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: ~2.0.0
-    repository: '@local'
\ No newline at end of file
+    repository: '@local'
index dd2b5b7..ff127e4 100644 (file)
@@ -1,3 +1,19 @@
+{{/*
+# Copyright © 2017 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
 kind: ConfigMap
 metadata:
index 7d12c59..3f19977 100644 (file)
@@ -1,3 +1,19 @@
+{{/*
+# Copyright © 2017 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 not .Values.disableNfsProvisioner }}
 apiVersion: extensions/v1beta1
 kind: Deployment
@@ -58,5 +74,5 @@ spec:
       volumes:
         - name: export-volume
           hostPath:
-            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
+            path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountSubPath }}
 #{{ end }}
diff --git a/kubernetes/common/mysql/templates/pv.yaml b/kubernetes/common/mysql/templates/pv.yaml
new file mode 100644 (file)
index 0000000..1cc92ac
--- /dev/null
@@ -0,0 +1,38 @@
+{{/*
+# Copyright © 2017 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 (and (and (.Values.persistence.enabled) (not .Values.persistence.existingClaim)) ( .Values.disableNfsProvisioner)) -}}
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+  name: {{ include "common.fullname" . }}-data
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+    name: {{ include "common.fullname" . }}
+spec:
+  capacity:
+    storage: {{ .Values.persistence.size}}
+  accessModes:
+    - {{ .Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
+  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+  hostPath:
+    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountSubPath }}
+{{- end -}}
diff --git a/kubernetes/common/mysql/templates/pvc.yaml b/kubernetes/common/mysql/templates/pvc.yaml
new file mode 100644 (file)
index 0000000..edb370a
--- /dev/null
@@ -0,0 +1,39 @@
+{{/*
+# Copyright © 2017 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 (and (and (.Values.persistence.enabled) (not .Values.persistence.existingClaim)) ( .Values.disableNfsProvisioner)) -}}
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+  name: {{ include "common.fullname" . }}-data
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.fullname" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+{{- if .Values.persistence.annotations }}
+  annotations:
+{{ toYaml .Values.persistence.annotations | indent 4 }}
+{{- end }}
+spec:
+  accessModes:
+    - {{ .Values.persistence.accessMode }}
+  resources:
+    requests:
+      storage: {{ .Values.persistence.size }}
+  storageClassName: "{{ include "common.fullname" . }}-data"
+{{- end -}}
index 7604be8..7f9b123 100644 (file)
@@ -1,3 +1,19 @@
+{{/*
+# Copyright © 2017 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
 kind: Secret
 metadata:
@@ -10,4 +26,4 @@ metadata:
     heritage: {{ .Release.Service }}
 type: Opaque
 data:
-  db-root-password: {{ .Values.config.dbRootPassword | b64enc | quote }}
\ No newline at end of file
+  db-root-password: {{ .Values.config.dbRootPassword | b64enc | quote }}
index 6b8dbfb..032920c 100644 (file)
@@ -1,3 +1,19 @@
+{{/*
+# Copyright © 2017 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
 kind: Service
 metadata:
index 0304639..e436988 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright © 2017-2018 Amdocs, Bell Canada
+{{/*
+# Copyright © 2017 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.
@@ -11,6 +12,7 @@
 # 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: apps/v1beta1
 kind: StatefulSet
@@ -49,7 +51,7 @@ spec:
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
 #{{ end }}
       - name: init-mysql
-        image: "{{ .Values.repository | default .Values.repository }}/{{ .Values.image }}"
+        image: "{{ .Values.dockerHubRepository }}/{{ .Values.image }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         command:
         - bash
@@ -105,14 +107,12 @@ spec:
         volumeMounts:
         - name: {{ include "common.fullname" . }}-data
           mountPath: /var/lib/mysql
-          subPath: mysql
         - name: conf
           mountPath: /etc/mysql/conf.d
 
       containers:
-        #sdnc-db-container
         - name: {{ include "common.name" . }}
-          image: "{{ .Values.repository | default .Values.repository }}/{{ .Values.image }}"
+          image: "{{ .Values.dockerHubRepository }}/{{ .Values.image }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
@@ -144,7 +144,6 @@ spec:
           volumeMounts:
           - mountPath: /var/lib/mysql
             name: {{ include "common.fullname" . }}-data
-            subPath: mysql
           - mountPath: /etc/mysql/conf.d
             name: conf
           resources:
@@ -225,7 +224,6 @@ spec:
           volumeMounts:
           - name: {{ include "common.fullname" . }}-data
             mountPath: /var/lib/mysql
-            subPath: mysql
           - name: conf
             mountPath: /etc/mysql/conf.d
       volumes:
index 1a4e6b6..398c998 100644 (file)
@@ -1,3 +1,19 @@
+{{/*
+# Copyright © 2017 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: StorageClass
 apiVersion: storage.k8s.io/v1
 metadata:
index 43b690a..1e8c8bd 100644 (file)
@@ -1,3 +1,17 @@
+# Copyright © 2017 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.
+
 #################################################################
 # Global configuration defaults.
 #################################################################
@@ -6,15 +20,14 @@ global:
   repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
   persistence: {}
   readinessRepository: oomk8s
-  readinessImage: readiness-check:1.0.0
+  readinessImage: readiness-check:1.1.1
 
 
 #################################################################
 # Application configuration defaults.
 #################################################################
 
-#repository: mysql
-repository: registry.hub.docker.com
+dockerHubRepository: registry.hub.docker.com
 image: library/mysql:5.7
 pullPolicy: Always
 
@@ -29,6 +42,8 @@ nodeSelector: {}
 
 affinity: {}
 
+disableNfsProvisioner: true
+
 # probe configuration parameters
 liveness:
   initialDelaySeconds: 30
@@ -61,7 +76,7 @@ persistence:
   accessMode: ReadWriteMany
   size: 1Gi
   mountPath: /dockerdata-nfs
-  mountSubPath: mysql/data
+  mountSubPath: "mysql/data"
 
 service:
   name: mysql