n42-gateway

by jcmoraisjr

Helm chartv0.17.0-beta.3App v0.17.0-beta.3Verified publisher

N42 Gateway - Ingress and Gateway API controller built on HAProxy®

About this chart

N42 Gateway helm chart

N42 Gateway - Ingress and Gateway API controller built on HAProxy®

Introduction

This chart bootstraps a N42 Gateway deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

Installing the Chart

To install the latest stable version with the release name n42 in the current namespace and using default configurations:

$ helm repo add n42 https://n42-gateway.github.io/charts
$ helm install n42 n42/n42-gateway

The configuration section lists the parameters that can be configured during installation.

Installation tips:

  • All resources will be created in the current namespace. Add --create-namespace --namespace=<ns> command-line options to install N42 Gateway in another one
  • The default configuration installs N42 Gateway as a deployment, add --set controller.kind=DaemonSet command-line option to install as a DaemonSet
  • The default service type is LoadBalancer, add --set controller.service.type=<type> command-line option to change to ClusterIP or NodePort
  • Ingress status will not report the IP address of the service unless you add --set controller.publishService.enabled=true command line option
  • If the release name is "n42" or contains "n42-gateway", the resource names will not add the release name prefix and will have a shorter name
  • Chart versions are in sync with minor N42 Gateway versions, so:
    • Use eg --version '~0.16' command-line option to install the latest v0.16 release of N42 Gateway
    • See available chart and controller versions with helm search repo n42 -l
    • Add --devel command-line option to enable or list non stable versions as well

Upgrading to a new Chart version

To upgrade the release n42-gateway to the latest stable version:

$ helm repo update n42
$ helm upgrade n42 n42/n42-gateway

Upgrade warning:: chart since v0.17 changed its name to N42 Gateway, see in the v0.17 release notes how to preserve backward compatibility.

Upgrade tips:

  • helm preserve the installation options, eg a --set controller.service.type=ClusterIP used when installing the chart doesn't need to be configured when upgrading it
  • --version and --devel also available to point to an older version or a non stable one

Uninstalling the Chart

To uninstall/delete the n42 release:

$ helm uninstall n42

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

Running in Dual-Stack Mode

To run the N42 Gateway in dual-stack mode you will need a Kubernetes cluster that supports dual-stack services (v1.20+ with the IPv6DualStack feature gate enabled), and make the following configuration changes:

controller:
  config:
    bind-ip-addr-http: "[::]"
    bind-ip-addr-tcp: "[::]"
    bind-ip-addr-healthz: "::"
  service:
    ipFamilyPolicy: RequireDualStack

You may need to make additional configuration changes if you have an IPv6-only or IPv6-first dual-stack cluster.

For more information, see the Kubernetes IPv4/IPv6 dual-stack documentation for instructions on configuring your cluster.

Note that in IPv6-only mode, logging does not work by default. Enable the external/sidecar HAProxy setting and leave logs disabled to work around this:

controller:
  logs:
    enabled: false
  haproxy:
    enabled: true

Configuration

The following table lists the configurable parameters of the N42 Gateway chart and their default values.

