Infra chart changes. 60/1860/13
authorBalazs Szekeres <balazs.szekeres@nokia.com>
Mon, 28 Oct 2019 09:00:15 +0000 (10:00 +0100)
committerBalazs Szekeres <balazs.szekeres@nokia.com>
Thu, 7 Nov 2019 12:16:19 +0000 (13:16 +0100)
Refactored values.yaml.
Removed unused code.
Added Dynamic-local-pv-executor.

Change-Id: I8fdc05cdf5d433f9f57e0f44cff39b999445c784
Signed-off-by: Balazs Szekeres <balazs.szekeres@nokia.com>
SPECS/infra-charts.spec
infra-charts/templates/danm-webhook-ds.yaml
infra-charts/templates/dynamic-local-pv-executor.yaml [new file with mode: 0644]
infra-charts/templates/dynamic-local-pv-provisioner.yaml
infra-charts/templates/prometheus-pvc.yaml
infra-charts/templates/storage-local-static-provisioner-service.yaml [deleted file]
infra-charts/templates/storage-local-static-provisioner.yaml
infra-charts/values.yaml.j2

index 364a52c..778a744 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT infra-charts
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 43
+%define RPM_MINOR_VERSION 44
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}
index 72cac41..64d63f4 100644 (file)
@@ -44,9 +44,15 @@ spec:
             - name: webhook-certs
               mountPath: /etc/webhook/certs
               readOnly: true
+            - name: time-mount
+              mountPath: /etc/localtime
+              readOnly: true
       volumes:
         # TODO: make it a secret
         - name: webhook-certs
           hostPath:
             path: /etc/kubernetes/ssl/
+        - name: time-mount
+          hostPath:
+            path: /etc/localtime
 {{ end }}
