This project leveraged Kubernetes Operator to help manage multiple EOS clusters
- CRD "eoscluster" to store Cluster Info
- Controller
- Polling latest cluster info to update CRD
- create/delete namespaces, network policy, pod security policy
-
Precondition: you’ll need a Kubernetes cluster to run as Supervisor Cluster, and clusters to be managed.
Notes:- Make sure SuperVisor could access k8s api on managed clusters, it need add public_ip into openssl.conf and regenerate certificates
- Make sure managed clusters could access keystone on Supervisor cluster.
-
Download Code on Supervisor cluster
git clone git@github.com:es-container/cluster-management.git -
Run cluster-management
make installto install CRD
make runto run controller as process on host -
Function Demo
-
Create:
kubectl apply -f config/samples/eoscluster_with_host.yamlto create eoscluster without projects
kubectl apply -f config/samples/eoscluster_with_host.yamlto create eoscluster with projects -
Update:
kubectl edit eoscluster eoscluster-hostto update projects list -
Delete:
kubectl delete eoscluster eoscluster-hostto delete eoscluster
Notes:
kubctl get eoscluster eoscluster-host -o yamlto check cluster info was updated as expect. Log into managed clusters to check the namespaces(same name with projects) were created/deleted as expect.- Polling:
systemctl stop kubeletto imitate nodes NotReadykubctl get eoscluster eoscluster-host -o yamlto check cluster status was updated as expect.
-