k3s/namespaces/monitoring/uptime-kuma/kustomization.yaml

96 lines
2.2 KiB
YAML

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
transformers:
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: notImportantHere
namespace: monitoring
unsetOnly: true
namePrefix: uptime-kuma-
resources:
- ../../../kustomize/bases/deployment/
# - extra/middleware-auth.yaml
replacements:
- source:
kind: Service
name: svc
targets:
- select:
kind: HTTPRoute
options:
create: true
fieldPaths:
- spec.rules.0.backendRefs.0.name
- source:
kind: Deployment
name: app
fieldPath: metadata.labels.[app.kubernetes.io/appName]
targets:
- select:
kind: InfisicalSecret
options:
delimiter: "-"
index: 0
fieldPaths:
- spec.managedSecretReference.secretName
- select:
kind: InfisicalSecret
options:
delimiter: "/"
index: 2
fieldPaths:
- spec.authentication.universalAuth.secretsScope.secretsPath
- select:
kind: Service
fieldPaths:
- spec.ports.0.name
- spec.ports.0.targetPort
- source:
kind: Deployment
name: app
fieldPath: metadata.labels.[app.kubernetes.io/appNamespace]
targets:
- select:
kind: InfisicalSecret
fieldPaths:
- spec.managedSecretReference.secretNamespace
- source:
kind: Deployment
name: app
fieldPath: metadata.labels.[app.kubernetes.io/routePrefix]
targets:
- select:
kind: HTTPRoute
options:
create: true
delimiter: "."
index: 0
fieldPaths:
- spec.hostnames.0
patches:
- path: patches/deployment.yaml
target:
kind: Deployment
name: app
- path: patches/httproute.yaml
target:
kind: HTTPRoute
- path: patches/pvc.yaml
target:
kind: PersistentVolumeClaim
name: pvc
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/appName: uptime-kuma
- pairs:
app.kubernetes.io/appNamespace: monitoring
- pairs:
app.kubernetes.io/routePrefix: status