All Projects → Kubedex → helm-controller

Kubedex / helm-controller

Licence: Apache-2.0 license
A simple way to manage helm charts with a Custom Resource Definitions in k8s.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to helm-controller

Ingressmonitorcontroller
A Kubernetes controller to watch ingresses and create liveness alerts for your apps/microservices in UptimeRobot, StatusCake, Pingdom, etc. – [✩Star] if you're using it!
Stars: ✭ 306 (+524.49%)
Mutual labels:  controller, helm, helm-charts
helm-charts
Source & Repo of https://charts.kubesphere.io/main & https://charts.kubesphere.io/test
Stars: ✭ 85 (+73.47%)
Mutual labels:  helm, helm-charts
metahelm
Install dependency graphs of Kubernetes Helm Charts
Stars: ✭ 70 (+42.86%)
Mutual labels:  helm, helm-charts
charts
Deploy Kubernetes Helm Charts for Check Point CloudGuard
Stars: ✭ 18 (-63.27%)
Mutual labels:  helm, helm-charts
charts
Helm charts for creating reproducible and maintainable deployments of Polyaxon with Kubernetes.
Stars: ✭ 32 (-34.69%)
Mutual labels:  helm, helm-charts
charts
Helm charts for using F5 products and services in Kubernetes and OpenShift environments.
Stars: ✭ 28 (-42.86%)
Mutual labels:  helm, helm-charts
helm-certgen
Helm plugin for generation of TLS certificates
Stars: ✭ 15 (-69.39%)
Mutual labels:  helm, helm-charts
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (+22.45%)
Mutual labels:  controller, crd
camunda-helm
Camunda public Kubernetes Helm repo and charts
Stars: ✭ 33 (-32.65%)
Mutual labels:  helm, helm-charts
helm-charts
Community maintained Helm charts for Flux
Stars: ✭ 66 (+34.69%)
Mutual labels:  helm, helm-charts
helm-charts
OpenSourced Helm charts
Stars: ✭ 38 (-22.45%)
Mutual labels:  helm, helm-charts
vault-charts
Charts to deploy Hashicorp Vault in Kubernetes
Stars: ✭ 15 (-69.39%)
Mutual labels:  helm, helm-charts
kube-tools-aws
A lightweight Docker image with various CLI tooling for working with Kubernetes.
Stars: ✭ 26 (-46.94%)
Mutual labels:  helm, helm-charts
charts
Fairwinds helm chart repository
Stars: ✭ 99 (+102.04%)
Mutual labels:  helm, helm-charts
rudder
Application releases based on helm
Stars: ✭ 19 (-61.22%)
Mutual labels:  controller, helm
ship-it
Wattpad's tool for continuously deploying code to Kubernetes quickly, safely, and observably.
Stars: ✭ 14 (-71.43%)
Mutual labels:  helm, helm-charts
Helmfiles
Comprehensive Distribution of Helmfiles for Kubernetes
Stars: ✭ 205 (+318.37%)
Mutual labels:  helm, helm-charts
Build Harness
🤖Collection of Makefiles to facilitate building Golang projects, Dockerfiles, Helm charts, and more
Stars: ✭ 236 (+381.63%)
Mutual labels:  helm, helm-charts
clearml-server-helm
ClearML Server for Kubernetes Clusters Using Helm
Stars: ✭ 18 (-63.27%)
Mutual labels:  helm, helm-charts
matrix-chart
Helm chart for deploying a Matrix homeserver stack
Stars: ✭ 83 (+69.39%)
Mutual labels:  helm, helm-charts

kubedex helm-controller

Go Report Card

A simple controller built with the Operator SDK that watches for chart CRD's within a namespace and manages installation, upgrades and deletes using Kubernetes jobs.

The helm-controller creates a Kubernetes job pod per CRD that runs helm upgrade --install with various options to make it idempotent. Within each job pod Helm is run in 'tillerless' mode.

