https://github.com/joyrex2001/envinit-operator
This is an example operator that watches creation of namespaces, and runs an additional kustomize run for given type of environment.
https://github.com/joyrex2001/envinit-operator
kubernetes kustomize operator
Last synced: 29 days ago
JSON representation
This is an example operator that watches creation of namespaces, and runs an additional kustomize run for given type of environment.
- Host: GitHub
- URL: https://github.com/joyrex2001/envinit-operator
- Owner: joyrex2001
- Created: 2020-01-10T14:18:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-20T14:57:41.000Z (about 6 years ago)
- Last Synced: 2025-01-23T00:28:49.137Z (over 1 year ago)
- Topics: kubernetes, kustomize, operator
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# envinit-operator
This operator will watch namespace add events. If the namespace contains the annotation ```envinit.joyrex2001.com/type``` it will run the ```run.sh``` shell script in the environment folder for that type. In this example it will do an additional kustomize run.
To install this operator;
```bash
kubectl create namespace operator-envinit
kustomize build kustomize | kubectl apply -f -
```
## Create a new namespace
To trigger the operator to provision the environment with the annotation as below. This will trigger the ```environment/dev/run.sh``` script to be executed.
```yaml
apiVersion: v1
kind: Namespace
metadata:
name: example-environment
annotations:
"envinit.joyrex2001.com/type": "dev"
```
## See also
* https://github.com/flant/shell-operator
* https://www.hcs-company.com/blog/operator-automatiseren-namespace-openshift