ipsec

by serge.logvinov

Helm chartv0.6.4App 5.2Verified publisher

IPSec link for Kubernetes

About this chart

ipsec

IPSec link for Kubernetes

The main idea of the project is to make it easy to connect Kubernetes services through an IPsec tunnel. This tunnel provides a secure way for external clients or other networks to access services inside a Kubernetes cluster.

Homepage: https://github.com/sergelogvinov/helm-charts

Maintainers

NameEmailUrl
sergelogvinovhttps://github.com/sergelogvinov

Source Code

Example:

users:
  # openssl passwd -1 "password"
  user: $1$6GUtZDrw$ewnkkSXNY0mjTajRSlY5h.

secrets: |
  : PSK "ExampleSecret123"

# Exported service
# The 172.30.1.1:5432 will be available from the external network
ipsecService:
  enabled: true

  ip: 172.30.1.1
  ports:
    - name: postgres
      port: 5432
      backend: pg-backend.database.svc.cluster.local.

config: |
  conn xauth-psk
    pfs=no
    rekey=no
    ikev2=never
    keyingtries=5
    aggressive=no
    fragmentation=no
    cisco-unity=yes

    encapsulation=yes
    type=tunnel
    mtu=1300

    authby=secret
    xauthby=file

    ike=aes-sha1,aes-sha1;modp2048,aes-sha2;modp2048,aes256-sha2_512
    esp=aes-sha1,aes-sha2,aes256-sha2_512
    ikelifetime=24h
    salifetime=24h

    leftxauthserver=yes
    leftmodecfgserver=yes

    right=%any
    rightaddresspool=172.30.240.1-172.30.240.254
    rightxauthclient=yes
    rightmodecfgclient=yes

    also=service
    auto=add
    dpddelay=30
    dpdtimeout=120
    dpdaction=clear

Values

KeyTypeDefaultDescription
replicaCountint1
image.repositorystring"ghcr.io/sergelogvinov/ipsec"
image.pullPolicystring"IfNotPresent"
image.tagstring""
imagePullSecretslist[]
nameOverridestring""
fullnameOverridestring""
envsobject{}Deployment envs
secretsstring"# openssl rand -base64 48\n%any 1.2.3.4 : PSK \"base64\"\n"
usersobject{}XAUTH openssl passwd -1 "$PASSWORD"
configstring"conn gcp\n ikev2=yes\n ikelifetime=600m\n keylife=180m\n rekeymargin=3m\n keyingtries=3\n ike=aes256-sha256-modp2048\n esp=aes256-sha256-modp2048\n pfs=yes\n"
hostAliaseslist[]host aliases ref: https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
ipsecService.enabledboolfalse
ipsecService.image.repositorystring"ghcr.io/sergelogvinov/haproxy"
ipsecService.image.pullPolicystring"IfNotPresent"
ipsecService.image.tagstring"3.3.5-alpine3.23"
ipsecService.ipstring"10.10.10.10"
ipsecService.networksstring"%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:!172.30.240.0/24"
ipsecService.portslist[]
serviceAccountobject{"annotations":{},"create":true,"name":""}Pods Service Account. ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
priorityClassNamestringnilPriority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
podAnnotationsobject{}Annotations for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
serviceobject{"ipFamilies":["IPv4"],"ipsec":4500,"isakmp":500,"type":"ClusterIP"}Service parameters ref: https://kubernetes.io/docs/user-guide/services/
resourcesobject{"limits":{"cpu":"100m","memory":"128Mi"},"requests":{"cpu":"100m","memory":"64Mi"}}Resource requests and limits. ref: https://kubernetes.io/docs/user-guide/compute-resources/
useDaemonSetboolfalseUse a daemonset instead of a deployment
updateStrategyobject{"rollingUpdate":{"maxUnavailable":1},"type":"RollingUpdate"}Pod deployment update strategy type. ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment
nodeSelectorobject{}Node labels for pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/
tolerationslist[]Tolerations for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
affinityobject{}Affinity for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

Deploy ipsec with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ipsec 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 chartipsec is pinned at v0.6.4 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