haproxy-ingress

by joaquinito2051

Helm chartv0.0.13App 0.7.1

Ingress controller implementation for haproxy loadbalancer.

About this chart

haproxy-ingress

haproxy-ingress is an Ingress controller that uses ConfigMap to store the global haproxy configuration, and ingress annotations to configure per-backend settings.

Introduction

This chart bootstraps an haproxy-ingress deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.8+ with Beta APIs enabled

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/haproxy-ingress

$ helm install --name my-release incubator/haproxy-ingress The command deploys haproxy-ingress on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete --purge my-release

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

Configuration

The following table lists the configurable parameters of the haproxy-ingress chart and their default values.

ParameterDescriptionDefault
rbac.createIf true, create & use RBAC resourcestrue
rbac.security.enableIf true, and rbac.create is true, create & use PSP resourcesfalse
serviceAccount.createIf true, create serviceAccounttrue
serviceAccount.nameServiceAccount to be used``
controller.namename of the controller componentcontroller
controller.image.repositorycontroller container image repositoryquay.io/jcmoraisjr/haproxy-ingress
controller.image.tagcontroller container image tagv0.7.1
controller.image.pullPolicycontroller container image pullPolicyIfNotPresent
controller.initContainersextra containers that can initialize the haproxy-ingress-controller[]
controller.extraArgsextra command line arguments for the haproxy-ingress-controller{}
controller.extraEnvextra environment variables for the haproxy-ingress-controller{}
controller.templatecustom template for haproxy-ingress-controller{}
controller.defaultBackendServicebackend service if defualtBackend.enabled==false""
controller.ingressClassname of the ingress class to route through this controllerhapproxy
controller.healthzPortThe haproxy health check (monitoring) port10253
controller.livenessProbe.pathThe liveness probe path/healthz
controller.livenessProbe.portThe livneness probe port10253
controller.livenessProbe.failureThresholdThe livneness probe failure threshold3
controller.livenessProbe.initialDelaySecondsThe livneness probe initial delay (in seconds)10
controller.livenessProbe.periodSecondsThe livneness probe period (in seconds)10
controller.livenessProbe.successThresholdThe livneness probe success threshold1
controller.livenessProbe.timeoutSecondsThe livneness 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.podAnnotationsAnnotations for the haproxy-ingress-controller pod{}
controller.podLabelsLabels for the haproxy-ingress-controller pod{}
controller.podAffinityAdd affinity to the controller pods to control scheduling{}
controller.priorityClassNamePriority Class to be used``
controller.securityContextSecurity context settings for the haproxy-ingress-controller pod{}
controller.configadditional haproxy-ingress ConfigMap entries{}
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.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.daemonset.useHostPortSet to true to use host ports 80 and 443false
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.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.tolerationsto control scheduling to servers with taints[]
controller.affinityto control scheduling{}
controller.nodeSelectorto control scheduling{}
controller.service.annotationsannotations for controller service{}
controller.service.labelslabels for controller service{}
controller.service.clusterIPinternal controller cluster service IP""
controller.service.externalTrafficPolicyexternal traffic policyCluster
controller.service.externalIPslist of IP addresses at which the controller services are available[]
controller.service.loadBalancerIPIP address to assign to load balancer (if supported)""
controller.service.loadBalancerSourceRanges[]
controller.service.httpPortsThe http ports to open, that map to the Ingress' port 80. Each entry specifies a port and an optional nodePort.[ port: 80 ]
controller.service.httpsPortsThe https ports to open, that map to the Ingress' port 443. Each entry specifies a port and an optional nodePort.[ port: 443 ]
controller.service.typetype of controller service to createLoadBalancer
controller.stats.enabledwhether to enable exporting statsfalse
controller.stats.portThe port number used haproxy-ingress-controller for haproxy statistics1936
controller.stats.service.annotationsannotations for stats service{}
controller.stats.service.clusterIPinternal stats cluster service IP""
controller.stats.service.externalIPslist of IP addresses at which the stats service is available[]
controller.stats.service.loadBalancerIPIP address to assign to load balancer (if supported)""
controller.stats.service.loadBalancerSourceRanges[]
controller.stats.service.servicePortthe port number exposed by the stats service1936
controller.stats.service.typetype of controller service to createClusterIP
controller.metrics.enabledIf controller.stats.enabled = true and controller.metrics.enabled = true, Prometheus metrics will be exportedfalse
controller.metrics.image.repositoryprometheus-exporter image repositoryquay.io/prometheus/haproxy-exporter
controller.metrics.image.tagprometheus-exporter image tagv0.10.0
controller.metrics.image.pullPolicyprometheus-exporter image pullPolicyIfNotPresent
controller.metrics.extraArgsExtra arguments to the haproxy_exporter{}
controller.metrics.resourcesprometheus-exporter container resource requests & limits{}
controller.metrics.service.annotationsannotations for metrics service{}
controller.metrics.service.clusterIPinternal metrics cluster service IP""
controller.metrics.service.externalIPslist of IP addresses at which the metrics service is available[]
controller.metrics.service.loadBalancerIPIP address to assign to load balancer (if supported)""
controller.metrics.service.loadBalancerSourceRanges[]
controller.metrics.service.servicePortthe port number exposed by the metrics service1936
controller.metrics.service.typetype of controller service to createClusterIP
controller.logs.enabledenable an access-logs sidecar container that collects access logs from haproxy and outputs to stdoutfalse
controller.logs.image.repositoryaccess-logs container image repositoryquay.io/prometheus/haproxy-exporter
controller.logs.image.tagaccess-logs image tagv0.10.0
controller.logs.image.pullPolicyaccess-logs image pullPolicyIfNotPresent
controller.logs.resourcesaccess-logs container resource requests & limits{}
defaultBackend.enabledwhether to use the default backend componenttrue
defaultBackend.namename of the default backend componentdefault-backend
defaultBackend.image.repositorydefault backend container image repositorygcr.io/google_containers/defaultbackend
defaultBackend.image.tagdefault backend container image repository tag1.0
defaultBackend.image.pullPolicydefault backend container image pullPolicyIfNotPresent
defaultBackend.tolerationsto control scheduling to servers with taints[]
defaultBackend.affinityto control scheduling{}
defaultBackend.nodeSelectorto control scheduling{}
defaultBackend.podAnnotationsAnnotations for the default backend pod{}
defaultBackend.podLabelsLabels for the default backend pod{}
defaultBackend.replicaCountthe number of replicas to deploy (when controller.kind is Deployment)1
defaultBackend.minAvailablePodDisruptionBudget minimum available default backend pods1
defaultBackend.resourcesdefault backend pod resourcessee defaults below
defaultBackend.resources.limits.cpudefault backend cpu resources limit10m
defaultBackend.resources.limits.memorydefault backend memory resources limit20Mi
defaultBackend.service.namename of default backend service to createingress-default-backend
defaultBackend.service.annotationsannotations for metrics service{}
defaultBackend.service.clusterIPinternal metrics cluster service IP""
defaultBackend.service.externalIPslist of IP addresses at which the metrics service is available[]
defaultBackend.service.loadBalancerIPIP address to assign to load balancer (if supported)""
defaultBackend.service.loadBalancerSourceRanges[]
defaultBackend.service.servicePortthe port number exposed by the metrics service1936
defaultBackend.service.typetype of controller service to createClusterIP

Deploy haproxy-ingress with OpenTenant

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