Deployer un Chart HELM
Installer le chart
Le chart généré par défaut exécute un serveur NGINX exposé via un service de type ClusterIP.
Pour l’exposer avec un service NodePort, exécuter la commande suivante :
helm install mynginx ./myhelm --set service.type=NodePortNAME: mynginxNAMESPACE: developmentSTATUS: deployedREVISION: 1NOTES:1. Get the application URL by running these commands:export NODE_PORT=$(kubectl get --namespace development -o jsonpath="{.spec.ports[0].nodePort}" services mynginx-myhelm)export NODE_IP=$(kubectl get nodes --namespace development -o jsonpath="{.items[0].status.addresses[0].address}")echo http://$NODE_IP:$NODE_PORTLister les Charts installés
helm listNAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSIONmynginx development 1 2021-03-09 09:53:10.185241039 +0200 CEST deployed myhelm-0.1.0 1.16.0Lister les objets kubernetes créés
kubectl get deploy,svcNAME READY UP-TO-DATE AVAILABLE AGEdeployment.apps/mynginx-myhelm 1/1 1 1 8m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEservice/mynginx-myhelm NodePort 10.107.172.175 <none> 80:32298/TCP 8mModifier le chart
Pour cela, il faut modifier certaines valeurs du ficher values.yaml
vi myhelm/values.yamlreplicaCount: 2image: repository: httpd pullPolicy: IfNotPresent tag: "2.4-alpine"
service: type: NodePort port: 80helm install myweb ./myhelmNAME: mywebNAMESPACE: developmentSTATUS: deployedREVISION: 1NOTES:1. Get the application URL by running these commands:export NODE_PORT=$(kubectl get --namespace development -o jsonpath="{.spec.ports[0].nodePort}" services myweb-myhelm)export NODE_IP=$(kubectl get nodes --namespace development -o jsonpath="{.items[0].status.addresses[0].address}")echo http://$NODE_IP:$NODE_PORT