Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Hoofdstuk 5Naam in de cursus: Helm, Kustomize, CRDs and operators

Install components with Helm and Kustomize

Real clusters run many components (ingress controllers, monitoring, cert-manager). Helm installs them as versioned charts with values. Kustomize changes plain YAML per environment without templates. Many components add their own object types with CRDs and run them with operators.

  • 4 Lessen
  • 3 Commando's

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

Vaardigheden in dit hoofdstuk

  • Componenten installeren met Helm en Kustomize; CRD's en operators begrijpen

5.1

Install a chart with Helm

A chart is a package of templates; a release is an installed chart with your values.

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm search repo ingress-nginx
helm show values ingress-nginx/ingress-nginx > values.yaml
helm install ingress ingress-nginx/ingress-nginx -n ingress-nginx --create-namespace --set controller.replicaCount=2
helm list -A
helm status ingress -n ingress-nginx

Commando's in deze les

5.2

Upgrade and roll back a release

Every change is a new revision; roll back to any old one.

helm upgrade ingress ingress-nginx/ingress-nginx -n ingress-nginx -f values.yaml
helm history ingress -n ingress-nginx
helm rollback ingress 1 -n ingress-nginx
helm template ingress ingress-nginx/ingress-nginx -f values.yaml > rendered.yaml
helm uninstall ingress -n ingress-nginx
CommandDoes
helm install NAME CHARTInstall a new release
helm upgrade --installInstall or upgrade (good in pipelines)
-f values.yaml, --set k=vYour values
helm get values NAMEThe values in use
helm templateRender YAML without installing
helm rollback NAME REVGo back to a revision

Commando's in deze les

5.3

Change YAML with Kustomize

A kustomization.yaml lists resources and changes (name prefix, labels, image tags, patches). kubectl apply -k builds and applies it.

base/kustomization.yaml
resources:
  - deployment.yaml
  - service.yaml
overlays/prod/kustomization.yaml
resources:
  - ../../base
namespace: shop-prod
namePrefix: prod-
labels:
  - pairs: { env: prod }
images:
  - name: ghcr.io/s0sta/shop
    newTag: "1.4.0"
patches:
  - target: { kind: Deployment, name: web }
    patch: |-
      - op: replace
        path: /spec/replicas
        value: 4
kubectl kustomize overlays/prod
kubectl apply -k overlays/prod
kubectl diff -k overlays/prod

5.4

Understand CRDs and operators

A CustomResourceDefinition adds a new object type to the API (for example Certificate from cert-manager). An operator is a controller that watches those objects and does the work.

kubectl get crd
kubectl api-resources | grep cert-manager
kubectl explain certificate.spec
kubectl get certificates -A

Onthoud

Install the CRDs before objects of that type — otherwise kubectl apply says "no matches for kind".

Alle commando's in dit hoofdstuk