Refactored values.yaml.
Removed unused code.
Added Dynamic-local-pv-executor.
Change-Id: I8fdc05cdf5d433f9f57e0f44cff39b999445c784
Signed-off-by: Balazs Szekeres <balazs.szekeres@nokia.com>
%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}
- 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 }}
--- /dev/null
+{{/*
+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 }}
- 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 }}
metadata:
name: prometheus-pvc
namespace: kube-system
+ annotations:
+ nodeselector:
+ nodetype=caas_master
spec:
accessModes:
- ReadWriteOnce
+++ /dev/null
-{{/*
-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 }}
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:
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 }}
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 %}