Kubernetes with Helm project structure

Kubernetes with Helm project structure

Explorer

  • .devcontainernew
  • devcontainer.jsonnew
  • .vscode
  • extensions.json
  • settings.jsonnew
  • charts
  • environmentsnew
  • rendered…new, not committed
  • scriptsnew
  • render.shnew
  • kubeconform.shnew
  • .editorconfignew
  • .gitignore
  • .pre-commit-config.yamlnew
  • ct.yamlnew
  • kind-config.yamlnew
  • lintconf.yamlnew
  • Makefilenew
  • README.md
  1. # Create the chart (Helm 4)

    helm create charts/shop-api
  2. # Lint and see the YAML it renders

    helm lint --strict charts/shop-api && helm template shop-api charts/shop-api
  3. # Create a local cluster and install the chart

    kind create cluster && helm upgrade --install shop-api charts/shop-api -n shop --create-namespace --wait
  4. # Run the chart's in-cluster tests

    helm test shop-api -n shop
  5. # Install the unit test plugin (Helm 4 needs --verify=false) and run it

    helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false && helm unittest charts/shop-api
  6. # Lint and install changed charts the way CI does

    ct lint --config ct.yaml && ct install --config ct.yaml
  7. # Deploy an environment

    helm upgrade --install shop-api charts/shop-api -n shop -f environments/dev/values.yaml --rollback-on-failure --wait
  8. # Package and publish to an OCI registry

    helm package charts/shop-api -d dist && helm push dist/shop-api-1.4.0.tgz oci://ghcr.io/shop/charts