k8s-controller-sidecars

command module
v0.0.0-...-6908f46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 25 Imported by: 0

README

Kubernetes Custom Controller - Sidecar Shutdown

Kubernetes (cron)jobs sidecar terminator. Originally forked from https://github.com/nrmitchi/k8s-controller-sidecars .

What is this?

This is a custom Kubernetes controller for the purpose of watching running pods, and sending a SIGTERM to sidecar containers when the "main" application container has exited (and the sidecars are the only non-terminated containers).

This is a response to https://github.com/kubernetes/kubernetes/issues/25908.

Usage

  1. Deploy the controller into your cluster
kubectl apply -f manifest.yml
  1. Add the nrmitchi.com/sidecars annotation to your pods, with a comma-seperated list of sidecar container names.

Example:

---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: test-job
spec:
  schedule: "* * * * *"
  jobTemplate:
    spec:
      template:
        metadata:
          annotations:
            nrmitchi.com/sidecars: logging
        spec:
          restartPolicy: Never
          containers:
            - name: test-job
              image: ubuntu:latest
              command: ["sleep", "5"]
            - name: logging
              image: fluentd

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL