# flux_example_infrastructure.yaml
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: infra-controllers
  namespace: flux-system
spec:
  interval: 1h
  retryInterval: 2m
  timeout: 5m
  sourceRef:
    kind: ExternalArtifact
    name: infrastructure
  path: ./controllers
  prune: true
  wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: infra-configs
  namespace: flux-system
spec:
  dependsOn:
    - name: infra-controllers
  interval: 1h
  retryInterval: 2m
  timeout: 5m
  sourceRef:
    kind: ExternalArtifact
    name: infrastructure
  path: ./configs
  prune: true
  patches:
    - patch: |
        - op: replace
          path: /spec/acme/server
          value: https://acme-staging-v02.api.letsencrypt.org/directory
      target:
        kind: ClusterIssuer
        name: letsencrypt