pod-gateway

by funkypenguin

Helm chartv5.6.2App v1.6.1Verified publisher

Admision controller to change the default gateway and DNS server of PODs

About this chart

pod-gateway

Admision controller to change the default gateway and DNS server of PODs

This chart is not maintained by the upstream project and any issues with the chart should be raised here

Source Code

Requirements

Kubernetes: >=1.16.0-0

Dependencies

RepositoryNameVersion
https://library-charts.k8s-at-home.comcommon4.5.2

TL;DR

helm repo add k8s-at-home https://k8s-at-home.com/charts/
helm repo update
helm install pod-gateway k8s-at-home/pod-gateway

Installing the Chart

To install the chart with the release name pod-gateway

helm install pod-gateway k8s-at-home/pod-gateway

Uninstalling the Chart

To uninstall the pod-gateway deployment

helm uninstall pod-gateway

The command removes all the Kubernetes components associated with the chart including persistent volumes and deletes the release.

Configuration

Read through the values.yaml file. It has several commented out suggested values. Other values may be used from the values.yaml from the common library.

Specify each parameter using the --set key=value[,key=value] argument to helm install.

helm install pod-gateway \
  --set env.TZ="America/New York" \
    k8s-at-home/pod-gateway

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.

helm install pod-gateway k8s-at-home/pod-gateway -f values.yaml

Custom configuration

Please check this guide for the full instructions.

You need to add routed-gateway=true to the namespaces with PODs you want to route through this POD gateway. If needed the label name can be changed in .Values.

The webhook by default changes all processed pods (remove --setGatewayDefault if you want to change the default). You can also change the default for a POD by adding a label or annotation (setGateway by default).

Processed PODs will get their default gateway changed. DNS server will also be set to the gateway (at least the option --keepDNS is used).

If you want to use the VPN please follow the common chart VPN sidecar docummentation. If you want to test without VPN client you can set the VPN_BLOCK_OTHER_TRAFFIC to false.

IMPORTANT: Do not deploy this chart to a namespace controlled by this webhook. This would result in a likelly deathlock when upgrading the chart.

NOTE: This char requires the cert-manager CRD to generate the required certificates. It does not install it as dependency to avoid conflicts.

Values

Important: When deploying an application Helm chart you can add more values from our common library chart here

KeyTypeDefaultDescription
DNSstring"172.16.0.1"IP address of the DNS server within the vxlan tunnel. All mutated PODs will get this as their DNS server. It must match VXLAN_GATEWAY_IP in settings.sh
DNSPolicystring"None"The DNSPolicy to apply to the POD. Only when set to "None" will the DNS value above apply. To avoid altering POD DNS (i.e., to allow initContainers to use DNS before the the VXLAN is up), set to "ClusterFirst"
addonsobject{"vpn":{"enabled":false,"networkPolicy":{"egress":[{"ports":[{"port":1194,"protocol":"UDP"}],"to":[{"ipBlock":{"cidr":"0.0.0.0/0"}}]},{"to":[{"ipBlock":{"cidr":"10.0.0.0/8"}}]}],"enabled":true},"type":"openvpn"}}IP: 10 ports: - type: udp port: 18289 - type: tcp port: 18289
addons.vpn.enabledboolfalseEnable the VPN if you want to route through a VPN. You might also want to set VPN_BLOCK_OTHER_TRAFFIC to true for extra safeness in case the VPN does connect
addons.vpn.networkPolicyobject{"egress":[{"ports":[{"port":1194,"protocol":"UDP"}],"to":[{"ipBlock":{"cidr":"0.0.0.0/0"}}]},{"to":[{"ipBlock":{"cidr":"10.0.0.0/8"}}]}],"enabled":true}wireguard: env: configFileSecret: openvpn
clusterNamestring"cluster.local"cluster name used to derive the gateway full name
image.pullPolicystring"IfNotPresent"image pull policy of the gateway and inserted helper cotainers
image.repositorystring"ghcr.io/k8s-at-home/pod-gateway"image repository of the gateway and inserted helper containers
image.tagstringchart.appVersionimage tag of the gateway and inserted helper containers
publicPortsstringnilsettings to expose ports, usually through a VPN provider. NOTE: if you change it you will need to manually restart the gateway POD
routed_namespaceslist[]Namespaces that might contain routed PODs and therefore require a copy of the gneerated settings configmap.
settings.DNS_LOCAL_CIDRSstring"local"DNS queries to these domains will be resolved by K8S DNS instead of the default (typcally the VPN client changes it)
settings.NOT_ROUTED_TO_GATEWAY_CIDRSstring""IPs not sent to the POD gateway but to the default K8S. Multiple CIDRs can be specified using blanks as separator. Example for Calico: ""172.22.0.0/16 172.24.0.0/16" This is needed, for example, in case your CNI does not add a non-default rule for the K8S addresses (Flannel does).
settings.VPN_BLOCK_OTHER_TRAFFICboolfalsePrevent non VPN traffic to leave the gateway
settings.VPN_INTERFACEstring"tun0"If using a VPN, interface name created by it
settings.VPN_LOCAL_CIDRSstring"10.0.0.0/8 192.168.0.0/16"Traffic to these IPs will be send through the K8S gateway
settings.VPN_TRAFFIC_PORTint1194If VPN_BLOCK_OTHER_TRAFFIC is true, allow VPN traffic over this port
settings.VXLAN_GATEWAY_FIRST_DYNAMIC_IPint20Keep a range of IPs for static assignment in nat.conf
settings.VXLAN_IDint42Vxlan ID to use
settings.VXLAN_IP_NETWORKstring"172.16.0"VXLAN needs an /24 IP range not conflicting with K8S and local IP ranges
webhookobjectSee belowThe webhook is used to mutate the PODs matching the given namespace labels. It inserts an init and sidecard helper containers that connect to the gateway pod created by this chart.
webhook.gatewayAnnotationstring"setGateway"annotation name to check when evaluating POD. If true the POD will get the gateway. If not set setGatewayDefault will apply.
webhook.gatewayDefaultbooltruedefault behviour for new PODs in the evaluated namespace
webhook.gatewayLabelstring"setGateway"label name to check when evaluating POD. If true the POD will get the gateway. If not set setGatewayDefault will apply.
webhook.image.pullPolicystring"IfNotPresent"image pullPolicy of the webhook
webhook.image.repositorystring"ghcr.io/k8s-at-home/gateway-admision-controller"image repository of the webhook
webhook.image.tagstring"v3.5.0"image tag of the webhook
webhook.namespaceSelectorobject{"custom":{},"label":"routed-gateway","type":"label"}Selector for namespace. All pods in this namespace will get evaluated by the webhook. IMPORTANT: Do not select the namespace where the webhook is deployed to or you will get locking issues.
webhook.replicasint1number of webhook instances to deploy
webhook.strategyobject{"type":"RollingUpdate"}strategy for updates

Changelog

Version 5.6.2

Added

N/A

Changed

  • Upgraded common chart dependency to version 4.5.2

Fixed

N/A

Older versions

A historical overview of changes can be found on ArtifactHUB

Support


Autogenerated from chart metadata using helm-docs v0.1.1

Deploy pod-gateway with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pod-gateway on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpod-gateway is pinned at v5.6.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply