diff --git a/CHANGELOG.md b/CHANGELOG.md index a5461b7021017ed6ce173dfedcbe1b1e49dfce7f..fa17b918a5f3e3fd34dd1c0e1989eec07367fb73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,4 +2,5 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -## [Unreleased] \ No newline at end of file +## [0.1.3-alpha-bb.0] - 2022-06-24 +- Initial Chart creation \ No newline at end of file diff --git a/Makefile b/Makefile index d1b3e23c9812ad43daf72a8a8988f98b1ad77dd8..0b0ea51624f48a13d90563e0b669369794c21304 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ +install: + helm install kv ./chart --create-namespace --namespace kubevirt + +move-images: + scripts/move-images.sh + update-chart: - #export VERSION=0.53.0 - curl -sSLO https://github.com/kubevirt/kubevirt/releases/download/v${VERSION}/kubevirt-operator.yaml - curl -sSLO https://github.com/kubevirt/kubevirt/releases/download/v${VERSION}/kubevirt-cr.yaml - kustomize build -o chart/templates - mv chart/templates/apiextensions.k8s.io_v1_customresourcedefinition_kubevirts.kubevirt.io.yaml chart/crds/ - -clean: - rm -rf kubevirt-operator.yaml kubevirt-cr.yaml \ No newline at end of file + scripts/update-chart.sh + +update-readme: + scripts/readme-update.sh + +uninstall: + scripts/uninstall.sh diff --git a/README.md b/README.md index 87454d33e2c9a9bcb5e9a92e5f20db25c93ccdc1..75419f7ad43b5449423698992314d1e234f0b262 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # kubevirt -   +   KubeVirt Big Bang package @@ -30,9 +30,9 @@ helm install kubevirt chart/ | Key | Type | Default | Description | |-----|------|---------|-------------| -| deployment.spec.replicas | int | `2` | | +| deployment.spec.replicas | int | `2` | replica count | | deployment.spec.template.spec.containers.image.name | string | `"virt-operator"` | | -| deployment.spec.template.spec.containers.image.registry | string | `"quay.io/kubevirt/"` | | +| deployment.spec.template.spec.containers.image.registry | string | `"registry.dso.mil/platform-one/big-bang/apps/third-party/kubevirt"` | | | deployment.spec.template.spec.containers.image.version | string | `"v0.53.0"` | | | deployment.spec.template.spec.containers.command.port | int | `8443` | | | deployment.spec.template.spec.containers.command.verbosity | int | `2` | | diff --git a/chart/Chart.yaml b/chart/Chart.yaml index b5fa3196b2eee47da4f604be65f7b905e69f2804..4bfaed95e4b17be6c67d682d64ca8c4d74027113 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: kubevirt description: KubeVirt Big Bang package type: application -version: 0.1.2-alpha-bb.0 +version: 0.1.3-alpha-bb.0 appVersion: "0.53.0" diff --git a/chart/templates/apps_v1_deployment_virt-operator.yaml b/chart/templates/apps_v1_deployment_virt-operator.yaml index 727a82afd5c8dca32177defd98bb42e11478a39f..3621e52851ff9ac25739d64a86e4b7839e54d5fc 100644 --- a/chart/templates/apps_v1_deployment_virt-operator.yaml +++ b/chart/templates/apps_v1_deployment_virt-operator.yaml @@ -42,14 +42,14 @@ spec: - "{{ .command.verbosity }}" env: - name: OPERATOR_IMAGE - value: {{ .image.registry }}{{ .image.name }}:{{ .image.version }} + value: {{ .image.registry }}/{{ .image.name }}:{{ .image.version }} - name: WATCH_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.annotations['olm.targetNamespaces'] - image: {{ .image.registry }}{{ .image.name }}:{{ .image.version }} + image: {{ .image.registry }}/{{ .image.name }}:{{ .image.version }} imagePullPolicy: IfNotPresent - name: virt-operator + name: {{ .image.name }} ports: - containerPort: {{ .ports.metricsPort }} name: metrics diff --git a/chart/templates/kubevirt.io_v1_kubevirt_kubevirt.yaml b/chart/templates/kubevirt.io_v1_kubevirt_kubevirt.yaml index f4a3965b9ac1a26fdd9dae6593854520f8fca08f..772fd71a855d47310e6d9bc56f0a63a4c99dcae3 100644 --- a/chart/templates/kubevirt.io_v1_kubevirt_kubevirt.yaml +++ b/chart/templates/kubevirt.io_v1_kubevirt_kubevirt.yaml @@ -10,6 +10,7 @@ spec: featureGates: [] customizeComponents: {} imagePullPolicy: IfNotPresent + imageRegistry: {{ .Values.deployment.spec.template.spec.containers.image.registry }} infra: replicas: {{ .Values.deployment.spec.replicas }} workloadUpdateStrategy: {} diff --git a/chart/templates/tests/test-service.yaml b/chart/templates/tests/test-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..744dad0318e80819ecd7d3a8264c88d69822d5f4 --- /dev/null +++ b/chart/templates/tests/test-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: kubevirt-service-test + annotations: + "helm.sh/hook": test +spec: + containers: + - command: ["/bin/sh"] + args: ["-c", "nc -w 3 virt-api.kubevirt.svc.cluster.local 443;exit $?;"] + image: registry.dso.mil/platform-one/big-bang/apps/third-party/kubevirt/busybox:latest + name: kubevirt-service-test + restartPolicy: Never diff --git a/chart/values.yaml b/chart/values.yaml index ff21232cba49616be55219075674d84b4b337206..cd2a49a748456d4f0be7751fcd785a7bee89b759 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,12 +1,13 @@ deployment: spec: + # -- replica count replicas: 2 template: spec: containers: image: name: virt-operator - registry: quay.io/kubevirt/ + registry: registry.dso.mil/platform-one/big-bang/apps/third-party/kubevirt version: v0.53.0 command: port: 8443 diff --git a/scripts/move-images.sh b/scripts/move-images.sh new file mode 100755 index 0000000000000000000000000000000000000000..651c96038001757891daccb0cd5232192905ac9c --- /dev/null +++ b/scripts/move-images.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Image Info +export IMGSRC_REPO=quay.io +export IMGSRC_PROJ=kubevirt +export IMGDST_REPO=registry.dso.mil +export IMGDST_PROJ=platform-one/big-bang/apps/third-party/kubevirt +export IMGTAG=v0.53.0 + +function pullTagPush() { + export IMGNAME=$1 + docker pull $IMGSRC_REPO/$IMGSRC_PROJ/$IMGNAME:$IMGTAG + docker tag $IMGSRC_REPO/$IMGSRC_PROJ/$IMGNAME:$IMGTAG $IMGDST_REPO/$IMGDST_PROJ/$IMGNAME:$IMGTAG + docker login $IMGDST_REPO + docker push $IMGDST_REPO/$IMGDST_PROJ/$IMGNAME:$IMGTAG +} + +pullTagPush virt-api +pullTagPush virt-launcher +pullTagPush virt-handler +pullTagPush virt-operator +pullTagPush virt-controller \ No newline at end of file diff --git a/scripts/readme-update.sh b/scripts/readme-update.sh new file mode 100755 index 0000000000000000000000000000000000000000..4e88184f1c89082cb62939fd5bd84bc7b3adc859 --- /dev/null +++ b/scripts/readme-update.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# source: https://repo1.dso.mil/platform-one/big-bang/apps/library-charts/gluon/-/blob/master/docs/bb-package-readme.md + +curl -sS -O https://repo1.dso.mil/platform-one/big-bang/apps/library-charts/gluon/-/raw/master/docs/README.md.gotmpl +curl -sS -O https://repo1.dso.mil/platform-one/big-bang/apps/library-charts/gluon/-/raw/master/docs/.helmdocsignore + +# Update to your helm-docs binary path +/usr/local/bin/helm-docs -s file -t `pwd`/README.md.gotmpl --dry-run > README.md +# Uncomment to use docker +# docker run --rm -v "`pwd`:/helm-docs" -u $(id -u) jnorwood/helm-docs:v1.5.0 -s file -t /helm-docs/README.md.gotmpl --dry-run > README.md + +rm README.md.gotmpl .helmdocsignore +git add README.md diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh new file mode 100755 index 0000000000000000000000000000000000000000..f1e639abf6b177536d3dd23dea926002cdadca81 --- /dev/null +++ b/scripts/uninstall.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +kubectl delete -n kubevirt kubevirt kubevirt --wait=true +helm uninstall kubevirt --namespace=kubevirt +kubectl delete ns kubevirt +kubectl delete crd kubevirts.kubevirt.io \ No newline at end of file diff --git a/scripts/update-chart.sh b/scripts/update-chart.sh new file mode 100755 index 0000000000000000000000000000000000000000..f5b8eadf5cfd2638d76b2d4a339d7d446c6b9168 --- /dev/null +++ b/scripts/update-chart.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +export VERSION=0.53.0 +curl -sSLO https://github.com/kubevirt/kubevirt/releases/download/v${VERSION}/kubevirt-operator.yaml +curl -sSLO https://github.com/kubevirt/kubevirt/releases/download/v${VERSION}/kubevirt-cr.yaml +kustomize build -o chart/templates +mv chart/templates/apiextensions.k8s.io_v1_customresourcedefinition_kubevirts.kubevirt.io.yaml chart/crds/ +rm -rf kubevirt-operator.yaml kubevirt-cr.yaml \ No newline at end of file diff --git a/tests/test-values.yaml b/tests/test-values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391