|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright 2021 Nutanix. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +NUTANIX_CSI_SNAPSHOT_VERSION=6.3.3 |
| 17 | +NUTANIX_CSI_STORAGE_VERSION=3.3.4 |
| 18 | + |
| 19 | +helm repo add nutanix-helm-releases https://nutanix.github.io/helm-releases/ --force-update && helm repo update |
| 20 | + |
| 21 | +helm template -n ntnx-system nutanix-snapshot nutanix-helm-releases/nutanix-csi-snapshot --set tls.source=secret > templates/csi3/nutanix-csi-snapshot.yaml |
| 22 | + |
| 23 | +ex templates/csi3/nutanix-csi-snapshot.yaml <<EOF |
| 24 | +%s/caBundle: /caBundle: \${WEBHOOK_CA}/ |
| 25 | +xit |
| 26 | +EOF |
| 27 | + |
| 28 | +helm template -n ntnx-system nutanix-storage nutanix-helm-releases/nutanix-csi-storage --version ${NUTANIX_CSI_STORAGE_VERSION} --set createSecret=false --set createPrismCentralSecret=false > templates/csi3/nutanix-csi-storage.yaml |
| 29 | + |
| 30 | +# Fix 1: Add namespace to nutanix-storage-precheck-job |
| 31 | +# Helm generates the Job without a namespace field, but it needs one for proper deployment |
| 32 | +ex templates/csi3/nutanix-csi-storage.yaml <<EOF |
| 33 | +/kind: Job/;/name: nutanix-storage-precheck-job/a |
| 34 | + namespace: ntnx-system |
| 35 | +. |
| 36 | +xit |
| 37 | +EOF |
| 38 | + |
| 39 | +# Fix 2: Change --http-endpoint to --metrics-address for csi-snapshotter |
| 40 | +# Helm generates --http-endpoint but the csi-snapshotter sidecar expects --metrics-address |
| 41 | +ex templates/csi3/nutanix-csi-storage.yaml <<EOF |
| 42 | +%s/--http-endpoint=:9812/--metrics-address=:9812/ |
| 43 | +xit |
| 44 | +EOF |
0 commit comments