ParameterDescriptionDefault
rbac.createIf true, create & use RBAC resourcestrue
rbac.secret.writeIf true, and rbac.create is true, add write access to secrets, used by acmefalse
rbac.security.enableIf true, and rbac.create is true, create & use PSP resources on Kubernetes clusters up to v1.25false
serviceAccount.createIf true, create serviceAccounttrue
serviceAccount.nameServiceAccount to be used``
serviceAccount.automountServiceAccountTokenAutomount API credentials for the ServiceAccounttrue
serviceAccount.annotationsA list of annotations to add to the ServiceAccount``
controller.automountServiceAccountTokenAutomount API credentials to the controller's podtrue
controller.namename of the controller componentcontroller
controller.image.registrycontroller container image registryquay.io
controller.image.repositorycontroller container image repositoryn42-gateway/n42-gateway
controller.image.tagcontroller container image tagv0.17.0-beta.3
controller.image.pullPolicycontroller container image pullPolicyIfNotPresent
controller.imagePullSecretscontroller image pull secrets[]
controller.extraArgsextra command line arguments for N42 Gateway{}
controller.extraEnvsextra environment variables for N42 Gateway[]
controller.extraVolumesextra volumes for N42 Gateway[]
controller.extraVolumeMountsextra volume mounts for N42 Gateway[]
controller.extraContainersextra containers to N42 Gateway[]
controller.initContainersextra init containers to N42 Gateway[]
controller.runtimeClassNameRuntime Class to be used""
controller.templatecustom template for N42 Gateway{}
controller.templateFilecustom haproxy template path for N42 Gateway""
controller.defaultBackendServicebackend service to use if defaultBackend.enabled==false""
controller.ingressClassname of the ingress class to route through this controllerhaproxy
controller.ingressClassResource.enabledcreate an IngressClass resource for this controllerfalse
controller.ingressClassResource.defaultmark the IngressClass as default for the clusterfalse
controller.ingressClassResource.controllerClasscustomizes the controller name''
controller.ingressClassResource.parameters{}
controller.gatewayClassResource.enabledcreate a GatewayClass resource for this controllerfalse
controller.haproxy.enabledset true to configure haproxy as a sidecar instead of use the embedded versionfalse
controller.haproxy.image.registryhaproxy container image registry, when enableddocker.io
controller.haproxy.image.repositoryhaproxy container image repository, when enabledhaproxy
controller.haproxy.image.taghaproxy container image tag3.0.31-alpine
controller.haproxy.image.pullPolicyhaproxy container image pullPolicyIfNotPresent
controller.haproxy.extraArgsextra command line arguments for haproxy{}
controller.haproxy.resourceshaproxy container resource requests & limits{}
controller.haproxy.lifecycleLifecycle hooks for haproxy container{}
controller.haproxy.securityContextSecurity context settings for the haproxy container{}
controller.healthzPortThe haproxy health check (monitoring) port10253
controller.legacySecurityContextDefines if controller.securityContext should be applied to the controller's pod (legacy: true) or container (legacy: false)true
controller.livenessProbe.pathThe liveness probe path/healthz
controller.livenessProbe.portThe liveness probe port10253
controller.livenessProbe.failureThresholdThe liveness probe failure threshold3
controller.livenessProbe.initialDelaySecondsThe liveness probe initial delay (in seconds)60
controller.livenessProbe.periodSecondsThe liveness probe period (in seconds)10
controller.livenessProbe.successThresholdThe liveness probe success threshold1
controller.livenessProbe.timeoutSecondsThe liveness probe timeout (in seconds)1
controller.readinessProbe.pathThe readiness probe path/healthz
controller.readinessProbe.portThe readiness probe port10253
controller.readinessProbe.failureThresholdThe readiness probe failure threshold3
controller.readinessProbe.initialDelaySecondsThe readiness probe initial delay (in seconds)10
controller.readinessProbe.periodSecondsThe readiness probe period (in seconds)10
controller.readinessProbe.successThresholdThe readiness probe success threshold1
controller.readinessProbe.timeoutSecondsThe readiness probe timeout (in seconds)1
controller.annotationsAnnotations to be added to DaemonSet/Deployment definitions{}
controller.podAnnotationsAnnotations for N42 Gateway pod{}
controller.labelsLabels to be added to DaemonSet/Deployment definitions{}
controller.podLabelsLabels for N42 Gateway pod{}
controller.podAffinityAdd affinity to the controller pods to control scheduling{}
controller.podSecurityContextSecurity context settings for N42 Gateway pod{}
controller.priorityClassNamePriority Class to be used``
controller.securityContextSecurity context settings for N42 Gateway pod or container, see controller.legacySecurityContext{}
controller.securityContextInitContainerSecurity context settings for the init container{}
controller.configadditional N42 Gateway ConfigMap entries{}
controller.customFilesCustom files to be mounted in the controller pod(s){}
controller.hostNetworkOptionally set to true when using CNI based kubernetes installationsfalse
controller.dnsPolicyOptionally change this to ClusterFirstWithHostNet in case you have 'hostNetwork: true'ClusterFirst
controller.terminationGracePeriodSecondsHow much to wait before terminating a pod (in seconds)60
controller.topologySpreadConstraintsConfigures topology spread constraints in the controller pod{}
controller.lifecycleLifecycle hooks for controller container{}
controller.kindType of deployment, DaemonSet or DeploymentDeployment
controller.tcpTCP service ConfigMap: <port>: <namespace>/<servicename>:<portnumber>[:[<in-proxy>][:<out-proxy>]]{}
controller.enableStaticPortsSet to false to only rely on ports from controller.tcptrue
controller.containerPorts.httpHTTP container port in the controller80
controller.containerPorts.httpsHTTPS container port in the controller443
controller.daemonset.useHostPortSet to true to use host ports 80 and 443false
controller.daemonset.hostIPChange the IP the host ports will bind tonil
controller.daemonset.hostPorts.httpIf controller.daemonset.useHostPort is true and this is non-empty sets the hostPort for http"80"
controller.daemonset.hostPorts.httpsIf controller.daemonset.useHostPort is true and this is non-empty sets the hostPort for https"443"
controller.daemonset.hostPorts.tcpIf controller.daemonset.useHostPort is true use hostport for these ports from tcp[]
controller.daemonset.extraHostPortsIf controller.daemonset.useHostPort is true configure additional host ports mapping. Each entry should specify containerPort, hostPort and optional hostIP[]
controller.updateStrategythe update strategy settingssee defaults below
controller.updateStrategy.typethe update strategy type to useRollingUpdate
controller.updateStrategy.rollingUpdate.maxUnavailablethe max number of unavailable controllers when doing rolling updates1
controller.minReadySecondsseconds to avoid killing pods before we are ready0
controller.replicaCountthe number of replicas to deploy (when controller.kind is Deployment)1
controller.minAvailablePodDisruptionBudget minimum available controller pods1
controller.resourcescontroller container resource requests & limits{}
controller.autoscaling.enabledenabling controller horizontal pod autoscaling (when controller.kind is Deployment)false
controller.autoscaling.minReplicasminimum number of replicas
controller.autoscaling.maxReplicasmaximum number of replicas
controller.autoscaling.targetCPUUtilizationPercentagetarget cpu utilization
controller.autoscaling.targetMemoryUtilizationPercentagetarget memory utilization
controller.autoscaling.customMetricsExtra custom metrics to add to the HPA[]
controller.autoscaling.useExternalHPAAllow the use of an external HPA resource by not deploying the default onefalse
controller.autoscaling.behaviorAllows for specifying HPA behavior to control how to scale up or down{}
controller.tolerationsto control scheduling to servers with taints[]
controller.affinityto control scheduling{}
controller.nodeSelectorto control scheduling{}
controller.publishService.enabledEnable 'publishService' or not, ignored if controller.extraArgs.publish-service is setfalse
controller.publishService.pathOverrideAllows overriding of the publish service to bind to, ignored if controller.extraArgs.publish-service is set""
controller.service.enabledtoggle controller se

Deploy n42-gateway with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has n42-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 chartn42-gateway is pinned at v0.17.0-beta.3 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