From: Balazs Szekeres Date: Fri, 11 Oct 2019 11:52:46 +0000 (+0200) Subject: Added charts. X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=caf816cf82ecc5f0cd0fe7b988f71ebf0d2e36f5;p=ta%2Fcaas-install.git Added charts. Added charts for storage local static provisoner. Added charts for dynamic local pv provisioner. Change-Id: I39225974392d54a43fadd3354a2aed7c744d5eff Signed-off-by: Balazs Szekeres --- diff --git a/SPECS/infra-charts.spec b/SPECS/infra-charts.spec index 11455d6..05a24ef 100644 --- a/SPECS/infra-charts.spec +++ b/SPECS/infra-charts.spec @@ -15,7 +15,7 @@ %define COMPONENT infra-charts %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 1.0.0 -%define RPM_MINOR_VERSION 40 +%define RPM_MINOR_VERSION 41 Name: %{RPM_NAME} Version: %{RPM_MAJOR_VERSION} diff --git a/SPECS/instantiate.spec b/SPECS/instantiate.spec index b12cc39..e541969 100644 --- a/SPECS/instantiate.spec +++ b/SPECS/instantiate.spec @@ -15,7 +15,7 @@ %define COMPONENT instantiate %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 1.0.0 -%define RPM_MINOR_VERSION 20 +%define RPM_MINOR_VERSION 21 Name: %{RPM_NAME} Version: %{RPM_MAJOR_VERSION} diff --git a/ansible/roles/install_caas_infra/defaults/main.yaml b/ansible/roles/install_caas_infra/defaults/main.yaml index 3e710f2..fcef890 100644 --- a/ansible/roles/install_caas_infra/defaults/main.yaml +++ b/ansible/roles/install_caas_infra/defaults/main.yaml @@ -21,6 +21,8 @@ infra_chart_images: - prometheus - sriovdp - fluentd + - storage_local_static_provisioner + - dynamic_local_pv_provisioner - hyperdanm infra_chart_separated_values: - fluentd diff --git a/cm_config/caas.yaml b/cm_config/caas.yaml index 6d3ec73..cd3dc9c 100644 --- a/cm_config/caas.yaml +++ b/cm_config/caas.yaml @@ -87,6 +87,7 @@ prometheus_data_retention_hours: 6 custom_metrics_api_port: 6443 custom_metrics_api_serviceport: 443 metrics_server_port: 443 +local_storage_path: /mnt/caas_app/ token_filename: token tokenscsv_filename: tokens.csv cert_path: /etc/kubernetes/ssl diff --git a/infra-charts/templates/dynamic-local-pv-provisioner.yaml b/infra-charts/templates/dynamic-local-pv-provisioner.yaml new file mode 100644 index 0000000..dbac399 --- /dev/null +++ b/infra-charts/templates/dynamic-local-pv-provisioner.yaml @@ -0,0 +1,70 @@ +{{/* +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: Deployment +metadata: + name: dynamic-local-pv-provisioner + 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=/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 + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + securityContext: + privileged: true + capabilities: + add: + - SYS_ADMIN + 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 + nodeSelector: + nodename: caas_master1 + serviceAccountName: dynamic-pv +{{ end }} diff --git a/infra-charts/templates/storage-local-static-provisioner-service.yaml b/infra-charts/templates/storage-local-static-provisioner-service.yaml new file mode 100644 index 0000000..d68aa64 --- /dev/null +++ b/infra-charts/templates/storage-local-static-provisioner-service.yaml @@ -0,0 +1,33 @@ +{{/* +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 }} diff --git a/infra-charts/templates/storage-local-static-provisioner.yaml b/infra-charts/templates/storage-local-static-provisioner.yaml new file mode 100644 index 0000000..2fcce74 --- /dev/null +++ b/infra-charts/templates/storage-local-static-provisioner.yaml @@ -0,0 +1,75 @@ +{{/* +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: ConfigMap +metadata: + name: local-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" + volumeMode: Filesystem + fsType: xfs +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: local-volume-provisioner + namespace: kube-system + labels: + app: local-volume-provisioner +spec: + selector: + matchLabels: + app: local-volume-provisioner + template: + metadata: + labels: + app: local-volume-provisioner + spec: + serviceAccountName: local-storage-admin + containers: + - image: {{ .Values.localstorage.storagelocalstaticprovisioner.image_name }} + imagePullPolicy: "Always" + name: provisioner + env: + - name: MY_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + volumeMounts: + - mountPath: /etc/provisioner/config + name: provisioner-config + readOnly: true + - mountPath: {{ .Values.localstorage.storagelocalstaticprovisioner.local_storage_dir }} + name: local-volume + mountPropagation: "HostToContainer" + volumes: + - name: provisioner-config + configMap: + name: local-provisioner-config + - name: local-volume + hostPath: + path: {{ .Values.localstorage.storagelocalstaticprovisioner.local_storage_dir }} +{{ end }} + diff --git a/infra-charts/values.yaml.j2 b/infra-charts/values.yaml.j2 index b441ee6..70e726d 100644 --- a/infra-charts/values.yaml.j2 +++ b/infra-charts/values.yaml.j2 @@ -113,3 +113,17 @@ elasticsearch: sriovdp: required: true image_name: {{ container_image_names | select('search', '/sriovdp') | list | last }} + +localstorage: +{% if ceph_configured is defined and ceph_configured %} + required: false +{% else %} + required: true +{% endif %} + 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"