Tailing sidecar operator automatically adds streaming sidecar containers which use tailing sidecar image to Pods based on configuration provided in annotation.
Configuration for tailing sidecar operator is described here.
To quickly see benefits of using tailing sidecar operator try it in prepared Vagrant environment.
- cert-manager
- admission webhooks enabled
- kustomize
Set tailing sidecar image:
export TAILING_SIDECAR_IMG="<some-registry>/<project-name>:tag"
sed -i.backup "s#sumologic/tailing-sidecar:latest#${TAILING_SIDECAR_IMG}#g" config/default/manager_patch.yaml
Set tailing-sidecar operator image:
export TAILING_SIDECAR_OPERATOR_IMG="<some-registry>/<project-name>:tag"
(cd config/manager && kustomize edit set image controller="${TAILING_SIDECAR_OPERATOR_IMG}")
kustomize build config/default | kubectl apply -f -
Add annotation to Pod in following form:
metadata:
annotations:
tailing-sidecar: <sidecar-name-0>:<volume-name-0>:<path-to-tail-0>;<sidecar-name-1>:<volume-name-1>:<path-to-tail-1>
to learn more about configuration see this.
Deploy Pod with tailing-sidecar
annotation e.g.
kubectl apply -f examples/pod_with_annotations.yaml
Check logs from tailing sidecar e.g.
kubectl logs pod-with-annotations tailing-sidecar-0 --tail 5 -n tailing-sidecar-system
To build tailing sidecar operator image:
make docker-build IMG="<some-registry>/<project-name>:tag"
To push tailing sidecar operator image to container registry:
make docker-push IMG="<some-registry>/<project-name>:tag"
Start and provision the Vagrant environment:
vagrant up
Connect to virtual machine:
vagrant ssh
Build and push tailing sidecar image to local container registry:
/tailing-sidecasidecar/fluentbit/akefile
Go to operator directory:
cd /tailing-sidecar/operator
Deploy operator:
make
Deploy examples:
make deploy-examples
Check that operator added tailing sidecars to example resources:
make check-examples