Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.7 KB

README.md

File metadata and controls

50 lines (32 loc) · 1.7 KB

cluster-management

This project leveraged Kubernetes Operator to help manage multiple ecns clusters

  • CRD "Cluster" to store Cluster Info
  • Controller
    • Polling latest cluster info to update CRD
    • create/delete namespaces, network policy, pod security policy

Quick Start

  • 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 [email protected]:es-container/cluster-management.git

  • Run cluster-management

    make install to install CRD
    make run to run controller as process on host

  • Function Demo

    • Create:
      kubectl apply -f config/samples/cluster_with_host.yaml to create cluster without projects
      kubectl apply -f config/samples/cluster_with_host.yaml to create cluster with projects

    • Update:
      kubectl edit cluster cluster-host to update projects list

    • Delete:
      kubectl delete cluster cluster-host to delete cluster

    Notes: kubctl get cluster cluster-host -o yaml to 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 kubelet to imitate nodes NotReady kubctl get cluster cluster-host -o yaml to check cluster status was updated as expect.

Development

architecture