Reputation: 1275
I have a Kubernetes cluster setup with Flux. I have an infrastructure folder that has ingress/base
and ingress/overlays/development
in it. Hopefully this screenshot helps with the directory structure:
Below are my ingress.yaml and kustomization.yaml files from base
:
# ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: user-service
servicePort: 80
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ingress.yaml
In development
's folder I have just a kustomization file:
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: development
resources:
- ../../base
When I commit this structure to my flux repository everything successfully reconciles. However, its setting up an ingress in the default
and development
namespaces. I want the base folder to be the common config applied to every namespace, I don't want it deployed on its own.
How can I tell Kustomize, or flux, to only use my base
folders as inputs to the overlays instead of actually deploying the base folder?
Upvotes: 0
Views: 788
Reputation: 2311
You should use spec.path
in your Flux Kustomization component.
spec:
path: "./infrastructure/overlays"
Upvotes: 0