diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a66dcc9e..ee281990 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,3 @@ -charts/code-server @Matthew-Beckett @alexgorbatchev -* @code-asher @nhooyr \ No newline at end of file +* @code-asher @nhooyr + +ci/helm-chart @Matthew-Beckett @alexgorbatchev diff --git a/.github/workflows/helm_validation.yaml b/.github/workflows/helm_validation.yaml deleted file mode 100644 index 9ba82ec0..00000000 --- a/.github/workflows/helm_validation.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Helm Validation - -on: [pull_request, issues] - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Kubeval Helm Chart - uses: junior/kubeval-helm-chart-action@0.2.0-alpha.0 - env: - INPUT_KUBERNETES_VERSION: 1.19 diff --git a/ci/dev/fmt.sh b/ci/dev/fmt.sh index 47911aad..ce9d7518 100755 --- a/ci/dev/fmt.sh +++ b/ci/dev/fmt.sh @@ -19,7 +19,9 @@ main() { "*.yaml" "*.yml" ) - prettier --write --loglevel=warn $(git ls-files "${prettierExts[@]}") + prettier --write --loglevel=warn $( + git ls-files "${prettierExts[@]}" | grep -v 'helm-chart' + ) doctoc --title '# FAQ' doc/FAQ.md > /dev/null doctoc --title '# Setup Guide' doc/guide.md > /dev/null diff --git a/ci/dev/lint.sh b/ci/dev/lint.sh index 5f7c549b..7915262b 100755 --- a/ci/dev/lint.sh +++ b/ci/dev/lint.sh @@ -8,6 +8,7 @@ main() { stylelint $(git ls-files "*.css") tsc --noEmit shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh") + helm kubeval ci/helm-chart } main "$@" diff --git a/charts/code-server/.helmignore b/ci/helm-chart/.helmignore similarity index 100% rename from charts/code-server/.helmignore rename to ci/helm-chart/.helmignore diff --git a/charts/code-server/Chart.yaml b/ci/helm-chart/Chart.yaml similarity index 100% rename from charts/code-server/Chart.yaml rename to ci/helm-chart/Chart.yaml diff --git a/charts/code-server/README.md b/ci/helm-chart/README.md similarity index 86% rename from charts/code-server/README.md rename to ci/helm-chart/README.md index e0a9aa63..601596c1 100644 --- a/charts/code-server/README.md +++ b/ci/helm-chart/README.md @@ -10,8 +10,9 @@ This chart is community maintained by [@Matthew-Beckett](https://github.com/Matt ## TL;DR; ```console -$ git clone https://github.com/cdr/code-server.git -$ helm install code-server/charts/code-server +$ git clone https://github.com/cdr/code-server +$ cd code-server +$ helm upgrade --install code-server ci/helm-chart ``` ## Introduction @@ -26,10 +27,12 @@ package manager. ## Installing the Chart -To install the chart with the release name `my-release`: +To install the chart with the release name `code-server`: ```console -$ helm install --name my-release charts/code-server +$ git clone https://github.com/cdr/code-server +$ cd code-server +$ helm upgrade --install code-server ci/helm-chart ``` The command deploys code-server on the Kubernetes cluster in the default @@ -40,10 +43,10 @@ that can be configured during installation. ## Uninstalling the Chart -To uninstall/delete the `my-release` deployment: +To uninstall/delete the `code-server` deployment: ```console -$ helm delete my-release +$ helm delete code-server ``` The command removes all the Kubernetes components associated with the chart and @@ -97,9 +100,9 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, ```console -$ helm install --name my-release \ - --set persistence.enabled=false \ - deployment/chart +$ helm install code-server \ + ci/helm-chart \ + --set persistence.enabled=false ``` The above command sets the the persistence storage to false. @@ -108,7 +111,7 @@ Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, ```console -$ helm install --name my-release -f values.yaml deployment/chart +$ helm install code-server ci/helm-chart -f values.yaml ``` > **Tip**: You can use the default [values.yaml](values.yaml) diff --git a/charts/code-server/templates/NOTES.txt b/ci/helm-chart/templates/NOTES.txt similarity index 100% rename from charts/code-server/templates/NOTES.txt rename to ci/helm-chart/templates/NOTES.txt diff --git a/charts/code-server/templates/_helpers.tpl b/ci/helm-chart/templates/_helpers.tpl similarity index 100% rename from charts/code-server/templates/_helpers.tpl rename to ci/helm-chart/templates/_helpers.tpl diff --git a/charts/code-server/templates/deployment.yaml b/ci/helm-chart/templates/deployment.yaml similarity index 100% rename from charts/code-server/templates/deployment.yaml rename to ci/helm-chart/templates/deployment.yaml diff --git a/charts/code-server/templates/ingress.yaml b/ci/helm-chart/templates/ingress.yaml similarity index 100% rename from charts/code-server/templates/ingress.yaml rename to ci/helm-chart/templates/ingress.yaml diff --git a/charts/code-server/templates/pvc.yaml b/ci/helm-chart/templates/pvc.yaml similarity index 100% rename from charts/code-server/templates/pvc.yaml rename to ci/helm-chart/templates/pvc.yaml diff --git a/charts/code-server/templates/secrets.yaml b/ci/helm-chart/templates/secrets.yaml similarity index 100% rename from charts/code-server/templates/secrets.yaml rename to ci/helm-chart/templates/secrets.yaml diff --git a/charts/code-server/templates/service.yaml b/ci/helm-chart/templates/service.yaml similarity index 100% rename from charts/code-server/templates/service.yaml rename to ci/helm-chart/templates/service.yaml diff --git a/charts/code-server/templates/serviceaccount.yaml b/ci/helm-chart/templates/serviceaccount.yaml similarity index 100% rename from charts/code-server/templates/serviceaccount.yaml rename to ci/helm-chart/templates/serviceaccount.yaml diff --git a/charts/code-server/templates/tests/test-connection.yaml b/ci/helm-chart/templates/tests/test-connection.yaml similarity index 100% rename from charts/code-server/templates/tests/test-connection.yaml rename to ci/helm-chart/templates/tests/test-connection.yaml diff --git a/charts/code-server/values.yaml b/ci/helm-chart/values.yaml similarity index 99% rename from charts/code-server/values.yaml rename to ci/helm-chart/values.yaml index 5cc74185..e71499bf 100644 --- a/charts/code-server/values.yaml +++ b/ci/helm-chart/values.yaml @@ -112,7 +112,7 @@ persistence: ## # storageClass: "-" accessMode: ReadWriteOnce - size: 1Gi + size: 10Gi annotations: {} # existingClaim: "" # hostPath: /data diff --git a/ci/images/debian10/Dockerfile b/ci/images/debian10/Dockerfile index 108348b6..883bb62e 100644 --- a/ci/images/debian10/Dockerfile +++ b/ci/images/debian10/Dockerfile @@ -45,4 +45,10 @@ ENV GO111MODULE=on RUN go get mvdan.cc/sh/v3/cmd/shfmt RUN go get github.com/goreleaser/nfpm/cmd/nfpm +RUN VERSION="$(curl -fsSL https://storage.googleapis.com/kubernetes-release/release/stable.txt)" && \ + curl -fsSL "https://storage.googleapis.com/kubernetes-release/release/$VERSION/bin/linux/amd64/kubectl" > /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl +RUN curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash +RUN helm plugin install https://github.com/instrumenta/helm-kubeval + RUN curl -fsSL https://get.docker.com | sh diff --git a/doc/install.md b/doc/install.md index c33299cf..90a14dfd 100644 --- a/doc/install.md +++ b/doc/install.md @@ -12,6 +12,7 @@ - [macOS](#macos) - [Standalone Releases](#standalone-releases) - [Docker](#docker) +- [helm](#helm) @@ -192,3 +193,7 @@ Our official image supports `amd64` and `arm64`. For `arm32` support there is a popular community maintained alternative: https://hub.docker.com/r/linuxserver/code-server + +## helm + +See [the chart](../ci/helm-chart).