diff --git a/infra-charts/templates/dynamic-local-pv-executor.yaml b/infra-charts/templates/dynamic-local-pv-executor.yaml
new file mode 100644 (file)
index 0000000..da91fa5
--- /dev/null
@@ -0,0 +1,83 @@
+{{/*
+Copyright 2019 Nokia
+
+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.localstorage.required }}
+---
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+  name: dynamic-local-pv-executor
+  namespace: kube-system
+  label:
+    {{ .Values.kubernetes_component_label }}: {{ .Values.localstorage.dynamiclocalpvprovisioner.name }}
+spec:
+  selector:
+    matchLabels:
+      {{ .Values.kubernetes_component_label }}: {{ .Values.localstorage.dynamiclocalpvprovisioner.name }}
+  template:
+    metadata:
+      labels:
+        {{ .Values.kubernetes_component_label }}: {{ .Values.localstorage.dynamiclocalpvprovisioner.name }}
+    spec:
+      containers:
+      - name: {{ .Values.localstorage.dynamiclocalpvprovisioner.name }}
+        image: {{ .Values.localstorage.dynamiclocalpvprovisioner.image_name }}
+        imagePullPolicy: IfNotPresent
+        command: [ "/executor", "--storagepath={{ .Values.localstorage.local_storage_dir }}" ]
+        volumeMounts:
+        - name: mapper
+          mountPath: /dev/mapper/nova-caas_app
+        - name: sig-storage-mount
+          mountPath: {{ .Values.localstorage.local_storage_dir }}
+          mountPropagation: Bidirectional
+        - name: fstab
+          mountPath: /rootfs/fstab
+        - name: projects
+          mountPath: /etc/projects
+        - name: projid
+          mountPath: /etc/projid
+        - name: time-mount
+          mountPath: /etc/localtime
+          readOnly: true
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
+        securityContext:
+          privileged: true
+      volumes:
+      - name: mapper
+        hostPath:
+          path: /dev/mapper/nova-caas_app
+      - name: sig-storage-mount
+        hostPath:
+          path: {{ .Values.localstorage.local_storage_dir }}
+      - name: fstab
+        hostPath:
+          path: /etc/fstab
+      - name: projects
+        hostPath:
+          path: /etc/projects
+          type: FileOrCreate
+      - name: projid
+        hostPath:
+          path: /etc/projid
+          type: FileOrCreate
+      - name: time-mount
+        hostPath:
+          path: /etc/localtime
+      serviceAccountName: dynamic-pv
+{{ end }}
index dbac399..5772255 100644 (file)
@@ -35,36 +35,21 @@ spec:
       - name: {{ .Values.localstorage.dynamiclocalpvprovisioner.name }}
         image: {{ .Values.localstorage.dynamiclocalpvprovisioner.image_name }}
         imagePullPolicy: IfNotPresent
-        command: [ "/executor", "--storagepath=/mnt/sig_storage" ]
-        volumeMounts:
-        - name: mapper
-          mountPath: /dev/mapper/nova-caas_app
-        - name: sig-storage-mount
-          mountPath: /mnt/sig_storage
-          mountPropagation: Bidirectional
-        - name: fstab
-          mountPath: /rootfs/fstab
+        command: [ "/provisioner" ]
         env:
         - name: NODE_NAME
           valueFrom:
             fieldRef:
               fieldPath: spec.nodeName
-        securityContext:
-          privileged: true
-          capabilities:
-              add:
-                - SYS_ADMIN
+        volumeMounts:
+        - name: time-mount
+          mountPath: /etc/localtime
+          readOnly: true
       volumes:
-      - name: mapper
-        hostPath:
-          path: /dev/mapper/nova-caas_app
-      - name: sig-storage-mount
-        hostPath:
-          path: {{ .Values.localstorage.dynamiclocalpvprovisioner.local_storage_dir }}
-      - name: fstab
-        hostPath:
-          path: /etc/fstab
+        - name: time-mount
+          hostPath:
+            path: /etc/localtime
       nodeSelector:
-        nodename: caas_master1
+        nodetype: caas_master
       serviceAccountName: dynamic-pv
 {{ end }}
index 809ddb7..bcd954c 100644 (file)
@@ -3,6 +3,9 @@ apiVersion: v1
 metadata:
   name: prometheus-pvc
   namespace: kube-system
+  annotations:
+    nodeselector:
+      nodetype=caas_master
 spec:
   accessModes:
     - ReadWriteOnce
diff --git a/infra-charts/templates/storage-local-static-provisioner-service.yaml b/infra-charts/templates/storage-local-static-provisioner-service.yaml
deleted file mode 100644 (file)
index d68aa64..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-{{/*
-Copyright 2019 Nokia
-
-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.localstorage.required }}
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: local-volume-provisioner
-  namespace: kube-system
-  labels:
-    app: local-volume-provisioner
-spec:
-  type: ClusterIP
-  selector:
-    app: local-volume-provisioner
-  ports:
-  - name: metrics
-    port: 8080
-    protocol: TCP
-{{ end }}
index 2fcce74..c29cbcf 100644 (file)
@@ -18,34 +18,31 @@ limitations under the License.
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: local-provisioner-config
+  name: storage-local-static-provisioner-config
   namespace: kube-system
 data:
   storageClassMap: |
     local-volume:
-       hostDir: {{ .Values.localstorage.storagelocalstaticprovisioner.local_storage_dir }}
-       mountDir: {{ .Values.localstorage.storagelocalstaticprovisioner.local_storage_dir }}
-       blockCleanerCommand:
-         - "/scripts/shred.sh"
-         - "2"
+       hostDir: {{ .Values.localstorage.local_storage_dir }}
+       mountDir: {{ .Values.localstorage.local_storage_dir }}
        volumeMode: Filesystem
        fsType: xfs
 ---
 apiVersion: apps/v1
 kind: DaemonSet
 metadata:
-  name: local-volume-provisioner
+  name: storage-local-static-provisioner
   namespace: kube-system
   labels:
-    app: local-volume-provisioner
+    app: storage-local-static-provisioner
 spec:
   selector:
     matchLabels:
-      app: local-volume-provisioner
+      app: storage-local-static-provisioner
   template:
     metadata:
       labels:
-        app: local-volume-provisioner
+        app: storage-local-static-provisioner
     spec:
       serviceAccountName: local-storage-admin
       containers:
@@ -59,17 +56,23 @@ spec:
                 fieldPath: spec.nodeName
           volumeMounts:
             - mountPath: /etc/provisioner/config
-              name: provisioner-config
+              name: storage-local-static-provisioner-config
               readOnly: true
-            - mountPath:  {{ .Values.localstorage.storagelocalstaticprovisioner.local_storage_dir }}
+            - mountPath:  {{ .Values.localstorage.local_storage_dir }}
               name: local-volume
               mountPropagation: "HostToContainer"
+            - name: time-mount
+              mountPath: /etc/localtime
+              readOnly: true
       volumes:
-        - name: provisioner-config
+        - name: storage-local-static-provisioner-config
           configMap:
-            name: local-provisioner-config
+            name: storage-local-static-provisioner-config
         - name: local-volume
           hostPath:
-            path: {{ .Values.localstorage.storagelocalstaticprovisioner.local_storage_dir }}
+            path: {{ .Values.localstorage.local_storage_dir }}
+        - name: time-mount
+          hostPath:
+            path: /etc/localtime
 {{ end }}
 
index 1f9e65e..f433790 100644 (file)
@@ -119,11 +119,10 @@ localstorage:
   required: false
 {% else %}
   required: true
+  local_storage_dir: "{{ caas.local_storage_path }}"
   storagelocalstaticprovisioner:
-    local_storage_dir: "{{ caas.local_storage_path }}"
     image_name: {{ container_image_names | select('search', '/storage_local_static_provisioner') | list | last }}
   dynamiclocalpvprovisioner:
-    local_storage_dir: "{{ caas.local_storage_path }}"
     image_name: {{ container_image_names | select('search', '/dynamic_local_pv_provisioner') | list | last }}
     name: "pv-provisioner"
 {% endif %}