---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
  name: core
  namespace: flux-system
spec:
  dependsOn:
    - name: infrastructure
  interval: 1h
  sourceRef:
    kind: GitRepository
    name: stackspin
  path: ./flux2/core
  prune: true
  validation: client
  postBuild:
    substituteFrom:
      - kind: Secret
        name: stackspin-dashboard-variables
      - kind: Secret
        name: stackspin-single-sign-on-variables
      - kind: Secret
        name: stackspin-oauth-variables
      - kind: Secret
        name: stackspin-cluster-variables
  healthChecks:
    - apiVersion: helm.toolkit.fluxcd.io/v1beta1
      kind: HelmRelease
      name: metallb
      namespace: kube-system
    - apiVersion: helm.toolkit.fluxcd.io/v1beta1
      kind: HelmRelease
      name: nginx
      namespace: stackspin
    - apiVersion: helm.toolkit.fluxcd.io/v1beta1
      kind: HelmRelease
      name: single-sign-on
      namespace: stackspin
    - apiVersion: apps/v1
      kind: Deployment
      name: single-sign-on-userbackend
      namespace: stackspin
    - apiVersion: apps/v1
      kind: Deployment
      name: single-sign-on-hydra
      namespace: stackspin
    - apiVersion: apps/v1
      kind: Deployment
      name: single-sign-on-login
      namespace: stackspin
