Déployer avec Helm dans AKS

Salut!

Aujourd’hui nous allons voir ensemble comment utiliser Helm avec un cluster AKS. Helm est un gestionnaire de package pour Kubernetes permettant de faire de la gestion de release, des rollbacks etc ..

Avec la commande helm init nous allons déployer Tiller: le composant server-side de helm sur notre cluster AKS.

maxime@Azure:~$ helm init
Creating /home/maxime/.helm
Creating /home/maxime/.helm/repository
Creating /home/maxime/.helm/repository/cache
Creating /home/maxime/.helm/repository/local
Creating /home/maxime/.helm/plugins
Creating /home/maxime/.helm/starters
Creating /home/maxime/.helm/cache/archive
Creating /home/maxime/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /home/maxime/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
Happy Helming!

Il existe une multitude de packages (Chart) mis à disposition par la communauté. Vous pouvez les retrouver sur le github helm.

maxime@Azure:~$ helm search
NAME CHART VERSION APP VERSION DESCRIPTION
stable/acs-engine-autoscaler 2.1.2 2.1.1 Scales worker nodes within agent pools
stable/aerospike 0.1.6 v3.14.1.2 A Helm chart for Aerospike in Kubernetes
stable/anchore-engine 0.1.3 0.1.6 Anchore container analysis and policy evaluatio...
stable/artifactory 7.0.2 5.8.4 Universal Repository Manager supporting all maj...
stable/aws-cluster-autoscaler 0.3.2 Scales worker nodes within autoscaling groups.
stable/buildkite 0.2.1 3 Agent for Buildkite
stable/centrifugo 2.0.0 1.7.3 Centrifugo is a real-time messaging server.
stable/cert-manager 0.2.2 0.2.3 A Helm chart for cert-manager
stable/chaoskube 0.6.2 0.6.1 Chaoskube periodically kills random pods in you...
stable/chronograf 0.4.2 Open-source web application written in Go and R...
stable/cluster-autoscaler 0.4.2 1.1.0 Scales worker nodes within autoscaling groups.
stable/cockroachdb 0.6.2 1.1.4 CockroachDB is a scalable, survivable, strongly...
stable/concourse 0.11.5 3.8.0 Concourse is a simple and scalable CI system.
stable/consul 1.3.0 1.0.0 Highly available and distributed service discov...
stable/coredns 0.8.0 1.0.1 CoreDNS is a DNS server that chains plugins and...
stable/coscale 0.2.0 3.9.1 CoScale Agent
stable/dask-distributed 2.0.0 Distributed computation in Python
stable/datadog 0.10.9 DataDog Agent
stable/docker-registry 1.0.2 2.6.2 A Helm chart for Docker Registry
stable/dokuwiki 0.2.1 DokuWiki is a standards-compliant, simple to us...
stable/drupal 0.11.6 8.4.4 One of the most versatile open source content m...

Dans notre exemple, nous allons déployer un serveur Jenkins

maxime@Azure:~$ helm install stable/jenkins
NAME: wondering-turtle
LAST DEPLOYED: Thu Feb 22 01:16:24 2018
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
wondering-turtle-jenkins-agent ClusterIP 10.0.220.87 <none> 50000/TCP 1s
wondering-turtle-jenkins LoadBalancer 10.0.23.135 <pending> 8080:32590/TCP 1s

==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
wondering-turtle-jenkins 1 1 1 0 1s

==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
wondering-turtle-jenkins-2144157487-815j7 0/1 Pending 0 1s

==> v1/Secret
NAME TYPE DATA AGE
wondering-turtle-jenkins Opaque 2 1s

==> v1/ConfigMap
NAME DATA AGE
wondering-turtle-jenkins 3 1s
wondering-turtle-jenkins-tests 1 1s

==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
wondering-turtle-jenkins Pending default 1s
maxime@Azure:~$ printf $(kubectl get secret --namespace default wondering-turtle-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
B5rH2iWqAL
maxime@Azure:~$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 30m
wondering-turtle-jenkins LoadBalancer 10.0.23.135 52.226.17.49 8080:32590/TCP 4m
wondering-turtle-jenkins-agent ClusterIP 10.0.220.87 <none> 50000/TCP 4m

Nous listons les déploiements helm de notre cluster AKS

maxime@Azure:~$ helm list
NAME REVISION UPDATED STATUS CHART NAMESPACE
wondering-turtle 1 Thu Feb 22 01:16:24 2018 DEPLOYED jenkins-0.13.2 default

Nous pouvons désormais supprimer notre déploiement avec la commande helm delete

maxime@Azure:~$ helm delete wondering-turtle
release "wondering-turtle" deleted

Dans un prochain article nous verrons ensemble comment déployer OpenFaaS avec Helm.

Démarrez une conversation

Votre adresse de messagerie ne sera pas publiée.