This operator links DaemonSets to Deployments or StatefulSets. When the source object is scaled to 0, the DaemonSet is scaled to 0 too
The operator scales a DS to 0 by applying a non-existent node selector. Usually DS should run on all (selected) nodes in a cluster, however there are cases where scaling DS down to 0 might be desirable. For example, if a log collector is scaled down, there's little purpose to run log agents on all nodes. Tools like KEDA do not support scaling DS because DS doesn't have scaling API.
Real world example: scale promtail DS down to 0 if loki is scaled down to 0.
Add helm repo:
helm repo add dslink-repo https://arachyts.github.io/daemonsetlink-operator/
helm repo updateInstall the release:
helm install dslink-prod dslink-repo/daemonsetlink-operator --namespace kube-systemYou can optionally modify and specify values file too:
helm install dslink-prod dslink-repo/daemonsetlink-operator --namespace kube-system -f values.yamlkubectl apply -f https://arachyts.github.io/daemonsetlink-operator/install.yamlThis will install CRDs, permissions, and create a deployment in the kube-system namespace.
You can then configure DaemonSetLink objects to start tracking specific source-target pairs. See examples in samples
- go version v1.22.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Build and push your image to the location specified by IMG:
make docker-buildx IMG=<some-registry>/daemonsetlink-operator:tag PLATFORMS="linux/amd64,linux/arm64"NOTE: This image ought to be published in the personal registry you specified. And it is required to have access to pull the image from the working environment. Make sure you have the proper permission to the registry if the above commands don’t work.
Install the CRDs into the cluster:
make installCustomize manifests
Edit kustomization
Generate manifests:
make manifests generateDeploy the Manager to the cluster with the image specified by IMG:
make deploy IMG=<some-registry>/daemonsetlink-operator:tagNOTE: If you encounter RBAC errors, you may need to grant yourself cluster-admin privileges or be logged in as admin.
Create instances of your solution You can apply the samples (examples) from the config/sample:
kubectl apply -k config/samples/operators_v1alpha1_daemonsetlink.yamlDelete the instances (CRs) from the cluster:
kubectl delete -k config/samples/operators_v1alpha1_daemonsetlink.yamlDelete the APIs(CRDs) from the cluster:
make uninstallUnDeploy the controller from the cluster:
make undeploy