prefer-dual-stack-webhook

command module
v0.0.0-...-048efe5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

README

PreferDualStack Admission Controller

Currently Kubernetes services are created in single stack mode by default, defaulting to primary address family of the cluster.

This is a mutating webhook admission controller that adds ipFamilyPolicy: PreferDualStack to all newly created services if the field is not explicitely specified, making dual-stack the default.

Installation

kubectl apply -f https://raw.githubusercontent.com/tibordp/prefer-dual-stack-webhook/master/deploy.yaml

Demo

Before Afrer
> kubectl apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
  name: dummy
spec:
  selector:
    app: dummy
  ports:
    - port: 80
      targetPort: 80
EOF
service/dummy created

> kubectl describe svc dummy
Name:              dummy
Namespace:         default
Labels:            <none>
Annotations:       <none>
Selector:          app=dummy
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.96.200.4
IPs:               10.96.200.4
Port:              <unset>  80/TCP
TargetPort:        80/TCP
Endpoints:         <none>
Session Affinity:  None
Events:            <none>
> kubectl apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
  name: dummy
spec:
  selector:
    app: dummy
  ports:
    - port: 80
      targetPort: 80
EOF
service/dummy created

> kubectl describe svc dummy
Name:              dummy
Namespace:         default
Labels:            <none>
Annotations:       <none>
Selector:          app=dummy
Type:              ClusterIP
IP Family Policy:  PreferDualStack
IP Families:       IPv4,IPv6
IP:                10.96.19.47
IPs:               10.96.19.47,fd00:10:96::f31
Port:              <unset>  80/TCP
TargetPort:        80/TCP
Endpoints:         <none>
Session Affinity:  None
Events:            <none>

Acknowledgements

Admission controller webhook boilerplate adapted from douglasmakey/admissioncontroller by Douglas Makey Mendez Molero.

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