To upgrade a chart you can use kubectl to modify the version or values in the chart CRD. To debug what happened you can use kubectl logs on the kubernetes job.

To completely remove the chart and do the equivalent of helm delete --purge simply delete the chart CRD.

The image used in the kubernetes job can be customised so you can easily add additional logic or helm plugins. You can set this by changing the JOB_IMAGE environment variable in the deployment manifest.

This means that Helm 3.0 will be supported on the day it goes GA.

Installation

The default manifests create a service account, role, rolebinding and deployment that runs the operator. It is recommended to run the controller in its own namespace alongside the CRD's that it watches.

Some example manifests are available in the deploy/ directory.

kubectl apply -f deploy/

This will install the helm-controller into the default namespace.

Or, install using helm.

helm repo add kubedex https://kubedex.github.io/charts
helm repo update
helm install kubedex/helm-controller

Then to install a chart you can apply the following manifest.

cat <<EOF | kubectl apply -f -
apiVersion: helm.kubedex.com/v1
kind: HelmChart
metadata:
  name: kubernetes-dashboard
  namespace: default
spec:
  chart: stable/kubernetes-dashboard
  version: 1.8.0
  targetNamespace: kube-system
  valuesContent: |-
    rbac.clusterAdminRole: true
    enableInsecureLogin: true
    enableSkipLogin: true
EOF

In this example we're installing the kubernetes-dashboard chart into the kube-system namespace and setting some truly dangerous values under valuesContent.

Private Chart Repos

In the example above we're using the pre-configured stable repo available in the default job image.

You can also specify your own private chart repo as follows.

apiVersion: helm.kubedex.com/v1
kind: HelmChart
metadata:
  name: myprivatechartname
  namespace: default
spec:
  chart: myprivatechartname
  repo: https://user:[email protected]
  version: 1.0.0
  targetNamespace: default

The default job image works with https registries and basic auth. You can support other registry types like S3 by modifying the job image and pre-installing plugins.

Ignoring Charts

You may want to only run charts on certain clusters. You can do this by templating the CRD and setting the ignore: field to true as per below.

apiVersion: helm.kubedex.com/v1
kind: HelmChart
metadata:
  name: myprivatechartname
  namespace: default
spec:
  chart: myprivatechartname
  repo: https://user:[email protected]
  version: 1.0.0
  targetNamespace: default
  ignore: true

The helm-controller will now ignore this chart CRD. Be aware that this simply ignores the chart. The controller will not uninstall the chart.

You will need to delete the CRD for the controller to manage the delete.

Installation Lifecycle

The helm-controller manifests should be deployed to the Kubernetes cluster using kubectl.

  • A single CRD per Helm Chart
  • The helm-controller triggers a Kubernetes job when a chart CRD is changed
  • Each Kubernetes job executes the upgrade logic for the Helm Chart
  • When a chart CRD is deleted the helm-controller will remove all resources associated with it

Helm Chart CRD's

Chart CRD's define which Helm Charts a cluster should be running. You can view all chart CRD's by executing the following command.

kubectl get helmcharts.helm.kubedex --all-namespaces

Or, to look at the contents of a single CRD you can use this command:

kubectl get helmchart.helm.kubedex kubernetes-dashboard -o yaml

For testing and playing around you can edit the chart CRD's directly to bump chart version or change values.

On change the helm-controller will immediately execute a Kubernetes job to apply the Helm Chart upgrade.

Troubleshooting

Use standard kubectl commands to validate each stage has completed successfully.

  • Check that the helm-controller is running and the logs are clean
  • Check the contents of the chart CRD on the cluster
  • Check the Kubernetes job logs for the chart you are troubleshooting

To fully reset a chart you can delete the CRD. Then wait for all resources to be removed. Then apply the CRD again.

To remove all charts from a cluster you can run:

kubectl delete helmcharts.helm.kubedex --all-namespaces --all

Credits

Heavily inspired by the Rancher Helm Controller.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].