diff --git a/Makefile b/Makefile index dd60501..a475d3f 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ clean: .PHONY: helm_lint helm_lint: clean helm-install tools/helm_tk.sh $(HELM) - mkdir -p build/charts/maas - cp -R charts/maas build/charts/ + mkdir -p build/charts/ + cp -R charts/* build/charts/ $(HELM) dep up build/charts/maas $(HELM) lint build/charts/maas diff --git a/charts/deps/.gitkeep b/charts/deps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/charts/maas/Chart.yaml b/charts/maas/Chart.yaml index 399b3b3..1453619 100755 --- a/charts/maas/Chart.yaml +++ b/charts/maas/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 description: Chart to run Canonical MaaS name: maas -version: 0.1.1 +version: 0.1.2 home: https://docs.ubuntu.com/maas sources: - https://git.launchpad.net/maas diff --git a/charts/maas/requirements.yaml b/charts/maas/requirements.yaml index c81c213..f0eabff 100644 --- a/charts/maas/requirements.yaml +++ b/charts/maas/requirements.yaml @@ -14,5 +14,5 @@ dependencies: - name: helm-toolkit - repository: http://localhost:8879/charts + repository: file://../deps/helm-toolkit version: ">= 0.1.0" diff --git a/charts/maas/templates/statefulset-maas-syslog.yaml b/charts/maas/templates/statefulset-maas-syslog.yaml index 875a289..fb1321b 100644 --- a/charts/maas/templates/statefulset-maas-syslog.yaml +++ b/charts/maas/templates/statefulset-maas-syslog.yaml @@ -122,12 +122,11 @@ spec: volumeClaimTemplates: - metadata: name: syslog-archive - annotations: - {{ .Values.storage.syslog.pvc.class_path }}: {{ .Values.storage.syslog.pvc.class_name }} spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: {{ .Values.storage.syslog.pvc.size }} + storageClassName: {{ .Values.storage.syslog.pvc.class_name }} ... {{- end }} diff --git a/charts/maas/templates/statefulset-rack.yaml b/charts/maas/templates/statefulset-rack.yaml index bbf8b6d..08178ef 100644 --- a/charts/maas/templates/statefulset-rack.yaml +++ b/charts/maas/templates/statefulset-rack.yaml @@ -178,11 +178,10 @@ spec: volumeClaimTemplates: - metadata: name: rackd-state - annotations: - {{ .Values.storage.rackd.pvc.class_path }}: {{ .Values.storage.rackd.pvc.class_name }} spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: {{ .Values.storage.rackd.pvc.size }} + storageClassName: {{ .Values.storage.rackd.pvc.class_name }} {{- end }} diff --git a/charts/maas/templates/statefulset-region.yaml b/charts/maas/templates/statefulset-region.yaml index f8c6562..9dda50d 100644 --- a/charts/maas/templates/statefulset-region.yaml +++ b/charts/maas/templates/statefulset-region.yaml @@ -200,13 +200,12 @@ spec: volumeClaimTemplates: - metadata: name: syslog-archive - annotations: - {{ .Values.storage.syslog.pvc.class_path }}: {{ .Values.storage.syslog.pvc.class_name }} spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: {{ .Values.storage.syslog.pvc.size }} + storageClassName: {{ .Values.storage.syslog.pvc.class_name }} {{- end }} ... {{- end }} diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml index 8f006d7..7daec84 100644 --- a/charts/maas/values.yaml +++ b/charts/maas/values.yaml @@ -161,12 +161,10 @@ network: storage: syslog: pvc: - class_path: volume.beta.kubernetes.io/storage-class class_name: general size: 1Gi rackd: pvc: - class_path: volume.beta.kubernetes.io/storage-class class_name: general size: 5Gi diff --git a/tools/helm_install.sh b/tools/helm_install.sh index a4da357..916d004 100755 --- a/tools/helm_install.sh +++ b/tools/helm_install.sh @@ -17,7 +17,7 @@ set -x HELM=$1 -HELM_ARTIFACT_URL=${HELM_ARTIFACT_URL:-"https://get.helm.sh/helm-v2.17.0-linux-amd64.tar.gz"} +HELM_ARTIFACT_URL=${HELM_ARTIFACT_URL:-"https://get.helm.sh/helm-v3.9.4-linux-amd64.tar.gz"} function install_helm_binary { diff --git a/tools/helm_tk.sh b/tools/helm_tk.sh index bd9bf39..88e175f 100755 --- a/tools/helm_tk.sh +++ b/tools/helm_tk.sh @@ -12,57 +12,20 @@ # 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. -# -# Script to setup helm-toolkit and helm dep up the shipyard chart -# -HELM=$1 -HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm-infra"} -HTK_PATH=${HTK_PATH:-""} -HTK_STABLE_COMMIT=${HTK_COMMIT:-"f4972121bcb41c8d74748917804d2b239ab757f9"} -DEP_UP_LIST=${DEP_UP_LIST:-"maas"} -if [[ ! -z $(echo $http_proxy) ]] -then - export no_proxy=$no_proxy,127.0.0.1 -fi -set -x +set -eux -function helm_serve { - if [[ -d "$HOME/.helm" ]]; then - echo ".helm directory found" - else - ${HELM} init --client-only --skip-refresh - fi - if [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; then - ${HELM} serve & > /dev/null - while [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; do - sleep 1 - echo "Waiting for Helm Repository" - done - else - echo "Helm serve already running" - fi +HTK_REPO=${HTK_REPO:-"https://opendev.org/openstack/openstack-helm-infra.git"} +HTK_STABLE_COMMIT=${HTK_COMMIT:-"ee331fd0d38e3584fecbefbf6218ba0c8e112338"} - if ${HELM} repo list | grep -q "^stable" ; then - ${HELM} repo remove stable - fi +TMP_DIR=$(mktemp -d) - ${HELM} repo add local http://localhost:8879/charts +{ + HTK_REPO_DIR=$TMP_DIR/htk + git clone "$HTK_REPO" "$HTK_REPO_DIR" + (cd "$HTK_REPO_DIR" && git reset --hard "${HTK_STABLE_COMMIT}") + cp -r "${HTK_REPO_DIR}/helm-toolkit" charts/deps/ } -# OSH Makefile is bugged, so ensure helm is in the path -if [[ ${HELM} != "helm" ]] -then - export PATH=${PATH}:$(dirname ${HELM}) -fi - -mkdir -p build -pushd build -git clone $HTK_REPO ./htk-repo || true -pushd ./htk-repo/$HTK_PATH -git reset --hard "${HTK_STABLE_COMMIT}" - -helm_serve -make helm-toolkit -popd && popd +rm -rf "${TMP_DIR}"