Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akankshakumari393/sync-env
kubernetes controller that sync configMap with Deployment in the default namespace
https://github.com/akankshakumari393/sync-env
dockerfile golang kubernetes
Last synced: about 2 months ago
JSON representation
kubernetes controller that sync configMap with Deployment in the default namespace
- Host: GitHub
- URL: https://github.com/akankshakumari393/sync-env
- Owner: akankshakumari393
- Created: 2022-04-30T06:03:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-01T15:42:00.000Z (over 2 years ago)
- Last Synced: 2024-06-19T13:51:48.288Z (7 months ago)
- Topics: dockerfile, golang, kubernetes
- Language: Go
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sync-env
## Kubernetes Custom Controller
This controller updates a deployment env with ConfigMap reference whenever the configMap is created in the `default` namespace.
## On Local Environment
### build the binary
```
go build
```### Execute the binary
```
./sync-env
```## On K8S Cluster
### Build the controller image and push to docker registry
```
docker build -t akankshakumari393/sync-env:0.0.1 .
docker push akankshakumari393/sync-env:0.0.1
```### create a namespace in which controller would run
```
kubectl create namespace sync-env
```### Create Role in default namespace to give permission for configmaps, deployments
```
kubectl create role default-role --verb=update,get,list,watch --resource=deployments,configmaps
# kubectl create -f k8s-resources/role.yaml
```### Create RoleBindings in default namespace to give access to Service account mapped with controller
```
kubectl create rolebinding default-role-binding --role=default-role --user=system:serviceaccount:sync-env:default
# kubectl create -f k8s-resources/rolebinding.yaml
```Create deployment
kubectl create -f k8s-resources/deployment.yaml -n sync-env### Now any configmap added to default namespace would be added to env of the deployment