network-health-admission-controller

command module
v0.0.0-...-98f1cd9 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

network health admission controller

This admission controller acts as a MutatingAdmissionWebhook and adds network health sidecars to pods.

Installation

  1. install the dependencies
  2. download and verify setup.yaml
  3. deploy admission controller kubectl apply -f setup.yaml

Dependencies

Usage

Enable admission controller for a namespace

Create a namespace and add the label network-health-sidecar/enabled: "true".

apiVersion: v1
kind: Namespace
metadata:
  name: network-health-test
  labels:
    network-health-sidecar/enabled: "true"

All pods created in this namespace start with an additional network health sidecar container.

Disable for a pod

Create a pod and add the label network-health-sidecar/enabled: "false".

apiVersion: v1
kind: Pod
metadata:
  name: network-health-test-pod-disabled
  namespace: network-health-test
  labels:
    network-health-sidecar/enabled: "false"
spec:
  containers:
    - name: example
      image: nginx

Pods with this label will skip the sidecar setup.

Use network port instead of unix socket

The sidecar communicates by default via a unix socket.

To communicate via a network port add the label network-health-sidecar/port: "8181".

apiVersion: v1
kind: Pod
metadata:
  name: network-health-test-pod-disabled
  namespace: network-health-test
  labels:
    network-health-sidecar/port: "8181"
spec:
  containers:
    - name: example
      image: nginx

Pods with this label will use port 8181 and define a http redinessProbe instead of a exec readinessProbe.

local development

  1. install tilt, helm, helmfile, helm diff, and kind
  2. setup kind with local registry
  3. deploy dependencies helmfile sync
  4. start environment tilt up

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