kubernetes controller to apply manifest when a new namespace is created
506
A Kubernetes controller to auto generate ressources based on namespace creation
When a user create a new namespace, some default resources may be spawned in ou out this namespace.
This controller listen on namespace creation and is configured with configmaps.
Configmaps are 1 ressource (yaml) by files. Resources can be changed with go template on namespace creation.
Some options can also be add as annotation to filter on namespaces.
apiVersion: v1
kind: ConfigMap
metadata:
name: test
labels:
app: namespace-populator
annotations:
# this annotation can be used to select which namespace to trigger
namespace-populator.barpilot.io/selector: "create=nginx"
data:
pod.yaml: |
apiVersion: v1
kind: Pod
metadata:
name: nginx
namespace: {{ .Name }}
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
if on .Name in go template.Content type
Image
Digest
Size
8.6 MB
Last updated
about 8 years ago
docker pull barpilot/namespace-populator