understanding flux build command line

With flux build cli we can try to do a dry-run to see how the yaml gets generated without doing actual deployment. --path is a bases template of your deployment. Then --kustomization-file  is the overlay (cherry on top) or customization that you would like to add on top of your --path base template.  The command line looks like this. ./cluster/devtest/external-dns must exist. 



flux build kustomization external-dns \

  --path ./clusters/devtest/external-dns \

  --kustomization-file ./clusters/devtest/external-dns-ks.yaml \

  --dry-run


./cluster/devtest/external-dns/kustomization.yaml



apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kube-system
resources:
  - release.yaml

./cluster/devtest/external-dns/release.yaml

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: keda
  namespace: keda
spec:
  releaseName: keda
  targetNamespace: keda
  chart:
    spec:
      chart: keda
      sourceRef:
        kind: HelmRepository
        name: keda
        namespace: flux-system
      version: "2.18.3"
  interval: 5m0s
  install:
    remediation:
      retries: 3
    crds: CreateReplace
  upgrade:
    crds: CreateReplace
  values:
    prometheus:
      metricServer:
        enabled: true
        port: 3000
        path: /metrics
    tolerations:
    - key: CriticalAddonsOnly
      operator: Exists

 ./clusters/devtest/external-dns-ks.yaml - this are further customization that you want to make on your based template.


apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: external-dns
  namespace: flux-system
spec:
  interval: 5m0s
  dependsOn:
    - name: sources
  path: ./clusters/wwnzdevtest/external-dns
  prune: true
  sourceRef:
    kind: GitRepository
    name: flux-system
  patches:
  - patch: |-
      apiVersion: helm.toolkit.fluxcd.io/v2
      kind: HelmRelease
      metadata:
        name: external-dns
      spec:
        values:
          resources:
            requests:
              cpu: 350m
            limits:
              cpu: 550m
          sources:
          - service
    target:
      kind: HelmRelease
     

And the final output would look something like this, it looks like it has been merged.



https://fluxcd.io/flux/components/helm/helmreleases/





Comments

Popular posts from this blog

mongosh install properly

gemini cli getting file not defined error

vllm : Failed to infer device type