OpenKruise components

When you install Kruise into a K8s cluster, it means you have created Kruise CRDs and some components.

OpenKruise components

CRDs

These CRDs will be configured during Kruise installation.

  1. $ kubectl get crd | grep kruise.io
  2. advancedcronjobs.apps.kruise.io 2021-03-02T04:03:57Z
  3. broadcastjobs.apps.kruise.io 2021-03-02T04:03:57Z
  4. clonesets.apps.kruise.io 2021-03-02T04:03:57Z
  5. daemonsets.apps.kruise.io 2021-03-02T04:03:57Z
  6. imagepulljobs.apps.kruise.io 2021-03-02T04:03:57Z
  7. nodeimages.apps.kruise.io 2021-03-02T04:03:57Z
  8. sidecarsets.apps.kruise.io 2021-03-02T04:03:57Z
  9. statefulsets.apps.kruise.io 2021-03-02T04:03:57Z
  10. uniteddeployments.apps.kruise.io 2021-03-02T04:03:57Z

Kruise-manager

Kruise-manager is a control plane component that runs controllers and webhooks, it is deployed by a Deployment in kruise-system namespace.

  1. $ kubectl get deploy -n kruise-system
  2. NAME READY UP-TO-DATE AVAILABLE AGE
  3. kruise-controller-manager 2/2 2 2 4h6m
  4. $ kubectl get pod -n kruise-system -l control-plane=controller-manager
  5. NAME READY STATUS RESTARTS AGE
  6. kruise-controller-manager-68dc6d87cc-k9vg8 1/1 Running 0 4h6m
  7. kruise-controller-manager-68dc6d87cc-w7x82 1/1 Running 0 4h6m

Logically, each controller like cloneset-controller or sidecarset-controller is a separate process, but to reduce complexity, they are all compiled into a single binary and run in the kruise-controller-manager-xxx single Pod.

Besides controllers, this Pod also contains the admission webhooks for Kruise CRDs and Pod. It creates webhook configurations to configure which resources should be handled, and provides a Service for kube-apiserver calling.

  1. $ kubectl get svc -n kruise-system
  2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  3. kruise-webhook-service ClusterIP 172.24.9.234 <none> 443/TCP 4h9m

The kruise-webhook-service is much important for kube-apiserver calling.

Kruise-daemon

This is a new daemon component released since Kruise v0.8.0 version.

It is deployed by DaemonSet, runs on every node and manages things like image pre-download, container restarting.

  1. $ kubectl get pod -n kruise-system -l control-plane=daemon
  2. NAME READY STATUS RESTARTS AGE
  3. kruise-daemon-6hw6d 1/1 Running 0 4h7m
  4. kruise-daemon-d7xr4 1/1 Running 0 4h7m
  5. kruise-daemon-dqp8z 1/1 Running 0 4h7m
  6. kruise-daemon-dv96r 1/1 Running 0 4h7m
  7. kruise-daemon-q7594 1/1 Running 0 4h7m
  8. kruise-daemon-vnsbw 1/1 Running 0 4h7m