├── kubernetes-ingress ├── ci │ ├── deployment-default-values.yaml │ ├── daemonset-default-values.yaml │ ├── deployment-psp-values.yaml │ ├── deployment-disableddefaultbackend-values.yaml │ ├── deployment-nodeport-values.yaml │ ├── deployment-customconfig-values.yaml │ ├── daemonset-nodeport-values.yaml │ ├── deployment-disabledsecretconfig-values.yaml │ ├── deployment-extraargs-values.yaml │ ├── daemonset-customconfig-values.yaml │ ├── deployment-publishservice-values.yaml │ ├── daemonset-disableddefaultbackend-values.yaml │ ├── daemonset-extraargs-values.yaml │ ├── daemonset-disabledsecretconfig-values.yaml │ ├── deployment-replicacount-unset.yaml │ ├── deployment-customnodeport-values.yaml │ ├── deployment-enableports-values.yaml │ ├── daemonset-customnodeport-values.yaml │ ├── daemonset-enableports-values.yaml │ ├── daemonset-publishservice-values.yaml │ ├── daemonset-hostport-values.yaml │ ├── daemonset-serviceannotation-values.yaml │ └── deployment-hpa-values.yaml ├── .helmignore ├── templates │ ├── controller-serviceaccount.yaml │ ├── default-backend-serviceaccount.yaml │ ├── controller-pullsecret.yaml │ ├── controller-configmap.yaml │ ├── controller-role.yaml │ ├── controller-defaultcertsecret.yaml │ ├── clusterrolebinding.yaml │ ├── default-backend-role.yaml │ ├── controller-rolebinding.yaml │ ├── default-backend-service.yaml │ ├── default-backend-rolebinding.yaml │ ├── controller-servicemonitor.yaml │ ├── clusterrole.yaml │ ├── controller-poddisruptionbudget.yaml │ ├── controller-hpa.yaml │ ├── default-backend-hpa.yaml │ ├── default-backend-podsecuritypolicy.yaml │ ├── NOTES.txt │ ├── controller-podsecuritypolicy.yaml │ ├── default-backend-deployment.yaml │ ├── controller-service.yaml │ ├── _helpers.tpl │ ├── controller-deployment.yaml │ └── controller-daemonset.yaml ├── Chart.yaml ├── README.md └── values.yaml ├── haproxy ├── ci │ ├── deployment-basic-values.yaml │ ├── daemonset-basic-values.yaml │ ├── deployment-securitycontext-values.yaml │ ├── deployment-hpa-values.yaml │ ├── daemonset-hostnet-values.yaml │ └── deployment-config-values.yaml ├── .helmignore ├── templates │ ├── configmap.yaml │ ├── pullsecret.yaml │ ├── serviceaccount.yaml │ ├── poddisruptionbudget.yaml │ ├── service.yaml │ ├── hpa.yaml │ ├── NOTES.txt │ ├── podsecuritypolicy.yaml │ ├── _helpers.tpl │ ├── deployment.yaml │ └── daemonset.yaml ├── Chart.yaml ├── values.yaml └── README.md ├── .circleci ├── ct.yaml ├── install_tools.sh ├── config.yml ├── release.sh └── install_charts.sh ├── .github └── workflows │ └── check.yml ├── .gitignore ├── README.md ├── CONTRIBUTING.md └── LICENSE /kubernetes-ingress/ci/deployment-default-values.yaml: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /haproxy/ci/deployment-basic-values.yaml: -------------------------------------------------------------------------------- 1 | kind: Deployment 2 | -------------------------------------------------------------------------------- /.circleci/ct.yaml: -------------------------------------------------------------------------------- 1 | chart-dirs: . 2 | helm-extra-args: --timeout 600s 3 | -------------------------------------------------------------------------------- /haproxy/ci/daemonset-basic-values.yaml: -------------------------------------------------------------------------------- 1 | kind: DaemonSet 2 | replicaCount: 2 3 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-default-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-psp-values.yaml: -------------------------------------------------------------------------------- 1 | podSecurityPolicy: 2 | enabled: true 3 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-disableddefaultbackend-values.yaml: -------------------------------------------------------------------------------- 1 | defaultBackend: 2 | enabled: false 3 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-nodeport-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | service: 3 | type: NodePort 4 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-customconfig-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | config: 3 | rate-limit: "ON" 4 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-nodeport-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | service: 4 | type: NodePort 5 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-disabledsecretconfig-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | defaultTLSSecret: 3 | enabled: false 4 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-extraargs-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | extraArgs: 3 | - --namespace-whitelist=default 4 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-customconfig-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | config: 4 | rate-limit: "ON" 5 | -------------------------------------------------------------------------------- /haproxy/ci/deployment-securitycontext-values.yaml: -------------------------------------------------------------------------------- 1 | kind: Deployment 2 | securityContext: 3 | runAsUser: 1000 4 | runAsGroup: 1000 5 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-publishservice-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | publishService: 4 | enabled: true 5 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-disableddefaultbackend-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | defaultBackend: 4 | enabled: false 5 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-extraargs-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | extraArgs: 4 | - --namespace-whitelist=default 5 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-disabledsecretconfig-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | defaultTLSSecret: 4 | enabled: false 5 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-replicacount-unset.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | replicaCount: null 3 | 4 | defaultBackend: 5 | replicaCount: null 6 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-customnodeport-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | service: 3 | type: NodePort 4 | ports: 5 | 8000: 10000 6 | 8001: 10001 7 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-enableports-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | service: 3 | enablePorts: 4 | http: false 5 | https: true 6 | stat: false 7 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-customnodeport-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | service: 4 | type: NodePort 5 | ports: 6 | 8000: 10000 7 | 8001: 10001 8 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-enableports-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | service: 4 | enablePorts: 5 | http: false 6 | https: true 7 | stat: false 8 | -------------------------------------------------------------------------------- /haproxy/ci/deployment-hpa-values.yaml: -------------------------------------------------------------------------------- 1 | kind: Deployment 2 | replicaCount: null 3 | autoscaling: 4 | enabled: true 5 | minReplicas: 1 6 | maxReplicas: 5 7 | targetCPUUtilizationPercentage: 80 8 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-publishservice-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | service: 4 | annotations: 5 | service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 6 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-hostport-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | daemonset: 4 | useHostPort: true 5 | hostPorts: 6 | http: 80 7 | https: 443 8 | stat: 1024 9 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/daemonset-serviceannotation-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: DaemonSet 3 | service: 4 | annotations: 5 | service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 6 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: Commit subject 2 | on: [pull_request] 3 | jobs: 4 | check: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: check-commit 8 | uses: docker://haproxytech/check-commit:v2.1.0 9 | env: 10 | API_TOKEN: ${{ secrets.GITHUB_TOKEN }} 11 | -------------------------------------------------------------------------------- /haproxy/ci/daemonset-hostnet-values.yaml: -------------------------------------------------------------------------------- 1 | kind: DaemonSet 2 | containerPorts: 3 | http: 8080 4 | https: 8443 5 | stat: 8024 6 | daemonset: 7 | useHostNetwork: true 8 | useHostPort: true 9 | hostPorts: 10 | http: 8080 11 | https: 8443 12 | stat: 8024 13 | dnsPolicy: ClusterFirstWithHostNet 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # General files 2 | *.tgz 3 | .project 4 | .deploy 5 | 6 | # MacOS 7 | ._* 8 | .DS_Store 9 | 10 | # JetBrains 11 | .idea/ 12 | *.iml 13 | 14 | # VSC 15 | .vscode 16 | 17 | # Emacs 18 | *~ 19 | \#*\# 20 | .\#* 21 | 22 | # Vim 23 | [._]*.s[a-w][a-z] 24 | [._]s[a-w][a-z] 25 | *.un~ 26 | Session.vim 27 | .netrwhist 28 | 29 | # TODO 30 | TODO 31 | -------------------------------------------------------------------------------- /kubernetes-ingress/ci/deployment-hpa-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | kind: Deployment 3 | autoscaling: 4 | enabled: true 5 | minReplicas: 1 6 | maxReplicas: 5 7 | targetCPUUtilizationPercentage: 80 8 | 9 | defaultBackend: 10 | autoscaling: 11 | enabled: true 12 | minReplicas: 1 13 | maxReplicas: 2 14 | targetCPUUtilizationPercentage: 50 15 | -------------------------------------------------------------------------------- /haproxy/ci/deployment-config-values.yaml: -------------------------------------------------------------------------------- 1 | config: | 2 | global 3 | log stdout format raw local0 4 | daemon 5 | maxconn 1024 6 | 7 | defaults 8 | log global 9 | timeout client 60s 10 | timeout connect 60s 11 | timeout server 60s 12 | 13 | frontend fe_main 14 | bind :80 15 | default_backend be_main 16 | 17 | backend be_main 18 | server web1 10.0.0.1:8080 check 19 | -------------------------------------------------------------------------------- /kubernetes-ingress/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /haproxy/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /haproxy/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.config }} 18 | apiVersion: v1 19 | kind: ConfigMap 20 | metadata: 21 | name: {{ include "haproxy.fullname" . }} 22 | labels: 23 | {{- include "haproxy.labels" . | nindent 4 }} 24 | data: 25 | haproxy.cfg: | 26 | {{ .Values.config | nindent 4 }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /haproxy/templates/pullsecret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.imageCredentials.registry }} 18 | apiVersion: v1 19 | kind: Secret 20 | metadata: 21 | name: {{ include "haproxy.fullname" . }} 22 | labels: 23 | {{- include "haproxy.labels" . | nindent 4 }} 24 | type: kubernetes.io/dockerconfigjson 25 | data: 26 | .dockerconfigjson: {{ include "haproxy.imagePullSecret" . }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /haproxy/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.serviceAccount.create -}} 18 | apiVersion: v1 19 | kind: ServiceAccount 20 | metadata: 21 | name: {{ include "haproxy.serviceAccountName" . }} 22 | labels: 23 | {{- include "haproxy.labels" . | nindent 4 }} 24 | {{- with .Values.serviceAccount.annotations }} 25 | annotations: 26 | {{- toYaml . | nindent 4 }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /haproxy/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 HAProxy Technologies LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: v1 16 | name: haproxy 17 | version: 1.2.0 18 | kubeVersion: ">=1.12.0-0" 19 | description: A Helm chart for HAProxy on Kubernetes 20 | keywords: 21 | - haproxy 22 | home: https://github.com/haproxytech/helm-charts/tree/master/haproxy 23 | sources: 24 | - http://www.haproxy.org/ 25 | icon: http://www.haproxy.org/img/HAProxyCommunityEdition_60px.png 26 | maintainers: 27 | - name: Dinko Korunic 28 | email: dkorunic@haproxy.com 29 | appVersion: 2.3.9 30 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if or .Values.serviceAccount.create -}} 18 | apiVersion: v1 19 | kind: ServiceAccount 20 | metadata: 21 | name: {{ template "kubernetes-ingress.serviceAccountName" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | {{- end -}} 30 | -------------------------------------------------------------------------------- /haproxy/templates/poddisruptionbudget.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.PodDisruptionBudget.enable }} 18 | apiVersion: policy/v1beta1 19 | kind: PodDisruptionBudget 20 | metadata: 21 | name: {{ include "haproxy.fullname" . }} 22 | labels: 23 | {{- include "haproxy.labels" . | nindent 4 }} 24 | spec: 25 | {{- if .Values.PodDisruptionBudget.maxUnavailable }} 26 | maxUnavailable: {{ .Values.PodDisruptionBudget.maxUnavailable }} 27 | {{- end }} 28 | {{- if .Values.PodDisruptionBudget.minAvailable }} 29 | minAvailable: {{ .Values.PodDisruptionBudget.minAvailable }} 30 | {{- end }} 31 | selector: 32 | matchLabels: 33 | {{- include "haproxy.selectorLabels" . | nindent 6 }} 34 | {{- end }} -------------------------------------------------------------------------------- /kubernetes-ingress/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 HAProxy Technologies LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: v1 16 | name: kubernetes-ingress 17 | version: 1.14.2 18 | kubeVersion: ">=1.12.0-0" 19 | description: A Helm chart for HAProxy Kubernetes Ingress Controller 20 | keywords: 21 | - ingress 22 | - haproxy 23 | home: https://github.com/haproxytech/helm-charts/tree/master/kubernetes-ingress 24 | sources: 25 | - https://github.com/haproxytech/kubernetes-ingress 26 | icon: http://www.haproxy.org/img/HAProxyCommunityEdition_60px.png 27 | maintainers: 28 | - name: Moemen Mhedhbi 29 | email: mmhedhbi@haproxy.com 30 | - name: Baptiste Assmann 31 | email: bassmann@haproxy.com 32 | - name: Dinko Korunic 33 | email: dkorunic@haproxy.com 34 | appVersion: 1.6.0 35 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.serviceAccount.create .Values.defaultBackend.serviceAccount.create .Values.defaultBackend.enabled -}} 18 | apiVersion: v1 19 | kind: ServiceAccount 20 | metadata: 21 | name: {{ template "kubernetes-ingress.defaultBackend.serviceAccountName" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | {{- end -}} 30 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-pullsecret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.controller.imageCredentials.registry }} 18 | apiVersion: v1 19 | kind: Secret 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | type: kubernetes.io/dockerconfigjson 30 | data: 31 | .dockerconfigjson: {{ template "kubernetes-ingress.imagePullSecret" . }} 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | apiVersion: v1 18 | kind: ConfigMap 19 | metadata: 20 | name: {{ template "kubernetes-ingress.fullname" . }} 21 | namespace: {{ .Release.Namespace }} 22 | labels: 23 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 24 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 25 | app.kubernetes.io/managed-by: {{ .Release.Service }} 26 | app.kubernetes.io/instance: {{ .Release.Name }} 27 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 28 | data: 29 | {{- if .Values.controller.logging.traffic }} 30 | syslog-server: {{ template "kubernetes-ingress.syslogServer" . }} 31 | {{- end }} 32 | {{- if .Values.controller.config }} 33 | {{ toYaml .Values.controller.config | indent 2 }} 34 | {{- end }} 35 | -------------------------------------------------------------------------------- /.circleci/install_tools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | readonly HELM_VERSION=3.0.1 6 | readonly CHART_RELEASER_VERSION=0.2.3 7 | 8 | install_helm() { 9 | echo "Installing Helm" 10 | curl -sSLO "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" 11 | sudo mkdir -p "/usr/local/helm-v${HELM_VERSION}" 12 | sudo tar -xzf "helm-v${HELM_VERSION}-linux-amd64.tar.gz" -C "/usr/local/helm-v${HELM_VERSION}" 13 | sudo ln -s "/usr/local/helm-v${HELM_VERSION}/linux-amd64/helm" /usr/local/bin/helm 14 | sudo chmod +x /usr/local/helm-v${HELM_VERSION}/linux-amd64/helm 15 | rm -f "helm-v${HELM_VERSION}-linux-amd64.tar.gz" 16 | helm init 17 | } 18 | 19 | install_cr() { 20 | echo "Installing Chart Releaser" 21 | curl -sSLO "https://github.com/helm/chart-releaser/releases/download/v${CHART_RELEASER_VERSION}/chart-releaser_${CHART_RELEASER_VERSION}_linux_amd64.tar.gz" 22 | sudo mkdir -p "/usr/local/chart-releaser-v${CHART_RELEASER_VERSION}" 23 | sudo tar -xzf "chart-releaser_${CHART_RELEASER_VERSION}_linux_amd64.tar.gz" -C "/usr/local/chart-releaser-v${CHART_RELEASER_VERSION}" 24 | sudo ln -s "/usr/local/chart-releaser-v${CHART_RELEASER_VERSION}/cr" /usr/local/bin/cr 25 | sudo chmod +x "/usr/local/chart-releaser-v${CHART_RELEASER_VERSION}/cr" 26 | rm -f "chart-releaser_${CHART_RELEASER_VERSION}_linux_amd64.tar.gz" 27 | } 28 | 29 | main() { 30 | install_helm 31 | install_cr 32 | } 33 | 34 | main 35 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-role.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled -}} 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: Role 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | rules: 30 | - apiGroups: 31 | - "policy" 32 | resources: 33 | - podsecuritypolicies 34 | verbs: 35 | - use 36 | resourceNames: 37 | - {{ template "kubernetes-ingress.fullname" . }} 38 | {{- end -}} 39 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-defaultcertsecret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.controller.defaultTLSSecret.enabled }} 18 | apiVersion: v1 19 | kind: Secret 20 | type: kubernetes.io/tls 21 | metadata: 22 | name: {{ template "kubernetes-ingress.defaultTLSSecret.fullname" . }} 23 | namespace: {{ .Release.Namespace }} 24 | labels: 25 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 26 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 27 | app.kubernetes.io/managed-by: {{ .Release.Service }} 28 | app.kubernetes.io/instance: {{ .Release.Name }} 29 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 30 | annotations: 31 | "helm.sh/hook": "pre-install" 32 | "helm.sh/hook-delete-policy": "before-hook-creation" 33 | data: 34 | {{ ( include "kubernetes-ingress.gen-certs" . ) | indent 2 }} 35 | {{- end }} -------------------------------------------------------------------------------- /kubernetes-ingress/templates/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.rbac.create -}} 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRoleBinding 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | labels: 23 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 24 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 25 | app.kubernetes.io/managed-by: {{ .Release.Service }} 26 | app.kubernetes.io/instance: {{ .Release.Name }} 27 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 28 | roleRef: 29 | apiGroup: rbac.authorization.k8s.io 30 | kind: ClusterRole 31 | name: {{ template "kubernetes-ingress.fullname" . }} 32 | subjects: 33 | - kind: ServiceAccount 34 | name: {{ template "kubernetes-ingress.serviceAccountName" . }} 35 | namespace: {{ .Release.Namespace }} 36 | {{- end -}} 37 | 38 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-role.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}} 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: Role 20 | metadata: 21 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | rules: 30 | - apiGroups: 31 | - "policy" 32 | resources: 33 | - podsecuritypolicies 34 | verbs: 35 | - use 36 | resourceNames: 37 | - {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 38 | {{- end -}} 39 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled -}} 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: RoleBinding 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | roleRef: 30 | apiGroup: rbac.authorization.k8s.io 31 | kind: Role 32 | name: {{ template "kubernetes-ingress.fullname" . }} 33 | subjects: 34 | - kind: ServiceAccount 35 | name: {{ template "kubernetes-ingress.serviceAccountName" . }} 36 | namespace: {{ .Release.Namespace }} 37 | {{- end -}} 38 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.defaultBackend.enabled }} 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | spec: 30 | type: ClusterIP 31 | clusterIP: None 32 | ports: 33 | - name: http 34 | port: {{ .Values.defaultBackend.service.port }} 35 | protocol: TCP 36 | targetPort: http 37 | selector: 38 | app.kubernetes.io/name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 39 | app.kubernetes.io/instance: {{ .Release.Name }} 40 | {{- end }} 41 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}} 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: RoleBinding 20 | metadata: 21 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | roleRef: 30 | apiGroup: rbac.authorization.k8s.io 31 | kind: Role 32 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 33 | subjects: 34 | - kind: ServiceAccount 35 | name: {{ template "kubernetes-ingress.defaultBackend.serviceAccountName" . }} 36 | namespace: {{ .Release.Namespace }} 37 | {{- end -}} 38 | -------------------------------------------------------------------------------- /haproxy/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | apiVersion: v1 18 | kind: Service 19 | metadata: 20 | name: {{ include "haproxy.fullname" . }} 21 | labels: 22 | {{- include "haproxy.labels" . | nindent 4 }} 23 | annotations: 24 | {{- range $key, $value := .Values.service.annotations }} 25 | {{ $key }}: {{ $value | quote }} 26 | {{- end }} 27 | spec: 28 | type: {{ .Values.service.type }} 29 | selector: 30 | {{- include "haproxy.selectorLabels" . | nindent 4 }} 31 | {{- with .Values.service.clusterIP }} 32 | clusterIP: {{ . | quote}} 33 | {{- end }} 34 | {{- with .Values.service.loadBalancerIP }} 35 | loadBalancerIP: {{ . | quote }} 36 | {{- end }} 37 | {{- with .Values.service.loadBalancerSourceRanges }} 38 | loadBalancerSourceRanges: 39 | {{- toYaml . | nindent 2 }} 40 | {{- end }} 41 | {{- with .Values.containerPorts }} 42 | ports: 43 | {{- range $key, $port := . }} 44 | - name: {{ $key }} 45 | protocol: TCP 46 | port: {{ $port }} 47 | targetPort: {{ $key }} 48 | {{- end }} 49 | {{- end }} 50 | -------------------------------------------------------------------------------- /haproxy/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.autoscaling.enabled }} 18 | apiVersion: autoscaling/v2beta1 19 | kind: HorizontalPodAutoscaler 20 | metadata: 21 | name: {{ include "haproxy.fullname" . }} 22 | labels: 23 | {{- include "haproxy.labels" . | nindent 4 }} 24 | spec: 25 | scaleTargetRef: 26 | apiVersion: apps/v1 27 | kind: Deployment 28 | name: {{ include "haproxy.fullname" . }} 29 | minReplicas: {{ .Values.autoscaling.minReplicas }} 30 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 31 | metrics: 32 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 33 | - type: Resource 34 | resource: 35 | name: cpu 36 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 37 | {{- end }} 38 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 39 | - type: Resource 40 | resource: 41 | name: memory 42 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 43 | {{- end }} 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.controller.serviceMonitor.enabled }} 18 | apiVersion: monitoring.coreos.com/v1 19 | kind: ServiceMonitor 20 | metadata: 21 | name: {{ template "kubernetes-ingress.serviceMonitorName" . }} 22 | labels: 23 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 24 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 25 | app.kubernetes.io/managed-by: {{ .Release.Service }} 26 | app.kubernetes.io/instance: {{ .Release.Name }} 27 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 28 | {{- if .Values.controller.serviceMonitor.extraLabels }} 29 | {{ toYaml .Values.controller.serviceMonitor.extraLabels | nindent 4 }} 30 | {{- end }} 31 | spec: 32 | endpoints: 33 | {{ .Values.controller.serviceMonitor.endpoints | toYaml | nindent 4 }} 34 | namespaceSelector: 35 | matchNames: 36 | - {{ .Release.Namespace }} 37 | selector: 38 | matchLabels: 39 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 40 | app.kubernetes.io/instance: {{ .Release.Name }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/clusterrole.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.rbac.create -}} 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRole 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | labels: 23 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 24 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 25 | app.kubernetes.io/managed-by: {{ .Release.Service }} 26 | app.kubernetes.io/instance: {{ .Release.Name }} 27 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 28 | rules: 29 | - apiGroups: 30 | - "" 31 | resources: 32 | - configmaps 33 | - endpoints 34 | - services 35 | - namespaces 36 | - events 37 | - secrets 38 | verbs: 39 | - get 40 | - list 41 | - watch 42 | - apiGroups: 43 | - "extensions" 44 | - "networking.k8s.io" 45 | resources: 46 | - ingresses 47 | - ingresses/status 48 | - ingressclasses 49 | verbs: 50 | - get 51 | - list 52 | - watch 53 | - apiGroups: 54 | - "extensions" 55 | - "networking.k8s.io" 56 | resources: 57 | - ingresses/status 58 | verbs: 59 | - update 60 | {{- end -}} 61 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-poddisruptionbudget.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.controller.PodDisruptionBudget.enable }} 18 | apiVersion: policy/v1beta1 19 | kind: PodDisruptionBudget 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | spec: 30 | {{- if .Values.controller.PodDisruptionBudget.maxUnavailable }} 31 | maxUnavailable: {{ .Values.controller.PodDisruptionBudget.maxUnavailable }} 32 | {{- end }} 33 | {{- if .Values.controller.PodDisruptionBudget.minAvailable }} 34 | minAvailable: {{ .Values.controller.PodDisruptionBudget.minAvailable }} 35 | {{- end }} 36 | selector: 37 | matchLabels: 38 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 39 | app.kubernetes.io/instance: {{ .Release.Name }} 40 | {{- end }} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![HAProxy](https://github.com/haproxytech/kubernetes-ingress/raw/master/assets/images/haproxy-weblogo-210x49.png "HAProxy") 2 | 3 | ## HAProxy Helm Charts 4 | 5 | ![GitHub](https://img.shields.io/github/license/haproxytech/helm-charts) 6 | [![CircleCI](https://circleci.com/gh/haproxytech/helm-charts/tree/master.svg?style=svg)](https://circleci.com/gh/haproxytech/helm-charts/tree/master) 7 | 8 | This repository hosts official [HAProxy Technologies](https://www.haproxy.com/) Helm Charts for deploying on [Kubernetes](https://kubernetes.io/). 9 | 10 | ## Before you begin 11 | 12 | ### Setup a Kubernetes Cluster 13 | 14 | The quickest way to setup a Kubernetes cluster is with [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/), [AWS Elastic Kubernetes Service](https://aws.amazon.com/eks/) or [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) using their respective quick-start guides. 15 | 16 | For setting up Kubernetes on other cloud platforms or bare-metal servers refer to the Kubernetes [getting started guide](http://kubernetes.io/docs/getting-started-guides/). 17 | 18 | ### Install Helm 19 | 20 | Get the latest [Helm release](https://github.com/helm/helm#install). 21 | 22 | ### Add Helm chart repo 23 | 24 | Once you have Helm installed, add the repo as follows: 25 | 26 | ```console 27 | helm repo add haproxytech https://haproxytech.github.io/helm-charts 28 | helm repo update 29 | ``` 30 | 31 | ## Search and install charts 32 | 33 | ```console 34 | helm search repo haproxytech/ 35 | helm install my-release haproxytech/ 36 | ``` 37 | 38 | ***NOTE***: For instructions on how to install a chart follow instructions in its `README.md`. 39 | 40 | ## Contributing 41 | 42 | We welcome all contributions. Please refer to [guidelines](CONTRIBUTING.md) on how to make a contribution. 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | lint-scripts: 4 | docker: 5 | - image: koalaman/shellcheck-alpine 6 | steps: 7 | - checkout 8 | - run: 9 | command: | 10 | shellcheck -x .circleci/install_charts.sh 11 | shellcheck -x .circleci/install_tools.sh 12 | shellcheck -x .circleci/release.sh 13 | lint-charts: 14 | docker: 15 | - image: quay.io/helmpack/chart-testing:latest 16 | steps: 17 | - checkout 18 | - run: 19 | command: ct lint --all --validate-maintainers=false --config .circleci/ct.yaml 20 | install-charts: 21 | machine: true 22 | steps: 23 | - checkout 24 | - run: 25 | no_output_timeout: 20m 26 | command: .circleci/install_charts.sh 27 | release-charts: 28 | machine: true 29 | steps: 30 | - checkout 31 | - add_ssh_keys: 32 | fingerprints: 33 | - "7f:84:3b:70:a1:c8:63:8e:dc:5f:51:51:b8:f4:7c:76" 34 | - run: 35 | command: | 36 | echo "export GIT_REPOSITORY_URL=$CIRCLE_REPOSITORY_URL" >> $BASH_ENV 37 | echo "export GIT_USERNAME=$CIRCLE_PROJECT_USERNAME" >> $BASH_ENV 38 | .circleci/install_tools.sh 39 | .circleci/release.sh 40 | workflows: 41 | version: 2 42 | lint-and-test: 43 | jobs: 44 | - lint-scripts: 45 | filters: 46 | branches: 47 | ignore: gh-pages 48 | - lint-charts: 49 | filters: 50 | branches: 51 | ignore: gh-pages 52 | - install-charts: 53 | requires: 54 | - lint-charts 55 | filters: 56 | branches: 57 | ignore: gh-pages 58 | release: 59 | jobs: 60 | - release-charts: 61 | filters: 62 | tags: 63 | ignore: /.*/ 64 | branches: 65 | only: master 66 | -------------------------------------------------------------------------------- /haproxy/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | HAProxy has been has been successfully installed. This Chart is used to run HAProxy as a regular application, 2 | as opposed to HAProxy Ingress Controller Chart. 3 | 4 | Controller image deployed is: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}". 5 | Your HAProxy app is of a "{{ .Values.kind }}" kind. 6 | 7 | Service ports mapped are: 8 | {{- if eq .Values.kind "Deployment" }} 9 | {{- range $key, $value := .Values.containerPorts }} 10 | - name: {{ $key }} 11 | containerPort: {{ $value }} 12 | protocol: TCP 13 | {{- end }} 14 | {{- end }} 15 | {{- if eq .Values.kind "DaemonSet" }} 16 | {{- $hostPorts := .Values.daemonset.hostPorts -}} 17 | {{- $useHostPort := .Values.daemonset.useHostPort -}} 18 | {{- range $key, $value := .Values.containerPorts }} 19 | - name: {{ $key }} 20 | containerPort: {{ $value }} 21 | protocol: TCP 22 | {{- if $useHostPort }} 23 | hostPort: {{ index $hostPorts $key | default $value }} 24 | {{- end }} 25 | {{- end }} 26 | {{- end }} 27 | 28 | To be able to bind to privileged ports as non-root, the following is required: 29 | 30 | securityContext: 31 | enabled: true 32 | runAsUser: 1000 33 | runAsGroup: 1000 34 | initContainers: 35 | - name: sysctl 36 | image: "busybox:musl" 37 | command: 38 | - /bin/sh 39 | - -c 40 | - sysctl -w net.ipv4.ip_unprivileged_port_start=0 41 | securityContext: 42 | privileged: true 43 | 44 | Node IP can be found with: 45 | $ kubectl --namespace {{ .Release.Namespace }} get nodes -o jsonpath="{.items[0].status.addresses[1].address}" 46 | 47 | For more examples and up to date documentation, please visit: 48 | * Helm chart documentation: https://github.com/haproxytech/helm-charts/tree/master/haproxy 49 | * HAProxy Alpine Docker container documentation: https://github.com/haproxytech/haproxy-docker-alpine 50 | * HAProxy documentation: https://www.haproxy.org/download/2.2/doc/configuration.txt 51 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-hpa.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and (eq .Values.controller.kind "Deployment") .Values.controller.autoscaling.enabled }} 18 | apiVersion: autoscaling/v2beta1 19 | kind: HorizontalPodAutoscaler 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | spec: 30 | scaleTargetRef: 31 | apiVersion: apps/v1 32 | kind: Deployment 33 | name: {{ template "kubernetes-ingress.fullname" . }} 34 | minReplicas: {{ .Values.controller.autoscaling.minReplicas }} 35 | maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }} 36 | metrics: 37 | {{- if .Values.controller.autoscaling.targetCPUUtilizationPercentage }} 38 | - type: Resource 39 | resource: 40 | name: cpu 41 | targetAverageUtilization: {{ .Values.controller.autoscaling.targetCPUUtilizationPercentage }} 42 | {{- end }} 43 | {{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }} 44 | - type: Resource 45 | resource: 46 | name: memory 47 | targetAverageUtilization: {{ .Values.controller.autoscaling.targetMemoryUtilizationPercentage }} 48 | {{- end }} 49 | {{- end }} -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-hpa.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.defaultBackend.autoscaling.enabled .Values.defaultBackend.enabled }} 18 | apiVersion: autoscaling/v2beta1 19 | kind: HorizontalPodAutoscaler 20 | metadata: 21 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | spec: 30 | scaleTargetRef: 31 | apiVersion: apps/v1 32 | kind: Deployment 33 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 34 | minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }} 35 | maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }} 36 | metrics: 37 | {{- if .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }} 38 | - type: Resource 39 | resource: 40 | name: cpu 41 | targetAverageUtilization: {{ .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }} 42 | {{- end }} 43 | {{- if .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }} 44 | - type: Resource 45 | resource: 46 | name: memory 47 | targetAverageUtilization: {{ .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }} 48 | {{- end }} 49 | {{- end }} -------------------------------------------------------------------------------- /haproxy/templates/podsecuritypolicy.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.podSecurityPolicy.create -}} 18 | {{- $useHostNetwork := .Values.daemonset.useHostNetwork -}} 19 | {{- $useHostPort := .Values.daemonset.useHostPort -}} 20 | {{- $hostPorts := .Values.daemonset.hostPorts -}} 21 | apiVersion: policy/v1beta1 22 | kind: PodSecurityPolicy 23 | metadata: 24 | name: {{ include "haproxy.fullname" . }} 25 | labels: 26 | {{- include "haproxy.labels" . | nindent 4 }} 27 | annotations: 28 | seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' 29 | apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' 30 | seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default' 31 | apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' 32 | spec: 33 | allowPrivilegeEscalation: true # to be able to use privileged containers for initContainers 34 | allowedCapabilities: 35 | - NET_BIND_SERVICE 36 | fsGroup: 37 | rule: MustRunAs 38 | ranges: 39 | - max: 65535 40 | min: 1 41 | {{- if $useHostNetwork }} 42 | hostNetwork: true 43 | {{- end }} 44 | {{- if or $useHostPort $useHostNetwork }} 45 | hostPorts: 46 | {{- range $key, $value := .Values.containerPorts }} 47 | - min: {{ $value }} 48 | max: {{ $value }} 49 | {{- end }} 50 | {{- end }} 51 | hostIPC: false 52 | hostPID: false 53 | privileged: true 54 | runAsUser: 55 | rule: RunAsAny 56 | seLinux: 57 | rule: RunAsAny 58 | supplementalGroups: 59 | rule: MustRunAs 60 | ranges: 61 | - max: 65535 62 | min: 1 63 | volumes: 64 | - configMap 65 | - emptyDir 66 | - projected 67 | - secret 68 | {{- end }} 69 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-podsecuritypolicy.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled }} 18 | apiVersion: policy/v1beta1 19 | kind: PodSecurityPolicy 20 | metadata: 21 | {{- if .Values.podSecurityPolicy.annotations }} 22 | annotations: 23 | {{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }} 24 | {{- end }} 25 | labels: 26 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 27 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 28 | app.kubernetes.io/managed-by: {{ .Release.Service }} 29 | app.kubernetes.io/instance: {{ .Release.Name }} 30 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 31 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 32 | annotations: 33 | seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' 34 | apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' 35 | seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default' 36 | apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' 37 | spec: 38 | allowPrivilegeEscalation: false 39 | allowedCapabilities: 40 | - NET_BIND_SERVICE 41 | defaultAllowPrivilegeEscalation: false 42 | fsGroup: 43 | rule: MustRunAs 44 | ranges: 45 | - max: 65535 46 | min: 1 47 | hostNetwork: false 48 | hostIPC: false 49 | hostPID: false 50 | privileged: false 51 | runAsUser: 52 | rule: RunAsAny 53 | seLinux: 54 | rule: RunAsAny 55 | supplementalGroups: 56 | rule: MustRunAs 57 | ranges: 58 | - max: 65535 59 | min: 1 60 | volumes: 61 | - configMap 62 | - downwardAPI 63 | - secret 64 | {{- end }} 65 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | HAProxy Kubernetes Ingress Controller has been successfully installed. 2 | 3 | Controller image deployed is: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}". 4 | Your controller is of a "{{ .Values.controller.kind }}" kind. Your controller service is running as a "{{ .Values.controller.service.type }}" type. 5 | {{- if .Values.rbac.create}} 6 | RBAC authorization is enabled. 7 | {{- else}} 8 | RBAC authorization is disabled. 9 | {{- end}} 10 | {{- if .Values.controller.ingressClass}} 11 | Controller ingress.class is set to "{{ .Values.controller.ingressClass }}" so make sure to use same annotation for 12 | Ingress resource. 13 | {{- end}} 14 | 15 | Service ports mapped are: 16 | {{- if eq .Values.controller.kind "Deployment" }} 17 | {{- range $key, $value := .Values.controller.containerPort }} 18 | - name: {{ $key }} 19 | containerPort: {{ $value }} 20 | protocol: TCP 21 | {{- end }} 22 | {{- end }} 23 | {{- if eq .Values.controller.kind "DaemonSet" }} 24 | {{- $hostPorts := .Values.controller.daemonset.hostPorts -}} 25 | {{- range $key, $value := .Values.controller.containerPort }} 26 | - name: {{ $key }} 27 | containerPort: {{ $value }} 28 | protocol: TCP 29 | hostPort: {{ index $hostPorts $key | default $value }} 30 | {{- end }} 31 | {{- end }} 32 | 33 | Node IP can be found with: 34 | $ kubectl --namespace {{ .Release.Namespace }} get nodes -o jsonpath="{.items[0].status.addresses[1].address}" 35 | 36 | The following ingress resource routes traffic to pods that match the following: 37 | * service name: web 38 | * client's Host header: webdemo.com 39 | * path begins with / 40 | 41 | --- 42 | apiVersion: networking.k8s.io/v1beta1 43 | kind: Ingress 44 | metadata: 45 | name: web-ingress 46 | namespace: default 47 | spec: 48 | rules: 49 | - host: webdemo.com 50 | http: 51 | paths: 52 | - path: / 53 | backend: 54 | serviceName: web 55 | servicePort: 80 56 | 57 | In case that you are using multi-ingress controller environment, make sure to use ingress.class annotation and match it 58 | with helm chart option controller.ingressClass. 59 | 60 | For more examples and up to date documentation, please visit: 61 | * Helm chart documentation: https://github.com/haproxytech/helm-charts/tree/master/kubernetes-ingress 62 | * Controller documentation: https://www.haproxy.com/documentation/hapee/2-0r1/traffic-management/kubernetes-ingress-controller/ 63 | * Annotation reference: https://github.com/haproxytech/kubernetes-ingress/tree/master/documentation 64 | * Image parameters reference: https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/controller.md 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-podsecuritypolicy.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled }} 18 | {{- $useHostNetwork := .Values.controller.daemonset.useHostNetwork }} 19 | {{- $useHostPort := .Values.controller.daemonset.useHostPort }} 20 | {{- $hostPorts := .Values.controller.daemonset.hostPorts -}} 21 | apiVersion: policy/v1beta1 22 | kind: PodSecurityPolicy 23 | metadata: 24 | {{- if .Values.podSecurityPolicy.annotations }} 25 | annotations: 26 | {{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }} 27 | {{- end }} 28 | labels: 29 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 30 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 31 | app.kubernetes.io/managed-by: {{ .Release.Service }} 32 | app.kubernetes.io/instance: {{ .Release.Name }} 33 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 34 | name: {{ template "kubernetes-ingress.fullname" . }} 35 | annotations: 36 | seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default' 37 | apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' 38 | seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default' 39 | apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' 40 | spec: 41 | allowPrivilegeEscalation: false 42 | allowedCapabilities: 43 | - NET_BIND_SERVICE 44 | defaultAllowPrivilegeEscalation: false 45 | fsGroup: 46 | rule: MustRunAs 47 | ranges: 48 | - max: 65535 49 | min: 1 50 | {{- if $useHostNetwork }} 51 | hostNetwork: true 52 | {{- end }} 53 | {{- if or $useHostPort $useHostNetwork }} 54 | hostPorts: 55 | {{- range $key, $value := .Values.controller.containerPort }} 56 | - min: {{ $value }} 57 | max: {{ $value }} 58 | {{- end }} 59 | {{- range .Values.controller.service.tcpPorts }} 60 | - min: {{ .port }} 61 | max: {{ .port }} 62 | {{- end }} 63 | {{- end }} 64 | hostIPC: false 65 | hostPID: false 66 | privileged: false 67 | runAsUser: 68 | rule: RunAsAny 69 | seLinux: 70 | rule: RunAsAny 71 | supplementalGroups: 72 | rule: MustRunAs 73 | ranges: 74 | - max: 65535 75 | min: 1 76 | volumes: 77 | - configMap 78 | - downwardAPI 79 | - secret 80 | {{- end }} 81 | -------------------------------------------------------------------------------- /haproxy/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{/* 18 | Expand the name of the chart. 19 | */}} 20 | {{- define "haproxy.name" -}} 21 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | 24 | {{/* 25 | Create a default fully qualified app name. 26 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 27 | If release name contains chart name it will be used as a full name. 28 | */}} 29 | {{- define "haproxy.fullname" -}} 30 | {{- if .Values.fullnameOverride }} 31 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 32 | {{- else }} 33 | {{- $name := default .Chart.Name .Values.nameOverride }} 34 | {{- if contains $name .Release.Name }} 35 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 36 | {{- else }} 37 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 38 | {{- end }} 39 | {{- end }} 40 | {{- end }} 41 | 42 | {{/* 43 | Create chart name and version as used by the chart label. 44 | */}} 45 | {{- define "haproxy.chart" -}} 46 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 47 | {{- end }} 48 | 49 | {{/* 50 | Common labels 51 | */}} 52 | {{- define "haproxy.labels" -}} 53 | helm.sh/chart: {{ include "haproxy.chart" . }} 54 | {{ include "haproxy.selectorLabels" . }} 55 | {{- if .Chart.AppVersion }} 56 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 57 | {{- end }} 58 | app.kubernetes.io/managed-by: {{ .Release.Service }} 59 | {{- end }} 60 | 61 | {{/* 62 | Selector labels 63 | */}} 64 | {{- define "haproxy.selectorLabels" -}} 65 | app.kubernetes.io/name: {{ include "haproxy.name" . }} 66 | app.kubernetes.io/instance: {{ .Release.Name }} 67 | {{- end }} 68 | 69 | {{/* 70 | Create the name of the service account to use 71 | */}} 72 | {{- define "haproxy.serviceAccountName" -}} 73 | {{- if .Values.serviceAccount.create }} 74 | {{- default (include "haproxy.fullname" .) .Values.serviceAccount.name }} 75 | {{- else }} 76 | {{- default "default" .Values.serviceAccount.name }} 77 | {{- end }} 78 | {{- end }} 79 | 80 | {{/* 81 | Encode an imagePullSecret string. 82 | */}} 83 | {{- define "haproxy.imagePullSecret" }} 84 | {{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.imageCredentials.registry (printf "%s:%s" .Values.imageCredentials.username .Values.imageCredentials.password | b64enc) | b64enc }} 85 | {{- end }} 86 | 87 | {{/* vim: set filetype=mustache: */}} 88 | -------------------------------------------------------------------------------- /.circleci/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o nounset 4 | 5 | : "${CR_TOKEN:?Environment variable CR_TOKEN must be set}" 6 | : "${GIT_REPOSITORY_URL:?Environment variable GIT_REPOSITORY_URL must be set}" 7 | : "${GIT_USERNAME:?Environment variable GIT_USERNAME must be set}" 8 | : "${GIT_EMAIL:?Environment variable GIT_EMAIL must be set}" 9 | 10 | readonly OWNER=haproxytech 11 | readonly GIT_REPO=helm-charts 12 | readonly PACKAGE_PATH=.deploy 13 | readonly CHARTS_URL=https://haproxytech.github.io/helm-charts 14 | readonly REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel)}" 15 | 16 | find_latest_tag() { 17 | if ! git describe --tags --abbrev=0 2>/dev/null; then 18 | git rev-list --max-parents=0 --first-parent HEAD 19 | fi 20 | } 21 | 22 | package_chart() { 23 | local chart="$1" 24 | helm dependency build "${chart}" 25 | helm package "${chart}" --destination "${PACKAGE_PATH}" 26 | } 27 | 28 | release_charts() { 29 | echo "Upload Helm chart packages" 30 | cr upload -o "${OWNER}" -r "${GIT_REPO}" -p "${PACKAGE_PATH}" 31 | } 32 | 33 | update_index() { 34 | echo "Generating Helm chart index" 35 | git config user.email "${GIT_EMAIL}" 36 | git config user.name "${GIT_USERNAME}" 37 | git checkout gh-pages 38 | 39 | cr index -i index.yaml -o "${OWNER}" -r "${GIT_REPO}" -c "${CHARTS_URL}" -p "${PACKAGE_PATH}" 40 | 41 | git add index.yaml 42 | git commit --message="Update index.yaml" --signoff 43 | git push "${GIT_REPOSITORY_URL}" gh-pages 44 | } 45 | 46 | main() { 47 | pushd "${REPO_ROOT}" >/dev/null || exit 1 48 | 49 | echo "Fetching tags" 50 | git fetch --tags 51 | 52 | local latest_tag 53 | latest_tag=$(find_latest_tag) 54 | 55 | local latest_tag_rev 56 | latest_tag_rev=$(git rev-parse --verify "${latest_tag}") 57 | echo "${latest_tag_rev} ${latest_tag} (latest tag)" 58 | 59 | local head_rev 60 | head_rev=$(git rev-parse --verify HEAD) 61 | echo "${head_rev} HEAD" 62 | 63 | if [[ "${latest_tag_rev}" == "${head_rev}" ]]; then 64 | echo "No code changes. Nothing to release." 65 | exit 66 | fi 67 | 68 | mkdir -p "${PACKAGE_PATH}" 69 | 70 | echo "Identifying changed charts since tag ${latest_tag}" 71 | 72 | local changed_charts=() 73 | readarray -t changed_charts <<< "$(git diff --find-renames --name-only "${latest_tag_rev}" | grep 'Chart.yaml$' | cut -d '/' -f 1 | sort -u)" 74 | 75 | if [[ -n "${changed_charts[*]}" ]]; then 76 | local release_pending=no 77 | for chart in "${changed_charts[@]}"; do 78 | if [[ -f "${chart}/Chart.yaml" ]]; then 79 | release_pending=yes 80 | echo "Packaging chart ${chart}" 81 | package_chart "${chart}" 82 | fi 83 | done 84 | 85 | if [[ "${release_pending}" == "yes" ]]; then 86 | release_charts 87 | update_index 88 | else 89 | echo "Nothing to do. No chart changes detected." 90 | fi 91 | else 92 | echo "Nothing to do. No chart changes detected." 93 | fi 94 | 95 | popd >/dev/null || exit 1 96 | } 97 | 98 | main 99 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Contributions are welcome via GitHub pull requests. 4 | This document outlines the process to help get your contribution accepted. 5 | 6 | ## Sign off Your Work 7 | 8 | The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. 9 | Here is the full text of the [DCO](http://developercertificate.org/): 10 | 11 | ``` 12 | Developer Certificate of Origin 13 | Version 1.1 14 | 15 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 16 | 1 Letterman Drive 17 | Suite D4700 18 | San Francisco, CA, 94129 19 | 20 | Everyone is permitted to copy and distribute verbatim copies of this 21 | license document, but changing it is not allowed. 22 | 23 | 24 | Developer's Certificate of Origin 1.1 25 | 26 | By making a contribution to this project, I certify that: 27 | 28 | (a) The contribution was created in whole or in part by me and I 29 | have the right to submit it under the open source license 30 | indicated in the file; or 31 | 32 | (b) The contribution is based upon previous work that, to the best 33 | of my knowledge, is covered under an appropriate open source 34 | license and I have the right under that license to submit that 35 | work with modifications, whether created in whole or in part 36 | by me, under the same open source license (unless I am 37 | permitted to submit under a different license), as indicated 38 | in the file; or 39 | 40 | (c) The contribution was provided directly to me by some other 41 | person who certified (a), (b) or (c) and I have not modified 42 | it. 43 | 44 | (d) I understand and agree that this project and the contribution 45 | are public and that a record of the contribution (including all 46 | personal information I submit with it, including my sign-off) is 47 | maintained indefinitely and may be redistributed consistent with 48 | this project or the open source license(s) involved. 49 | ``` 50 | 51 | Contributors must sign-off that they adhere to these requirements by adding a `Signed-off-by` line to commit messages. 52 | 53 | ``` 54 | This is my commit message 55 | 56 | Signed-off-by: Random J Developer 57 | ``` 58 | 59 | Git has a `-s` command line option to append this automatically to your commit message: 60 | 61 | ```console 62 | $ git commit -s -m 'This is my commit message' 63 | ``` 64 | 65 | ## How to Contribute 66 | 67 | 1. Fork this repository, develop, and test your changes. 68 | 1. Remember to sign off your commits as described above. 69 | 1. Submit a pull request. 70 | 71 | ***NOTE***: In order to make testing and merging of PRs easier, please submit changes to multiple charts in separate PRs. 72 | 73 | ### Technical Requirements 74 | 75 | * Must pass linting and installing with the [chart-testing](https://github.com/helm/chart-testing) tool 76 | * Must follow [best practices](https://github.com/helm/helm/tree/master/docs/chart_best_practices) and [review guidelines](https://github.com/helm/charts/blob/master/REVIEW_GUIDELINES.md) 77 | 78 | ### Documentation Requirements 79 | 80 | * A chart's `README.md` must include configuration options 81 | * A chart's `NOTES.txt` must include relevant post-installation information 82 | 83 | ### Merge Approval and Release Process 84 | 85 | * Must pass DCO check 86 | * Must pass CI jobs for linting and installing changed charts 87 | * Any change to a chart requires a version bump following [semver](https://semver.org/) principles 88 | 89 | Once changes have been merged, the release job will automatically run to package and release changed charts. 90 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/default-backend-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.defaultBackend.enabled }} 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | spec: 30 | {{- if not .Values.defaultBackend.autoscaling.enabled }} 31 | replicas: {{ .Values.defaultBackend.replicaCount }} 32 | {{- end }} 33 | selector: 34 | matchLabels: 35 | app.kubernetes.io/name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 36 | app.kubernetes.io/instance: {{ .Release.Name }} 37 | template: 38 | metadata: 39 | labels: 40 | app.kubernetes.io/name: {{ template "kubernetes-ingress.defaultBackend.fullname" . }} 41 | app.kubernetes.io/instance: {{ .Release.Name }} 42 | {{- if .Values.defaultBackend.podLabels }} 43 | {{ toYaml .Values.defaultBackend.podLabels | indent 8 }} 44 | {{- end }} 45 | {{- if .Values.defaultBackend.podAnnotations }} 46 | annotations: 47 | {{ toYaml .Values.defaultBackend.podAnnotations | indent 8 }} 48 | {{- end }} 49 | spec: 50 | {{- with .Values.defaultBackend.topologySpreadConstraints }} 51 | topologySpreadConstraints: 52 | {{- toYaml . | nindent 8 }} 53 | {{- end }} 54 | {{- if .Values.controller.priorityClassName }} 55 | priorityClassName: {{ .Values.controller.priorityClassName }} 56 | {{- end }} 57 | containers: 58 | - name: {{ template "kubernetes-ingress.name" . }}-{{ .Values.defaultBackend.name }} 59 | image: "{{ .Values.defaultBackend.image.repository }}:{{ .Values.defaultBackend.image.tag }}" 60 | imagePullPolicy: {{ .Values.defaultBackend.image.pullPolicy }} 61 | ports: 62 | - name: http 63 | containerPort: {{ .Values.defaultBackend.containerPort }} 64 | protocol: TCP 65 | {{- if .Values.defaultBackend.extraEnvs }} 66 | env: 67 | {{- range .Values.defaultBackend.extraEnvs }} 68 | - name: "{{ .name }}" 69 | value: "{{ .value }}" 70 | {{- end }} 71 | {{- end }} 72 | resources: 73 | {{- toYaml .Values.defaultBackend.resources | nindent 12 }} 74 | {{- with .Values.defaultBackend.nodeSelector }} 75 | nodeSelector: 76 | {{- toYaml . | nindent 8 }} 77 | {{- end }} 78 | {{- with .Values.defaultBackend.affinity }} 79 | affinity: 80 | {{- toYaml . | nindent 8 }} 81 | {{- end }} 82 | serviceAccountName: {{ template "kubernetes-ingress.defaultBackend.serviceAccountName" . }} 83 | terminationGracePeriodSeconds: 60 84 | {{- with .Values.defaultBackend.tolerations }} 85 | tolerations: 86 | {{- toYaml . | nindent 8 }} 87 | {{- end }} 88 | {{- end }} 89 | -------------------------------------------------------------------------------- /.circleci/install_charts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | readonly CT_VERSION=latest 8 | readonly KIND_VERSION=v0.9.0 9 | readonly CLUSTER_NAME=chart-testing 10 | readonly REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel)}" 11 | 12 | find_latest_tag() { 13 | if ! git describe --tags --abbrev=0 2>/dev/null; then 14 | git rev-list --max-parents=0 --first-parent HEAD 15 | fi 16 | } 17 | 18 | create_ct_container() { 19 | echo "Starting Chart Testing container" 20 | docker run --rm --interactive --detach --network host --name ct \ 21 | --volume "$(pwd)/.circleci/ct.yaml:/etc/ct/ct.yaml" \ 22 | --volume "$(pwd):/workdir" \ 23 | --workdir /workdir \ 24 | "quay.io/helmpack/chart-testing:${CT_VERSION}" \ 25 | cat 26 | } 27 | 28 | cleanup() { 29 | echo "Removing ct container" 30 | docker kill ct >/dev/null 2>&1 || true 31 | } 32 | 33 | docker_exec() { 34 | docker exec --interactive --tty ct "$@" 35 | } 36 | 37 | create_kind_cluster() { 38 | echo "Installing kind" 39 | curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64" 40 | chmod +x kind 41 | sudo mv kind /usr/local/bin/kind 42 | 43 | echo "Creating cluster" 44 | kind create cluster --name "${CLUSTER_NAME}" --wait 5m -q 45 | 46 | echo "Copying kubeconfig to container" 47 | local kubeconfig 48 | kubeconfig="$(pwd)/kube-config" 49 | kind get kubeconfig --name "${CLUSTER_NAME}" | tee "${kubeconfig}" 50 | docker_exec mkdir -p /root/.kube 51 | docker cp "${kubeconfig}" ct:/root/.kube/config 52 | 53 | docker_exec kubectl cluster-info 54 | docker_exec kubectl get nodes 55 | } 56 | 57 | install_local_path_provisioner() { 58 | docker_exec kubectl delete storageclass standard 59 | docker_exec kubectl apply -f "https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml" 60 | } 61 | 62 | install_charts() { 63 | docker_exec ct install --all 64 | echo 65 | } 66 | 67 | main() { 68 | pushd "${REPO_ROOT}" >/dev/null 69 | 70 | echo "Fetching tags" 71 | git fetch --tags 72 | 73 | local latest_tag 74 | latest_tag=$(find_latest_tag) 75 | 76 | local latest_tag_rev 77 | latest_tag_rev=$(git rev-parse --verify "${latest_tag}") 78 | echo "${latest_tag_rev} ${latest_tag} (latest tag)" 79 | 80 | local head_rev 81 | head_rev=$(git rev-parse --verify HEAD) 82 | echo "${head_rev} HEAD" 83 | 84 | if [[ "${latest_tag_rev}" == "${head_rev}" ]]; then 85 | echo "No code changes. Nothing to release." 86 | exit 87 | fi 88 | 89 | echo "Identifying changed charts since tag ${latest_tag}" 90 | 91 | local changed_charts=() 92 | readarray -t changed_charts <<< "$(git diff --find-renames --name-only "${latest_tag_rev}" | grep '\.yaml$' | cut -d '/' -f 1 | sort -u)" 93 | 94 | if [[ -n "${changed_charts[*]}" ]]; then 95 | local changes_pending=no 96 | for chart in "${changed_charts[@]}"; do 97 | if [[ -f "${chart}/Chart.yaml" ]]; then 98 | changes_pending=yes 99 | break 100 | fi 101 | done 102 | 103 | if [[ "${changes_pending}" == "yes" ]]; then 104 | create_ct_container 105 | trap cleanup EXIT 106 | 107 | create_kind_cluster 108 | install_local_path_provisioner 109 | install_charts 110 | else 111 | echo "Nothing to do. No chart changes detected." 112 | fi 113 | else 114 | echo "Nothing to do. No chart changes detected." 115 | fi 116 | 117 | popd >/dev/null 118 | } 119 | 120 | main 121 | -------------------------------------------------------------------------------- /haproxy/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if eq .Values.kind "Deployment" }} 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: {{ include "haproxy.fullname" . }} 22 | labels: 23 | {{- include "haproxy.labels" . | nindent 4 }} 24 | spec: 25 | {{- if not .Values.autoscaling.enabled }} 26 | replicas: {{ .Values.replicaCount }} 27 | {{- end }} 28 | selector: 29 | matchLabels: 30 | {{- include "haproxy.selectorLabels" . | nindent 6 }} 31 | {{- with .Values.strategy }} 32 | strategy: 33 | {{- toYaml . | nindent 4 }} 34 | {{- end }} 35 | template: 36 | metadata: 37 | labels: 38 | {{- include "haproxy.selectorLabels" . | nindent 8 }} 39 | {{- if .Values.podLabels }} 40 | {{ toYaml .Values.podLabels | indent 8 }} 41 | {{- end }} 42 | {{- if .Values.podAnnotations }} 43 | annotations: 44 | checksum/environment: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} 45 | {{ toYaml .Values.podAnnotations | indent 8 }} 46 | {{- end }} 47 | spec: 48 | serviceAccountName: {{ include "haproxy.serviceAccountName" . }} 49 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} 50 | securityContext: 51 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 52 | {{- if .Values.dnsConfig }} 53 | dnsConfig: 54 | {{ toYaml .Values.dnsConfig | indent 8 }} 55 | {{- end }} 56 | dnsPolicy: {{ .Values.dnsPolicy }} 57 | {{- if .Values.imageCredentials.registry }} 58 | imagePullSecrets: 59 | - name: {{ include "haproxy.fullname" . }} 60 | {{- else if .Values.existingImagePullSecret }} 61 | imagePullSecrets: 62 | - name: {{ .Values.existingImagePullSecret }} 63 | {{- end }} 64 | {{- if .Values.priorityClassName }} 65 | priorityClassName: {{ .Values.priorityClassName }} 66 | {{- end }} 67 | volumes: 68 | - name: haproxy-config 69 | configMap: 70 | name: {{ include "haproxy.fullname" . }} 71 | containers: 72 | - name: {{ .Chart.Name }} 73 | {{- if .Values.securityContext.enabled }} 74 | securityContext: 75 | runAsUser: {{ .Values.securityContext.runAsUser }} 76 | runAsGroup: {{ .Values.securityContext.runAsGroup }} 77 | capabilities: 78 | drop: 79 | - ALL 80 | add: 81 | - NET_BIND_SERVICE 82 | {{- end }} 83 | image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}" 84 | imagePullPolicy: {{ .Values.image.pullPolicy }} 85 | args: 86 | - -f 87 | - /usr/local/etc/haproxy/haproxy.cfg 88 | ports: 89 | {{- range $key, $value := .Values.containerPorts }} 90 | - name: {{ $key }} 91 | containerPort: {{ $value }} 92 | protocol: TCP 93 | {{- end }} 94 | resources: 95 | {{- toYaml .Values.resources | nindent 12 }} 96 | volumeMounts: 97 | - name: haproxy-config 98 | mountPath: /usr/local/etc/haproxy 99 | {{- with.Values.initContainers }} 100 | initContainers: 101 | {{- toYaml . | nindent 8 }} 102 | {{- end }} 103 | {{- with .Values.nodeSelector }} 104 | nodeSelector: 105 | {{- toYaml . | nindent 8 }} 106 | {{- end }} 107 | {{- with .Values.affinity }} 108 | affinity: 109 | {{- toYaml . | nindent 8 }} 110 | {{- end }} 111 | {{- with .Values.tolerations }} 112 | tolerations: 113 | {{- toYaml . | nindent 8 }} 114 | {{- end }} 115 | {{- end }} 116 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if .Values.controller.service.enabled }} 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | {{- if .Values.controller.service.labels }} 30 | {{ toYaml .Values.controller.service.labels | indent 4 }} 31 | {{- end }} 32 | annotations: 33 | {{- range $key, $value := .Values.controller.service.annotations }} 34 | {{ $key }}: {{ $value | quote }} 35 | {{- end }} 36 | spec: 37 | {{ with .Values.controller.service.clusterIP }}clusterIP: {{ . }}{{ end }} 38 | type: {{ .Values.controller.service.type }} 39 | {{- if .Values.controller.service.externalTrafficPolicy }} 40 | externalTrafficPolicy: {{ .Values.controller.service.externalTrafficPolicy }} 41 | {{- end }} 42 | {{- if .Values.controller.service.healthCheckNodePort }} 43 | healthCheckNodePort: {{ .Values.controller.service.healthCheckNodePort }} 44 | {{- end }} 45 | ports: 46 | {{- if .Values.controller.service.enablePorts.http }} 47 | - name: http 48 | port: {{ .Values.controller.service.ports.http }} 49 | protocol: TCP 50 | targetPort: {{ .Values.controller.service.targetPorts.http }} 51 | {{- if .Values.controller.service.nodePorts.http }} 52 | nodePort: {{ .Values.controller.service.nodePorts.http }} 53 | {{- end }} 54 | {{- end }} 55 | {{- if .Values.controller.service.enablePorts.https }} 56 | - name: https 57 | port: {{ .Values.controller.service.ports.https }} 58 | protocol: TCP 59 | targetPort: {{ .Values.controller.service.targetPorts.https }} 60 | {{- if .Values.controller.service.nodePorts.https }} 61 | nodePort: {{ .Values.controller.service.nodePorts.https }} 62 | {{- end }} 63 | {{- end }} 64 | {{- if .Values.controller.service.enablePorts.stat }} 65 | - name: stat 66 | port: {{ .Values.controller.service.ports.stat }} 67 | protocol: TCP 68 | targetPort: {{ .Values.controller.service.targetPorts.stat }} 69 | {{- if .Values.controller.service.nodePorts.stat }} 70 | nodePort: {{ .Values.controller.service.nodePorts.stat }} 71 | {{- end }} 72 | {{- end }} 73 | {{- range .Values.controller.service.tcpPorts }} 74 | - name: {{ .name }}-tcp 75 | port: {{ .port }} 76 | protocol: TCP 77 | targetPort: {{ .targetPort }} 78 | {{- if .nodePort }} 79 | nodePort: {{ .nodePort }} 80 | {{- end }} 81 | {{- end }} 82 | selector: 83 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 84 | app.kubernetes.io/instance: {{ .Release.Name }} 85 | {{- if .Values.controller.service.sessionAffinity }} 86 | sessionAffinity: {{ .Values.controller.service.sessionAffinity }} 87 | {{- end }} 88 | externalIPs: 89 | {{- if .Values.controller.service.externalIPs }} 90 | {{ toYaml .Values.controller.service.externalIPs | indent 4 }} 91 | {{- end -}} 92 | {{- if (eq .Values.controller.service.type "LoadBalancer") }} 93 | {{- if .Values.controller.service.loadBalancerIP }} 94 | loadBalancerIP: "{{ .Values.controller.service.loadBalancerIP }}" 95 | {{- end }} 96 | {{- if .Values.controller.service.loadBalancerSourceRanges }} 97 | loadBalancerSourceRanges: 98 | {{ toYaml .Values.controller.service.loadBalancerSourceRanges | indent 4 }} 99 | {{- end }} 100 | {{- end }} 101 | {{- end }} 102 | -------------------------------------------------------------------------------- /haproxy/templates/daemonset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2020 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if eq .Values.kind "DaemonSet" }} 18 | {{- $useHostNetwork := .Values.daemonset.useHostNetwork -}} 19 | {{- $useHostPort := .Values.daemonset.useHostPort -}} 20 | {{- $hostPorts := .Values.daemonset.hostPorts -}} 21 | apiVersion: apps/v1 22 | kind: DaemonSet 23 | metadata: 24 | name: {{ include "haproxy.fullname" . }} 25 | labels: 26 | {{- include "haproxy.labels" . | nindent 4 }} 27 | spec: 28 | minReadySeconds: 0 29 | updateStrategy: 30 | type: RollingUpdate 31 | rollingUpdate: 32 | maxUnavailable: 1 33 | selector: 34 | matchLabels: 35 | {{- include "haproxy.selectorLabels" . | nindent 6 }} 36 | template: 37 | metadata: 38 | labels: 39 | {{- include "haproxy.selectorLabels" . | nindent 8 }} 40 | {{- if .Values.podLabels }} 41 | {{ toYaml .Values.podLabels | indent 8 }} 42 | {{- end }} 43 | {{- if .Values.podAnnotations }} 44 | annotations: 45 | checksum/environment: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} 46 | {{ toYaml .Values.podAnnotations | indent 8 }} 47 | {{- end }} 48 | spec: 49 | serviceAccountName: {{ include "haproxy.serviceAccountName" . }} 50 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} 51 | {{- if $useHostNetwork }} 52 | hostNetwork: true 53 | {{- end }} 54 | securityContext: 55 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 56 | {{- if .Values.dnsConfig }} 57 | dnsConfig: 58 | {{ toYaml .Values.dnsConfig | indent 8 }} 59 | {{- end }} 60 | dnsPolicy: {{ .Values.dnsPolicy }} 61 | {{- if .Values.imageCredentials.registry }} 62 | imagePullSecrets: 63 | - name: {{ include "haproxy.fullname" . }} 64 | {{- else if .Values.existingImagePullSecret }} 65 | imagePullSecrets: 66 | - name: {{ .Values.existingImagePullSecret }} 67 | {{- end }} 68 | {{- if .Values.priorityClassName }} 69 | priorityClassName: {{ .Values.priorityClassName }} 70 | {{- end }} 71 | volumes: 72 | - name: haproxy-config 73 | configMap: 74 | name: {{ include "haproxy.fullname" . }} 75 | containers: 76 | - name: {{ .Chart.Name }} 77 | {{- if .Values.securityContext.enabled }} 78 | securityContext: 79 | runAsUser: {{ .Values.securityContext.runAsUser }} 80 | runAsGroup: {{ .Values.securityContext.runAsGroup }} 81 | capabilities: 82 | drop: 83 | - ALL 84 | add: 85 | - NET_BIND_SERVICE 86 | {{- end }} 87 | image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}" 88 | imagePullPolicy: {{ .Values.image.pullPolicy }} 89 | args: 90 | - -f 91 | - /usr/local/etc/haproxy/haproxy.cfg 92 | ports: 93 | {{- range $key, $value := .Values.containerPorts }} 94 | - name: {{ $key }} 95 | containerPort: {{ $value }} 96 | protocol: TCP 97 | {{- if $useHostPort }} 98 | hostPort: {{ index $hostPorts $key | default $value }} 99 | {{- end }} 100 | {{- end }} 101 | resources: 102 | {{- toYaml .Values.resources | nindent 12 }} 103 | volumeMounts: 104 | - name: haproxy-config 105 | mountPath: /usr/local/etc/haproxy 106 | {{- with.Values.initContainers }} 107 | initContainers: 108 | {{- toYaml . | nindent 8 }} 109 | {{- end }} 110 | {{- with .Values.nodeSelector }} 111 | nodeSelector: 112 | {{- toYaml . | nindent 8 }} 113 | {{- end }} 114 | {{- with .Values.affinity }} 115 | affinity: 116 | {{- toYaml . | nindent 8 }} 117 | {{- end }} 118 | {{- with .Values.tolerations }} 119 | tolerations: 120 | {{- toYaml . | nindent 8 }} 121 | {{- end }} 122 | {{- end }} 123 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{/* 18 | Expand the name of the chart. 19 | */}} 20 | {{- define "kubernetes-ingress.name" -}} 21 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- end -}} 23 | 24 | {{/* 25 | Create a default fully qualified app name. 26 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 27 | If release name contains chart name it will be used as a full name. 28 | */}} 29 | {{- define "kubernetes-ingress.fullname" -}} 30 | {{- if .Values.fullnameOverride -}} 31 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 32 | {{- else -}} 33 | {{- $name := default .Chart.Name .Values.nameOverride -}} 34 | {{- if contains $name .Release.Name -}} 35 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 36 | {{- else -}} 37 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 38 | {{- end -}} 39 | {{- end -}} 40 | {{- end -}} 41 | 42 | {{/* 43 | Create chart name and version as used by the chart label. 44 | */}} 45 | {{- define "kubernetes-ingress.chart" -}} 46 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 47 | {{- end -}} 48 | 49 | {{/* 50 | Encode an imagePullSecret string. 51 | */}} 52 | {{- define "kubernetes-ingress.imagePullSecret" }} 53 | {{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.controller.imageCredentials.registry (printf "%s:%s" .Values.controller.imageCredentials.username .Values.controller.imageCredentials.password | b64enc) | b64enc }} 54 | {{- end }} 55 | 56 | {{/* 57 | Generate default certificate for HAProxy. 58 | */}} 59 | {{- define "kubernetes-ingress.gen-certs" -}} 60 | {{- $ca := genCA "kubernetes-ingress-ca" 365 -}} 61 | {{- $cn := printf "%s.%s" .Release.Name .Release.Namespace -}} 62 | {{- $cert := genSignedCert $cn nil nil 365 $ca -}} 63 | tls.crt: {{ $cert.Cert | b64enc }} 64 | tls.key: {{ $cert.Key | b64enc }} 65 | {{- end -}} 66 | 67 | {{/* 68 | Create the name of the controller service account to use. 69 | */}} 70 | {{- define "kubernetes-ingress.serviceAccountName" -}} 71 | {{- if .Values.serviceAccount.create -}} 72 | {{ default (include "kubernetes-ingress.fullname" .) .Values.serviceAccount.name }} 73 | {{- else -}} 74 | {{ default "default" .Values.serviceAccount.name }} 75 | {{- end -}} 76 | {{- end -}} 77 | 78 | {{/* 79 | Create the name of the backend service account to use - only used when podsecuritypolicy is also enabled 80 | */}} 81 | {{- define "kubernetes-ingress.defaultBackend.serviceAccountName" -}} 82 | {{- if or .Values.serviceAccount.create .Values.defaultBackend.serviceAccount.create -}} 83 | {{ default (printf "%s-%s" (include "kubernetes-ingress.fullname" .) .Values.defaultBackend.name) .Values.defaultBackend.serviceAccount.name }} 84 | {{- else -}} 85 | {{ default "default" .Values.defaultBackend.serviceAccount.name }} 86 | {{- end -}} 87 | {{- end -}} 88 | 89 | {{/* 90 | Create a default fully qualified default backend name. 91 | */}} 92 | {{- define "kubernetes-ingress.defaultBackend.fullname" -}} 93 | {{- printf "%s-%s" (include "kubernetes-ingress.fullname" .) .Values.defaultBackend.name | trunc 63 | trimSuffix "-" -}} 94 | {{- end -}} 95 | 96 | {{/* 97 | Create a default fully qualified default cert secret name. 98 | */}} 99 | {{- define "kubernetes-ingress.defaultTLSSecret.fullname" -}} 100 | {{- printf "%s-%s" (include "kubernetes-ingress.fullname" .) "default-cert" | trunc 63 | trimSuffix "-" -}} 101 | {{- end -}} 102 | 103 | {{/* 104 | Construct the path for the publish-service. 105 | By default this will use the / matching the controller's service name. 106 | Users can provide an override for an explicit service they want to use via `.Values.controller.publishService.pathOverride` 107 | */}} 108 | {{- define "kubernetes-ingress.publishServicePath" -}} 109 | {{- $defServicePath := printf "%s/%s" .Release.Namespace (include "kubernetes-ingress.fullname" .) -}} 110 | {{- $servicePath := default $defServicePath .Values.controller.publishService.pathOverride }} 111 | {{- print $servicePath | trunc 63 | trimSuffix "-" -}} 112 | {{- end -}} 113 | 114 | {{/* 115 | Construct the syslog-server annotation 116 | */}} 117 | {{- define "kubernetes-ingress.syslogServer" -}} 118 | {{- range $key, $val := .Values.controller.logging.traffic -}} 119 | {{- printf "%s:%s, " $key $val }} 120 | {{- end -}} 121 | {{- end -}} 122 | 123 | {{/* 124 | Create a default fully qualified ServiceMonitor name. 125 | */}} 126 | {{- define "kubernetes-ingress.serviceMonitorName" -}} 127 | {{- default (include "kubernetes-ingress.fullname" .) .Values.controller.serviceMonitor.nameOverride | trunc 63 | trimSuffix "-" -}} 128 | {{- end -}} 129 | 130 | {{/* vim: set filetype=mustache: */}} 131 | -------------------------------------------------------------------------------- /haproxy/values.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 HAProxy Technologies LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ## Default values for HAProxy 16 | 17 | ## Configure Service Account 18 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ 19 | serviceAccount: 20 | create: true 21 | name: 22 | 23 | ## Default values for image 24 | image: 25 | repository: haproxytech/haproxy-alpine # can be changed to use CE or EE images 26 | tag: "{{ .Chart.AppVersion }}" 27 | pullPolicy: IfNotPresent 28 | 29 | ## Deployment or DaemonSet pod mode 30 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ 31 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ 32 | kind: Deployment # can be 'Deployment' or 'DaemonSet' 33 | replicaCount: 1 # used only for Deployment mode 34 | 35 | ## DaemonSet configuration 36 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ 37 | daemonset: 38 | useHostNetwork: false # also modify dnsPolicy accordingly 39 | useHostPort: false 40 | hostPorts: 41 | http: 80 42 | https: 443 43 | stat: 1024 44 | 45 | ## Init Containers 46 | ## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ 47 | initContainers: [] 48 | # - name: sysctl 49 | # image: "busybox:musl" 50 | # command: 51 | # - /bin/sh 52 | # - -c 53 | # - sysctl -w net.core.somaxconn=65536 54 | # securityContext: 55 | # privileged: true 56 | 57 | ## Pod termination grace period 58 | ## ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ 59 | terminationGracePeriodSeconds: 60 60 | 61 | ## Private Registry configuration 62 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ 63 | imageCredentials: 64 | registry: null ## EE images require setting this 65 | username: null ## EE images require setting this 66 | password: null ## EE images require setting this 67 | existingImagePullSecret: null 68 | 69 | ## Container listener port configuration 70 | ## ref: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/ 71 | containerPorts: # has to match hostPorts when useHostNetwork is true 72 | http: 80 73 | https: 443 74 | stat: 1024 75 | 76 | ## Deployment strategy definition 77 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy 78 | strategy: {} 79 | # rollingUpdate: 80 | # maxSurge: 25% 81 | # maxUnavailable: 25% 82 | # type: RollingUpdate 83 | 84 | ## Pod PriorityClass 85 | ## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass 86 | priorityClassName: "" 87 | 88 | ## HAProxy daemon configuration 89 | # ref: https://www.haproxy.org/download/2.2/doc/configuration.txt 90 | config: | 91 | global 92 | log stdout format raw local0 93 | maxconn 1024 94 | 95 | defaults 96 | log global 97 | timeout client 60s 98 | timeout connect 60s 99 | timeout server 60s 100 | 101 | frontend fe_main 102 | bind :80 103 | default_backend be_main 104 | 105 | backend be_main 106 | server web1 10.0.0.1:8080 check 107 | 108 | ## Pod Node assignment 109 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ 110 | nodeSelector: {} 111 | 112 | ## Node Taints and Tolerations for pod-node cheduling through attraction/repelling 113 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 114 | tolerations: [] 115 | # - key: "key" 116 | # operator: "Equal|Exists" 117 | # value: "value" 118 | # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" 119 | 120 | ## Node Affinity for pod-node scheduling constraints 121 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 122 | affinity: {} 123 | 124 | ## Pod DNS Config 125 | ## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ 126 | dnsConfig: {} 127 | 128 | ## Pod DNS Policy 129 | ## Change this to ClusterFirstWithHostNet in case you have useHostNetwork set to true 130 | ## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy 131 | dnsPolicy: ClusterFirst 132 | 133 | ## Additional labels to add to the pod container metadata 134 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ 135 | podLabels: {} 136 | # key: value 137 | 138 | ## Additional annotations to add to the pod container metadata 139 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ 140 | podAnnotations: {} 141 | # key: value 142 | # 143 | 144 | ## Disableable use of Pod Security Policy 145 | ## ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ 146 | podSecurityPolicy: 147 | create: true 148 | 149 | ## Pod Security Context 150 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 151 | podSecurityContext: {} 152 | 153 | ## Container Security Context 154 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 155 | securityContext: 156 | enabled: false 157 | runAsUser: 1000 158 | runAsGroup: 1000 159 | 160 | ## Compute Resources 161 | ## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 162 | resources: 163 | # limits: 164 | # cpu: 100m 165 | # memory: 64Mi 166 | requests: 167 | cpu: 100m 168 | memory: 64Mi 169 | 170 | ## Horizontal Pod Scaler 171 | ## Only to be used with Deployment kind 172 | ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ 173 | autoscaling: 174 | enabled: false 175 | minReplicas: 1 176 | maxReplicas: 7 177 | targetCPUUtilizationPercentage: 80 178 | # targetMemoryUtilizationPercentage: 80 179 | 180 | ## Pod Disruption Budget 181 | ## Only to be used with Deployment kind 182 | ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ 183 | PodDisruptionBudget: 184 | enable: false 185 | # maxUnavailable: 1 186 | # minAvailable: 1 187 | 188 | ## Service configuration 189 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 190 | service: 191 | type: ClusterIP # can be 'LoadBalancer' 192 | 193 | ## Service ClusterIP 194 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 195 | clusterIP: "" 196 | 197 | ## LoadBalancer IP 198 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer 199 | loadBalancerIP: "" 200 | 201 | ## Source IP ranges permitted to access Network Load Balancer 202 | # ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ 203 | loadBalancerSourceRanges: [] 204 | 205 | ## Service annotations 206 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ 207 | annotations: {} 208 | -------------------------------------------------------------------------------- /haproxy/README.md: -------------------------------------------------------------------------------- 1 | # ![HAProxy](https://github.com/haproxytech/kubernetes-ingress/raw/master/assets/images/haproxy-weblogo-210x49.png "HAProxy") 2 | 3 | ## HAProxy Helm Chart 4 | 5 | ## Introduction 6 | 7 | This chart bootstraps an HAProxy load balancer as deployment/daemonset on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. As oposed to [HAProxy Kubernetes Ingress Controller](https://github.com/haproxytech/helm-charts/tree/master/kubernetes-ingress) Chart, HAProxy is installed as a regular application and not as an Ingress Controller. 8 | 9 | ### Prerequisites 10 | 11 | - Kubernetes 1.12+ 12 | - Helm 2.9+ 13 | 14 | ## Before you begin 15 | 16 | ### Setup a Kubernetes Cluster 17 | 18 | The quickest way to setup a Kubernetes cluster is with [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/), [AWS Elastic Kubernetes Service](https://aws.amazon.com/eks/) or [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) using their respective quick-start guides. 19 | 20 | For setting up Kubernetes on other cloud platforms or bare-metal servers refer to the Kubernetes [getting started guide](http://kubernetes.io/docs/getting-started-guides/). 21 | 22 | ### Install Helm 23 | 24 | Get the latest [Helm release](https://github.com/helm/helm#install). 25 | 26 | ### Add Helm chart repo 27 | 28 | Once you have Helm installed, add the repo as follows: 29 | 30 | ```console 31 | helm repo add haproxytech https://haproxytech.github.io/helm-charts 32 | helm repo update 33 | ``` 34 | 35 | ## Install the chart 36 | 37 | To install the chart with Helm v3 as *my-release* deployment: 38 | 39 | ```console 40 | helm install my-release haproxytech/haproxy 41 | ``` 42 | 43 | ***NOTE***: To install the chart with Helm v2 (legacy Helm) the syntax requires adding deployment name to `--name` parameter: 44 | 45 | ```console 46 | helm install haproxytech/haproxy \ 47 | --name my-release 48 | ``` 49 | 50 | ### Installing with unique name 51 | 52 | To auto-generate resource names when installing, use the following: 53 | 54 | ```console 55 | helm install haproxytech/haproxy \ 56 | --generate-name 57 | ``` 58 | 59 | ### Installing from a private registry 60 | 61 | To install the chart using a private registry for HAProxy (for instance to use a HAPEE image) into a separate namespace *prod*. 62 | 63 | ***NOTE***: Helm v3 requires namespace to be precreated (eg. with ```kubectl create namespace prod```) 64 | 65 | ```console 66 | helm install my-haproxy haproxytech/haproxy \ 67 | --namespace prod \ 68 | --set image.tag=latest \ 69 | --set image.repository=myregistry.domain.com/imagename \ 70 | --set imageCredentials.registry=myregistry.domain.com \ 71 | --set imageCredentials.username=MYUSERNAME \ 72 | --set imageCredentials.password=MYPASSWORD 73 | ``` 74 | 75 | Alternatively, use a pre-configured (existing) imagePullSecret in the same namespace: 76 | 77 | ```console 78 | helm install my-ingress haproxytech/haproxy \ 79 | --namespace prod \ 80 | --set image.tag=SOMETAG \ 81 | --set existingImagePullSecret name-of-existing-image-pull-secret 82 | ``` 83 | 84 | ### Installing as DaemonSet 85 | 86 | Default image mode is [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), but it is possible to use [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) as well: 87 | 88 | ```console 89 | helm install my-haproxy2 haproxytech/haproxy \ 90 | --set kind=DaemonSet 91 | ``` 92 | 93 | ***NOTE***: With helm `--set` it is needed to put quotes and escape dots in the annotation key and commas in the value string. 94 | 95 | ### Installing with Horizontal Pod Autoscaler 96 | 97 | [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) automatically scales number of replicas in Deployment or Replication Controller and adjusts replica count. Therefore we want to unset default replicaCount by setting corresponding key value to null and enable autoscaling: 98 | 99 | ```console 100 | helm install my-haproxy3 haproxytech/haproxy \ 101 | --set kind=Deployment \ 102 | --set replicaCount=null \ 103 | --set autoscaling.enabled=true \ 104 | --set autoscaling.targetCPUUtilizationPercentage=80 105 | ``` 106 | 107 | ***NOTE***: Make sure to look into other tunable values for HPA documented in [values.yaml](values.yaml). 108 | 109 | ### Installing with service annotations 110 | 111 | On some environments like EKS and GKE there might be a need to pass service annotations. Syntax can become a little tedious however: 112 | 113 | ```console 114 | helm install my-haproxy4 haproxytech/haproxy \ 115 | --set kind=DaemonSet \ 116 | --set service.type=LoadBalancer \ 117 | --set service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-internal"="0.0.0.0/0" \ 118 | --set service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-cross-zone-load-balancing-enabled"="true" 119 | ``` 120 | 121 | ***NOTE***: With helm `--set` it is needed to put quotes and escape dots in the annotation key and commas in the value string. 122 | 123 | ### Using values from YAML file 124 | 125 | As opposed to using many `--set` invocations, much simpler approach is to define value overrides in a separate YAML file and specify them when invoking Helm: 126 | 127 | *mylb.yaml*: 128 | 129 | ```yaml 130 | kind: DaemonSet 131 | config: | 132 | global 133 | log stdout format raw local0 134 | daemon 135 | maxconn 1024 136 | defaults 137 | log global 138 | timeout client 60s 139 | timeout connect 60s 140 | timeout server 60s 141 | frontend fe_main 142 | bind :80 143 | default_backend be_main 144 | backend be_main 145 | server web1 10.0.0.1:8080 check 146 | service: 147 | type: LoadBalancer 148 | annotations: 149 | service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true' 150 | service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 151 | ``` 152 | 153 | And invoking Helm becomes (compare to the previous example): 154 | 155 | ```console 156 | helm install my-haproxy5 -f mylb.yml haproxytech/haproxy 157 | ``` 158 | 159 | ## Installing as non-root with binding to privileged ports 160 | 161 | To be able to bind to privileged ports such as tcp/80 and tcp/443 without root privileges (UID and GID are set to 1000 in the example, as HAProxy Docker image has UID/GID of 1000 reserved for HAProxy), there is a special workaround required as `NET_BIND_SERVICE` capability is [not propagated](https://github.com/kubernetes/kubernetes/issues/56374), so we need to use `initContainers` feature as well: 162 | 163 | ```yaml 164 | kind: DaemonSet 165 | containerPorts: 166 | http: 80 167 | https: 443 168 | stat: 1024 169 | daemonset: 170 | useHostNetwork: true 171 | useHostPort: true 172 | hostPorts: 173 | http: 80 174 | https: 443 175 | stat: 1024 176 | config: | 177 | global 178 | log stdout format raw local0 179 | maxconn 1024 180 | defaults 181 | log global 182 | timeout client 60s 183 | timeout connect 60s 184 | timeout server 60s 185 | frontend fe_main 186 | bind :80 187 | default_backend be_main 188 | backend be_main 189 | server web1 127.0.0.1:8080 check 190 | securityContext: 191 | enabled: true 192 | runAsUser: 1000 193 | runAsGroup: 1000 194 | initContainers: 195 | - name: sysctl 196 | image: "busybox:musl" 197 | command: 198 | - /bin/sh 199 | - -c 200 | - sysctl -w net.ipv4.ip_unprivileged_port_start=0 201 | securityContext: 202 | privileged: true 203 | ``` 204 | 205 | ## Upgrading the chart 206 | 207 | To upgrade the *my-release* deployment: 208 | 209 | ```console 210 | helm upgrade my-release haproxytech/haproxy 211 | ``` 212 | 213 | ## Uninstalling the chart 214 | 215 | To uninstall/delete the *my-release* deployment: 216 | 217 | ```console 218 | helm delete my-release 219 | ``` 220 | 221 | ## Debugging 222 | 223 | It is possible to generate a set of YAML files for testing/debugging: 224 | 225 | ```console 226 | helm install my-release haproxytech/haproxy \ 227 | --debug \ 228 | --dry-run 229 | ``` 230 | 231 | ## Contributing 232 | 233 | We welcome all contributions. Please refer to [guidelines](../CONTRIBUTING.md) on how to make a contribution. 234 | -------------------------------------------------------------------------------- /kubernetes-ingress/README.md: -------------------------------------------------------------------------------- 1 | # ![HAProxy](https://github.com/haproxytech/kubernetes-ingress/raw/master/assets/images/haproxy-weblogo-210x49.png "HAProxy") 2 | 3 | ## HAProxy Kubernetes Ingress Controller 4 | 5 | An ingress controller is a Kubernetes resource that routes traffic from outside your cluster to services within the cluster. HAProxy Kubernetes Ingress Controller uses ConfigMap to store the haproxy configuration. 6 | 7 | Detailed documentation can be found within the [Official Documentation](https://www.haproxy.com/documentation/kubernetes/latest/). 8 | 9 | Additional configuration details can be found in [annotation reference](https://github.com/haproxytech/kubernetes-ingress/tree/master/documentation) and in image [arguments reference](https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/controller.md). 10 | 11 | ## Introduction 12 | 13 | This chart bootstraps an HAProxy kubernetes-ingress deployment/daemonset on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. 14 | 15 | ### Prerequisites 16 | 17 | - Kubernetes 1.12+ 18 | - Helm 2.9+ 19 | 20 | ## Before you begin 21 | 22 | ### Setup a Kubernetes Cluster 23 | 24 | The quickest way to setup a Kubernetes cluster is with [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/), [AWS Elastic Kubernetes Service](https://aws.amazon.com/eks/) or [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) using their respective quick-start guides. 25 | 26 | For setting up Kubernetes on other cloud platforms or bare-metal servers refer to the Kubernetes [getting started guide](http://kubernetes.io/docs/getting-started-guides/). 27 | 28 | ### Install Helm 29 | 30 | Get the latest [Helm release](https://github.com/helm/helm#install). 31 | 32 | ### Add Helm chart repo 33 | 34 | Once you have Helm installed, add the repo as follows: 35 | 36 | ```console 37 | helm repo add haproxytech https://haproxytech.github.io/helm-charts 38 | helm repo update 39 | ``` 40 | 41 | ## Install the chart 42 | 43 | To install the chart with Helm v3 as _my-release_ deployment: 44 | 45 | ```console 46 | helm install my-release haproxytech/kubernetes-ingress 47 | ``` 48 | 49 | **_NOTE_**: To install the chart with Helm v2 (legacy Helm) the syntax requires adding deployment name to `--name` parameter: 50 | 51 | ```console 52 | helm install haproxytech/kubernetes-ingress \ 53 | --name my-release 54 | ``` 55 | 56 | ### Installing with unique name 57 | 58 | To auto-generate controller and its resources names when installing, use the following: 59 | 60 | ```console 61 | helm install haproxytech/kubernetes-ingress \ 62 | --generate-name 63 | ``` 64 | 65 | ### Installing from a private registry 66 | 67 | To install the chart using a private registry for controller into a separate namespace _prod_. 68 | 69 | **_NOTE_**: Helm v3 requires namespace to be precreated (eg. with `kubectl create namespace prod`) 70 | 71 | ```console 72 | helm install my-ingress haproxytech/kubernetes-ingress \ 73 | --namespace prod \ 74 | --set controller.image.tag=SOMETAG \ 75 | --set controller.imageCredentials.registry=myregistry.domain.com \ 76 | --set controller.imageCredentials.username=MYUSERNAME \ 77 | --set controller.imageCredentials.password=MYPASSWORD 78 | ``` 79 | 80 | Alternatively, use a pre-configured (existing) imagePullSecret in the same namespace: 81 | 82 | ```console 83 | helm install my-ingress haproxytech/kubernetes-ingress \ 84 | --namespace prod \ 85 | --set controller.image.tag=SOMETAG \ 86 | --set controller.existingImagePullSecret name-of-existing-image-pull-secret 87 | ``` 88 | 89 | ### Installing as DaemonSet 90 | 91 | Default controller mode is [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), but it is possible to use [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) as well: 92 | 93 | ```console 94 | helm install my-ingress2 haproxytech/kubernetes-ingress \ 95 | --set controller.kind=DaemonSet 96 | ``` 97 | 98 | ### Installing in multi-ingress environment 99 | 100 | It is also possible to set controller ingress class to be used in [multi-ingress environments](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#using-multiple-ingress-controllers): 101 | 102 | ```console 103 | helm install my-ingress3 haproxytech/kubernetes-ingress \ 104 | --set controller.kind=DaemonSet \ 105 | --set controller.ingressClass=haproxy 106 | ``` 107 | 108 | **_NOTE_**: make sure your Ingress routes have corresponding `ingress.class: haproxy` annotation. 109 | 110 | ### Installing with service annotations 111 | 112 | On some environments like EKS and GKE there might be a need to pass service annotations. Syntax can become a little tedious however: 113 | 114 | ```console 115 | helm install my-ingress3 haproxytech/kubernetes-ingress \ 116 | --set controller.kind=DaemonSet \ 117 | --set controller.ingressClass=haproxy \ 118 | --set controller.service.type=LoadBalancer \ 119 | --set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-internal"="0.0.0.0/0" \ 120 | --set controller.service.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-cross-zone-load-balancing-enabled"="true" 121 | ``` 122 | 123 | **_NOTE_**: With helm `--set` it is needed to put quotes and escape dots in the annotation key and commas in the value string. 124 | 125 | ### Installing with Horizontal Pod Autoscaler 126 | 127 | [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) automatically scales number of replicas in Deployment or Replication Controller and adjusts replica count. Therefore we want to unset default replicaCount for controller and defaultBackend by setting corresponding key values to null: 128 | 129 | ```console 130 | helm install my-ingress4 haproxytech/kubernetes-ingress \ 131 | --set controller.replicaCount=null \ 132 | --set defaultBackend.replicaCount=null 133 | ``` 134 | 135 | ### Installing the ServiceMonitor 136 | 137 | If you're using the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator), you can automatically install the `ServiceMonitor` definition in order to automate the scraping options according to your needs. 138 | 139 | ```console 140 | helm install my-ingress5 haproxytech/kubernetes-ingress \ 141 | --set "controller.serviceMonitor.enabled=true" 142 | ``` 143 | 144 | ### Using values from YAML file 145 | 146 | As opposed to using many `--set` invocations, much simpler approach is to define value overrides in a separate YAML file and specify them when invoking Helm: 147 | 148 | _mylb.yaml_: 149 | 150 | ```yaml 151 | controller: 152 | kind: DaemonSet 153 | ingressClass: haproxy 154 | service: 155 | type: LoadBalancer 156 | annotations: 157 | service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true" 158 | service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 159 | ``` 160 | 161 | And invoking Helm becomes (compare to the previous example): 162 | 163 | ```console 164 | helm install my-ingress4 -f mylb.yml haproxytech/kubernetes-ingress 165 | ``` 166 | 167 | A typical YAML file for TCP services looks like (provided that configmap "[default/tcp](https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/controller.md)" was created) : 168 | 169 | ```yaml 170 | controller: 171 | service: 172 | tcpPorts: 173 | - name: mysql 174 | port: 3306 175 | targetPort: 3306 176 | extraArgs: 177 | - --configmap-tcp-services=default/tcp 178 | ``` 179 | 180 | ## Upgrading the chart 181 | 182 | To upgrade the _my-release_ deployment: 183 | 184 | ```console 185 | helm upgrade my-release haproxytech/kubernetes-ingress 186 | ``` 187 | 188 | ## Uninstalling the chart 189 | 190 | To uninstall/delete the _my-release_ deployment: 191 | 192 | ```console 193 | helm delete my-release 194 | ``` 195 | 196 | ## Debugging 197 | 198 | It is possible to generate a set of YAML files for testing/debugging: 199 | 200 | ```console 201 | helm install my-release haproxytech/kubernetes-ingress \ 202 | --debug \ 203 | --dry-run 204 | ``` 205 | 206 | ## Contributing 207 | 208 | We welcome all contributions. Please refer to [guidelines](../CONTRIBUTING.md) on how to make a contribution. 209 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if eq .Values.controller.kind "Deployment" }} 18 | apiVersion: apps/v1 19 | kind: Deployment 20 | metadata: 21 | name: {{ template "kubernetes-ingress.fullname" . }} 22 | namespace: {{ .Release.Namespace }} 23 | labels: 24 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 25 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 26 | app.kubernetes.io/managed-by: {{ .Release.Service }} 27 | app.kubernetes.io/instance: {{ .Release.Name }} 28 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 29 | {{- if .Values.controller.extraLabels }} 30 | {{ toYaml .Values.controller.extraLabels | indent 4 }} 31 | {{- end }} 32 | spec: 33 | {{- if not .Values.controller.autoscaling.enabled }} 34 | replicas: {{ .Values.controller.replicaCount }} 35 | {{- end }} 36 | selector: 37 | matchLabels: 38 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 39 | app.kubernetes.io/instance: {{ .Release.Name }} 40 | {{- with .Values.controller.strategy }} 41 | strategy: 42 | {{- toYaml . | nindent 4 }} 43 | {{- end }} 44 | template: 45 | metadata: 46 | labels: 47 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 48 | app.kubernetes.io/instance: {{ .Release.Name }} 49 | {{- if .Values.controller.podLabels }} 50 | {{ toYaml .Values.controller.podLabels | indent 8 }} 51 | {{- end }} 52 | {{- if .Values.controller.podAnnotations }} 53 | annotations: 54 | {{ toYaml .Values.controller.podAnnotations | indent 8 }} 55 | {{- end }} 56 | spec: 57 | serviceAccountName: {{ template "kubernetes-ingress.serviceAccountName" . }} 58 | terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }} 59 | {{- with .Values.controller.topologySpreadConstraints }} 60 | topologySpreadConstraints: 61 | {{- toYaml . | nindent 8 }} 62 | {{- end }} 63 | {{- if .Values.controller.dnsConfig }} 64 | dnsConfig: 65 | {{ toYaml .Values.controller.dnsConfig | indent 8 }} 66 | {{- end }} 67 | dnsPolicy: {{ .Values.controller.dnsPolicy }} 68 | {{- if .Values.controller.imageCredentials.registry }} 69 | imagePullSecrets: 70 | - name: {{ template "kubernetes-ingress.fullname" . }} 71 | {{- else if .Values.controller.existingImagePullSecret }} 72 | imagePullSecrets: 73 | - name: {{ .Values.controller.existingImagePullSecret }} 74 | {{- end }} 75 | {{- if .Values.controller.priorityClassName }} 76 | priorityClassName: {{ .Values.controller.priorityClassName }} 77 | {{- end }} 78 | containers: 79 | - name: {{ template "kubernetes-ingress.name" . }}-{{ .Values.controller.name }} 80 | image: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}" 81 | imagePullPolicy: {{ .Values.controller.image.pullPolicy }} 82 | args: 83 | {{- if .Values.controller.defaultTLSSecret.enabled -}} 84 | {{- if and .Values.controller.defaultTLSSecret.secret .Values.controller.defaultTLSSecret.secretNamespace }} 85 | - --default-ssl-certificate={{ .Values.controller.defaultTLSSecret.secretNamespace }}/{{ .Values.controller.defaultTLSSecret.secret }} 86 | {{- else }} 87 | - --default-ssl-certificate={{ .Release.Namespace }}/{{ template "kubernetes-ingress.defaultTLSSecret.fullname" . }} 88 | {{- end }} 89 | {{- end }} 90 | - --configmap={{ .Release.Namespace }}/{{ template "kubernetes-ingress.fullname" . }} 91 | {{- if .Values.defaultBackend.enabled }} 92 | - --default-backend-service={{ .Release.Namespace }}/{{ template "kubernetes-ingress.defaultBackend.fullname" . }} 93 | {{- end }} 94 | {{- if .Values.controller.ingressClass }} 95 | - --ingress.class={{ .Values.controller.ingressClass }} 96 | {{- end }} 97 | {{- if .Values.controller.publishService.enabled }} 98 | - --publish-service={{ template "kubernetes-ingress.publishServicePath" . }} 99 | {{- end }} 100 | {{- if .Values.controller.logging.level }} 101 | - --log={{ .Values.controller.logging.level }} 102 | {{- end }} 103 | {{- range .Values.controller.extraArgs }} 104 | - {{ . }} 105 | {{- end }} 106 | {{- if .Values.controller.unprivileged }} 107 | securityContext: 108 | runAsUser: 1000 109 | runAsGroup: 1000 110 | capabilities: 111 | drop: 112 | - ALL 113 | add: 114 | - NET_BIND_SERVICE 115 | {{- end }} 116 | ports: 117 | {{- range $key, $value := .Values.controller.containerPort }} 118 | - name: {{ $key }} 119 | containerPort: {{ $value }} 120 | protocol: TCP 121 | {{- end }} 122 | {{- range .Values.controller.service.tcpPorts }} 123 | - name: {{ .name }}-tcp 124 | containerPort: {{ .targetPort }} 125 | protocol: TCP 126 | {{- end }} 127 | {{- if .Values.controller.livenessProbe.enabled }} 128 | livenessProbe: 129 | failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }} 130 | httpGet: 131 | path: {{ .Values.controller.livenessProbe.path }} 132 | port: {{ .Values.controller.livenessProbe.port }} 133 | scheme: {{ .Values.controller.livenessProbe.scheme }} 134 | initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }} 135 | periodSeconds: {{ .Values.controller.livenessProbe.periodSeconds }} 136 | successThreshold: {{ .Values.controller.livenessProbe.successThreshold }} 137 | timeoutSeconds: {{ .Values.controller.livenessProbe.timeoutSeconds }} 138 | {{- end }} 139 | {{- if .Values.controller.readinessProbe.enabled }} 140 | readinessProbe: 141 | failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} 142 | httpGet: 143 | path: {{ .Values.controller.readinessProbe.path }} 144 | port: {{ .Values.controller.readinessProbe.port }} 145 | scheme: {{ .Values.controller.readinessProbe.scheme }} 146 | initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} 147 | periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }} 148 | successThreshold: {{ .Values.controller.readinessProbe.successThreshold }} 149 | timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }} 150 | {{- end }} 151 | {{- if .Values.controller.startupProbe.enabled }} 152 | startupProbe: 153 | failureThreshold: {{ .Values.controller.startupProbe.failureThreshold }} 154 | httpGet: 155 | path: {{ .Values.controller.startupProbe.path }} 156 | port: {{ .Values.controller.startupProbe.port }} 157 | scheme: {{ .Values.controller.startupProbe.scheme }} 158 | initialDelaySeconds: {{ .Values.controller.startupProbe.initialDelaySeconds }} 159 | periodSeconds: {{ .Values.controller.startupProbe.periodSeconds }} 160 | successThreshold: {{ .Values.controller.startupProbe.successThreshold }} 161 | timeoutSeconds: {{ .Values.controller.startupProbe.timeoutSeconds }} 162 | {{- end }} 163 | env: 164 | - name: POD_NAME 165 | valueFrom: 166 | fieldRef: 167 | fieldPath: metadata.name 168 | - name: POD_NAMESPACE 169 | valueFrom: 170 | fieldRef: 171 | fieldPath: metadata.namespace 172 | {{- range .Values.controller.extraEnvs }} 173 | - name: {{ .name }} 174 | value: {{ .value }} 175 | {{- end }} 176 | resources: 177 | {{- toYaml .Values.controller.resources | nindent 12 }} 178 | {{- if .Values.controller.lifecycle }} 179 | lifecycle: 180 | {{- if eq "string" (printf "%T" .Values.controller.lifecycle) }} 181 | {{ tpl .Values.controller.lifecycle . | indent 12 }} 182 | {{- else }} 183 | {{ toYaml .Values.controller.lifecycle | indent 12 }} 184 | {{- end }} 185 | {{- end }} 186 | {{- if .Values.controller.extraVolumeMounts }} 187 | volumeMounts: 188 | {{- if eq "string" (printf "%T" .Values.controller.extraVolumeMounts) }} 189 | {{ tpl .Values.controller.extraVolumeMounts . | indent 12 }} 190 | {{- else }} 191 | {{ toYaml .Values.controller.extraVolumeMounts | indent 12 }} 192 | {{- end }} 193 | {{- end}} 194 | {{- if .Values.controller.extraContainers }} 195 | {{- if eq "string" (printf "%T" .Values.controller.extraContainers) }} 196 | {{ tpl .Values.controller.extraContainers . | indent 8 }} 197 | {{- else }} 198 | {{ toYaml .Values.controller.extraContainers | indent 8 }} 199 | {{- end }} 200 | {{- end }} 201 | {{- if .Values.controller.extraVolumes }} 202 | volumes: 203 | {{- if eq "string" (printf "%T" .Values.controller.extraVolumes) }} 204 | {{ tpl .Values.controller.extraVolumes . | indent 8 }} 205 | {{- else }} 206 | {{ toYaml .Values.controller.extraVolumes | indent 8 }} 207 | {{- end }} 208 | {{- end }} 209 | {{- if or .Values.controller.unprivileged .Values.controller.initContainers }} 210 | initContainers: 211 | {{- if .Values.controller.unprivileged }} 212 | - name: sysctl 213 | image: busybox:musl 214 | command: 215 | - /bin/sh 216 | - -c 217 | - sysctl -w net.ipv4.ip_unprivileged_port_start=0 218 | securityContext: 219 | privileged: true 220 | {{- end }} 221 | {{- with.Values.controller.initContainers }} 222 | {{- toYaml . | nindent 8 }} 223 | {{- end }} 224 | {{- end }} 225 | {{- with .Values.controller.nodeSelector }} 226 | nodeSelector: 227 | {{- toYaml . | nindent 8 }} 228 | {{- end }} 229 | {{- with .Values.controller.affinity }} 230 | affinity: 231 | {{- toYaml . | nindent 8 }} 232 | {{- end }} 233 | {{- with .Values.controller.tolerations }} 234 | tolerations: 235 | {{- toYaml . | nindent 8 }} 236 | {{- end }} 237 | {{- end }} 238 | -------------------------------------------------------------------------------- /kubernetes-ingress/templates/controller-daemonset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright 2019 HAProxy Technologies LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */}} 16 | 17 | {{- if eq .Values.controller.kind "DaemonSet" }} 18 | {{- $useHostNetwork := .Values.controller.daemonset.useHostNetwork -}} 19 | {{- $useHostPort := .Values.controller.daemonset.useHostPort -}} 20 | {{- $hostPorts := .Values.controller.daemonset.hostPorts -}} 21 | apiVersion: apps/v1 22 | kind: DaemonSet 23 | metadata: 24 | name: {{ template "kubernetes-ingress.fullname" . }} 25 | namespace: {{ .Release.Namespace }} 26 | labels: 27 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 28 | helm.sh/chart: {{ template "kubernetes-ingress.chart" . }} 29 | app.kubernetes.io/managed-by: {{ .Release.Service }} 30 | app.kubernetes.io/instance: {{ .Release.Name }} 31 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 32 | {{- if .Values.controller.extraLabels }} 33 | {{ toYaml .Values.controller.extraLabels | indent 4 }} 34 | {{- end }} 35 | spec: 36 | minReadySeconds: 0 37 | updateStrategy: 38 | type: RollingUpdate 39 | rollingUpdate: 40 | maxUnavailable: 1 41 | selector: 42 | matchLabels: 43 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 44 | app.kubernetes.io/instance: {{ .Release.Name }} 45 | template: 46 | metadata: 47 | labels: 48 | app.kubernetes.io/name: {{ template "kubernetes-ingress.name" . }} 49 | app.kubernetes.io/instance: {{ .Release.Name }} 50 | {{- if .Values.controller.podLabels }} 51 | {{ toYaml .Values.controller.podLabels | indent 8 }} 52 | {{- end }} 53 | {{- if .Values.controller.podAnnotations }} 54 | annotations: 55 | {{ toYaml .Values.controller.podAnnotations | indent 8 }} 56 | {{- end }} 57 | spec: 58 | serviceAccountName: {{ template "kubernetes-ingress.serviceAccountName" . }} 59 | terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }} 60 | {{- if $useHostNetwork }} 61 | hostNetwork: true 62 | {{- end }} 63 | {{- if .Values.controller.dnsConfig }} 64 | dnsConfig: 65 | {{ toYaml .Values.controller.dnsConfig | indent 8 }} 66 | {{- end }} 67 | dnsPolicy: {{ .Values.controller.dnsPolicy }} 68 | {{- if .Values.controller.imageCredentials.registry }} 69 | imagePullSecrets: 70 | - name: {{ template "kubernetes-ingress.fullname" . }} 71 | {{- else if .Values.controller.existingImagePullSecret }} 72 | imagePullSecrets: 73 | - name: {{ .Values.controller.existingImagePullSecret }} 74 | {{- end }} 75 | {{- if .Values.controller.priorityClassName }} 76 | priorityClassName: {{ .Values.controller.priorityClassName }} 77 | {{- end }} 78 | containers: 79 | - name: {{ template "kubernetes-ingress.name" . }}-{{ .Values.controller.name }} 80 | image: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}" 81 | imagePullPolicy: {{ .Values.controller.image.pullPolicy }} 82 | args: 83 | {{- if .Values.controller.defaultTLSSecret.enabled -}} 84 | {{- if and .Values.controller.defaultTLSSecret.secret .Values.controller.defaultTLSSecret.secretNamespace }} 85 | - --default-ssl-certificate={{ .Values.controller.defaultTLSSecret.secretNamespace }}/{{ .Values.controller.defaultTLSSecret.secret }} 86 | {{- else }} 87 | - --default-ssl-certificate={{ .Release.Namespace }}/{{ template "kubernetes-ingress.defaultTLSSecret.fullname" . }} 88 | {{- end }} 89 | {{- end }} 90 | - --configmap={{ .Release.Namespace }}/{{ template "kubernetes-ingress.fullname" . }} 91 | {{- if .Values.defaultBackend.enabled }} 92 | - --default-backend-service={{ .Release.Namespace }}/{{ template "kubernetes-ingress.defaultBackend.fullname" . }} 93 | {{- end }} 94 | {{- if .Values.controller.ingressClass }} 95 | - --ingress.class={{ .Values.controller.ingressClass }} 96 | {{- end }} 97 | {{- if .Values.controller.publishService.enabled }} 98 | - --publish-service={{ template "kubernetes-ingress.publishServicePath" . }} 99 | {{- end }} 100 | {{- if .Values.controller.logging.level }} 101 | - --log={{ .Values.controller.logging.level }} 102 | {{- end }} 103 | {{- range .Values.controller.extraArgs }} 104 | - {{ . }} 105 | {{- end }} 106 | {{- if .Values.controller.unprivileged }} 107 | securityContext: 108 | runAsUser: 1000 109 | runAsGroup: 1000 110 | capabilities: 111 | drop: 112 | - ALL 113 | add: 114 | - NET_BIND_SERVICE 115 | {{- end }} 116 | ports: 117 | {{- range $key, $value := .Values.controller.containerPort }} 118 | - name: {{ $key }} 119 | containerPort: {{ $value }} 120 | protocol: TCP 121 | {{- if $useHostPort }} 122 | hostPort: {{ index $hostPorts $key | default $value }} 123 | {{- end }} 124 | {{- end }} 125 | {{- range .Values.controller.service.tcpPorts }} 126 | - name: {{ .name }}-tcp 127 | containerPort: {{ .port }} 128 | protocol: TCP 129 | {{- if $useHostPort }} 130 | hostPort: {{ .port }} 131 | {{- end }} 132 | {{- end }} 133 | {{- if .Values.controller.livenessProbe.enabled }} 134 | livenessProbe: 135 | failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }} 136 | httpGet: 137 | path: {{ .Values.controller.livenessProbe.path }} 138 | port: {{ .Values.controller.livenessProbe.port }} 139 | scheme: {{ .Values.controller.livenessProbe.scheme }} 140 | initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }} 141 | periodSeconds: {{ .Values.controller.livenessProbe.periodSeconds }} 142 | successThreshold: {{ .Values.controller.livenessProbe.successThreshold }} 143 | timeoutSeconds: {{ .Values.controller.livenessProbe.timeoutSeconds }} 144 | {{- end }} 145 | {{- if .Values.controller.readinessProbe.enabled }} 146 | readinessProbe: 147 | failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} 148 | httpGet: 149 | path: {{ .Values.controller.readinessProbe.path }} 150 | port: {{ .Values.controller.readinessProbe.port }} 151 | scheme: {{ .Values.controller.readinessProbe.scheme }} 152 | initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} 153 | periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }} 154 | successThreshold: {{ .Values.controller.readinessProbe.successThreshold }} 155 | timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }} 156 | {{- end }} 157 | {{- if .Values.controller.startupProbe.enabled }} 158 | startupProbe: 159 | failureThreshold: {{ .Values.controller.startupProbe.failureThreshold }} 160 | httpGet: 161 | path: {{ .Values.controller.startupProbe.path }} 162 | port: {{ .Values.controller.startupProbe.port }} 163 | scheme: {{ .Values.controller.startupProbe.scheme }} 164 | initialDelaySeconds: {{ .Values.controller.startupProbe.initialDelaySeconds }} 165 | periodSeconds: {{ .Values.controller.startupProbe.periodSeconds }} 166 | successThreshold: {{ .Values.controller.startupProbe.successThreshold }} 167 | timeoutSeconds: {{ .Values.controller.startupProbe.timeoutSeconds }} 168 | {{- end }} 169 | env: 170 | - name: POD_NAME 171 | valueFrom: 172 | fieldRef: 173 | fieldPath: metadata.name 174 | - name: POD_NAMESPACE 175 | valueFrom: 176 | fieldRef: 177 | fieldPath: metadata.namespace 178 | {{- range .Values.controller.extraEnvs }} 179 | - name: "{{ .name }}" 180 | value: "{{ .value }}" 181 | {{- end }} 182 | resources: 183 | {{- toYaml .Values.controller.resources | nindent 12 }} 184 | {{- if .Values.controller.lifecycle }} 185 | lifecycle: 186 | {{- if eq "string" (printf "%T" .Values.controller.lifecycle) }} 187 | {{ tpl .Values.controller.lifecycle . | indent 12 }} 188 | {{- else }} 189 | {{ toYaml .Values.controller.lifecycle | indent 12 }} 190 | {{- end }} 191 | {{- end }} 192 | {{- if .Values.controller.extraVolumeMounts }} 193 | volumeMounts: 194 | {{- if eq "string" (printf "%T" .Values.controller.extraVolumeMounts) }} 195 | {{ tpl .Values.controller.extraVolumeMounts . | indent 12 }} 196 | {{- else }} 197 | {{ toYaml .Values.controller.extraVolumeMounts | indent 12 }} 198 | {{- end }} 199 | {{- end}} 200 | {{- if .Values.controller.extraContainers }} 201 | {{- if eq "string" (printf "%T" .Values.controller.extraContainers) }} 202 | {{ tpl .Values.controller.extraContainers . | indent 8 }} 203 | {{- else }} 204 | {{ toYaml .Values.controller.extraContainers | indent 8 }} 205 | {{- end }} 206 | {{- end }} 207 | {{- if .Values.controller.extraVolumes }} 208 | volumes: 209 | {{- if eq "string" (printf "%T" .Values.controller.extraVolumes) }} 210 | {{ tpl .Values.controller.extraVolumes . | indent 8 }} 211 | {{- else }} 212 | {{ toYaml .Values.controller.extraVolumes | indent 8 }} 213 | {{- end }} 214 | {{- end }} 215 | {{- if or .Values.controller.unprivileged .Values.controller.initContainers }} 216 | initContainers: 217 | {{- if .Values.controller.unprivileged }} 218 | - name: sysctl 219 | image: busybox:musl 220 | command: 221 | - /bin/sh 222 | - -c 223 | - sysctl -w net.ipv4.ip_unprivileged_port_start=0 224 | securityContext: 225 | privileged: true 226 | {{- end }} 227 | {{- with.Values.controller.initContainers }} 228 | {{- toYaml . | nindent 8 }} 229 | {{- end }} 230 | {{- end }} 231 | {{- with .Values.controller.nodeSelector }} 232 | nodeSelector: 233 | {{- toYaml . | nindent 8 }} 234 | {{- end }} 235 | {{- with .Values.controller.affinity }} 236 | affinity: 237 | {{- toYaml . | nindent 8 }} 238 | {{- end }} 239 | {{- with .Values.controller.tolerations }} 240 | tolerations: 241 | {{- toYaml . | nindent 8 }} 242 | {{- end }} 243 | {{- end }} 244 | -------------------------------------------------------------------------------- /kubernetes-ingress/values.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 HAProxy Technologies LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ## Default values for kubernetes-ingress Chart for HAProxy Ingress Controller 16 | ## ref: https://github.com/haproxytech/kubernetes-ingress/tree/master/documentation 17 | 18 | podSecurityPolicy: 19 | annotations: {} 20 | ## Specify pod annotations 21 | ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor 22 | ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp 23 | ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl 24 | ## 25 | # apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default 26 | # apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default 27 | # seccomp.security.alpha.kubernetes.io/allowedProfileNames: runtime/default 28 | # seccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default 29 | enabled: false 30 | 31 | ## Enable RBAC Authorization 32 | ## ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ 33 | rbac: 34 | create: true 35 | 36 | 37 | ## Configure Service Account 38 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ 39 | serviceAccount: 40 | create: true 41 | name: 42 | 43 | 44 | ## Controller default values 45 | controller: 46 | name: controller 47 | image: 48 | repository: haproxytech/kubernetes-ingress # can be changed to use CE or EE Controller images 49 | tag: "{{ .Chart.AppVersion }}" 50 | pullPolicy: IfNotPresent 51 | 52 | ## Deployment or DaemonSet pod mode 53 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ 54 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ 55 | kind: Deployment # can be 'Deployment' or 'DaemonSet' 56 | replicaCount: 2 57 | 58 | ## Running container without root privileges 59 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 60 | unprivileged: false 61 | 62 | ## Init Containers 63 | ## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ 64 | initContainers: [] 65 | # - name: sysctl 66 | # image: "busybox:musl" 67 | # command: 68 | # - /bin/sh 69 | # - -c 70 | # - sysctl -w net.core.somaxconn=65536 71 | # securityContext: 72 | # privileged: true 73 | 74 | ## Pod termination grace period 75 | ## ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ 76 | terminationGracePeriodSeconds: 60 77 | 78 | ## Private Registry configuration 79 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ 80 | imageCredentials: 81 | registry: null 82 | username: null 83 | password: null 84 | existingImagePullSecret: null 85 | 86 | ## Controller Container listener port configuration 87 | ## ref: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/ 88 | containerPort: 89 | http: 80 90 | https: 443 91 | stat: 1024 92 | 93 | ## Controller Container liveness/readiness probe configuration 94 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ 95 | livenessProbe: 96 | enabled: true 97 | failureThreshold: 3 98 | initialDelaySeconds: 0 99 | path: /healthz 100 | periodSeconds: 10 101 | port: 1042 102 | scheme: HTTP 103 | successThreshold: 1 104 | timeoutSeconds: 1 105 | 106 | readinessProbe: 107 | enabled: true 108 | failureThreshold: 3 109 | initialDelaySeconds: 0 110 | path: /healthz 111 | periodSeconds: 10 112 | port: 1042 113 | scheme: HTTP 114 | successThreshold: 1 115 | timeoutSeconds: 1 116 | 117 | startupProbe: 118 | enabled: true 119 | failureThreshold: 20 120 | initialDelaySeconds: 0 121 | path: /healthz 122 | periodSeconds: 1 123 | port: 1042 124 | scheme: HTTP 125 | successThreshold: 1 126 | timeoutSeconds: 1 127 | 128 | ## Ingress Class used for ingress.class annotation in multi-ingress environments 129 | ## ref: https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#using-multiple-ingress-controllers 130 | ingressClass: null # typically "haproxy" or null to receive all events 131 | 132 | ## Additional labels to add to the deployment or daemonset metadata 133 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ 134 | extraLabels: {} 135 | # key: value 136 | 137 | ## Additional labels to add to the pod container metadata 138 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ 139 | podLabels: {} 140 | # key: value 141 | 142 | ## Additional annotations to add to the pod container metadata 143 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ 144 | podAnnotations: {} 145 | # key: value 146 | 147 | ## Ingress TLS secret, if it is enabled and secret is null then controller will use auto-generated secret, otherwise 148 | ## secret needs to contain name of the Secret object which has been created manually 149 | ## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls 150 | ## ref: https://kubernetes.io/docs/concepts/configuration/secret/ 151 | defaultTLSSecret: 152 | enabled: true 153 | secretNamespace: "{{ .Release.Namespace }}" 154 | secret: null 155 | 156 | ## Compute Resources for controller container 157 | ## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 158 | resources: 159 | # limits: 160 | # cpu: 100m 161 | # memory: 64Mi 162 | requests: 163 | cpu: 100m 164 | memory: 64Mi 165 | 166 | ## Horizontal Pod Scaler 167 | ## Only to be used with Deployment kind 168 | ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ 169 | autoscaling: 170 | enabled: false 171 | minReplicas: 2 172 | maxReplicas: 20 173 | targetCPUUtilizationPercentage: 80 174 | # targetMemoryUtilizationPercentage: 80 175 | 176 | ## Pod Disruption Budget 177 | ## Only to be used with Deployment kind 178 | ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ 179 | PodDisruptionBudget: 180 | enable: false 181 | # maxUnavailable: 1 182 | # minAvailable: 1 183 | 184 | ## Pod Node assignment 185 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ 186 | nodeSelector: {} 187 | 188 | ## Node Taints and Tolerations for pod-node cheduling through attraction/repelling 189 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 190 | tolerations: [] 191 | # - key: "key" 192 | # operator: "Equal|Exists" 193 | # value: "value" 194 | # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" 195 | 196 | ## Node Affinity for pod-node scheduling constraints 197 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 198 | affinity: {} 199 | 200 | ## Topology spread constraints (only used in kind: Deployment) 201 | ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ 202 | topologySpreadConstraints: [] 203 | # - maxSkew: 1 204 | # topologyKey: kubernetes.io/zone 205 | # whenUnsatisfiable: DoNotSchedule 206 | # labelSelector: 207 | # matchLabels: 208 | # app.kubernetes.io/name: kubernetes-ingress 209 | # app.kubernetes.io/instance: kubernetes-ingress 210 | 211 | ## Pod DNS Config 212 | ## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ 213 | dnsConfig: {} 214 | 215 | ## Pod DNS Policy 216 | ## Change this to ClusterFirstWithHostNet in case you have useHostNetwork set to true 217 | ## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy 218 | dnsPolicy: ClusterFirst 219 | 220 | ## Additional command line arguments to pass to Controller 221 | ## ref: https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/controller.md 222 | extraArgs: [] 223 | # - --namespace-whitelist=default 224 | # - --namespace-whitelist=namespace1 225 | # - --namespace-blacklist=namespace2 226 | 227 | ## Custom configuration for Controller 228 | ## ref: https://github.com/haproxytech/kubernetes-ingress/tree/master/documentation 229 | config: {} 230 | # timeout-connect: "250ms" 231 | # servers-increment: "10" 232 | # servers-increment-max-disabled: "10" 233 | # rate-limit: "ON" 234 | # rate-limit-expire: "1m" 235 | # rate-limit-interval: "10s" 236 | # rate-limit-size: "100k" 237 | 238 | ## Controller Logging configuration 239 | logging: 240 | ## Controller logging level 241 | ## This only relevant to Controller logs 242 | level: info 243 | 244 | ## HAProxy traffic logs 245 | ## ref: https://github.com/haproxytech/kubernetes-ingress/tree/master/documentation#logging 246 | traffic: {} 247 | # address: "stdout" 248 | # format: "raw" 249 | # facility: "daemon" 250 | 251 | ## Mirrors the address of the service's endpoints to the 252 | ## load-balancer status of all Ingress objects it satisfies. 253 | publishService: 254 | enabled: true 255 | ## 256 | ## Override of the publish service 257 | ## Must be / 258 | pathOverride: "" 259 | 260 | ## Controller Service configuration 261 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 262 | service: 263 | enabled: true # set to false when controller.kind is 'DaemonSet' and controller.daemonset.useHostPorts is true 264 | 265 | type: NodePort # can be 'NodePort' or 'LoadBalancer' 266 | 267 | ## Service annotations 268 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ 269 | annotations: {} 270 | 271 | ## Service labels 272 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ 273 | labels: {} 274 | 275 | ## Health check node port 276 | ## ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip 277 | healthCheckNodePort: 0 278 | 279 | ## Service nodePorts to use for http, https and stat 280 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 281 | ## If empty, random ports will be used 282 | nodePorts: {} 283 | # http: 31080 284 | # https: 31443 285 | # stat: 31024 286 | 287 | ## Service ports to use for http, https and stat 288 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 289 | ports: 290 | http: 80 291 | https: 443 292 | stat: 1024 293 | 294 | ## The controller service ports for http, https and stat can be disabled by 295 | ## setting below to false - this could be useful when only deploying haproxy 296 | ## as a TCP loadbalancer 297 | ## Note: At least one port (http, https, stat or from tcpPorts) has to be enabled 298 | enablePorts: 299 | http: true 300 | https: true 301 | stat: true 302 | 303 | ## Target port mappings for http, https and stat 304 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 305 | targetPorts: 306 | http: http 307 | https: https 308 | stat: stat 309 | 310 | ## Additional tcp ports to expose 311 | ## This is especially useful for TCP services: 312 | ## https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/controller.md 313 | tcpPorts: [] 314 | # - name: http-alt 315 | # port: 8080 316 | # targetPort: http-alt 317 | # nodePort: 32080 318 | 319 | ## Set external traffic policy 320 | ## Default is "Cluster", setting it to "Local" preserves source IP 321 | ## Ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-typeloadbalancer 322 | # externalTrafficPolicy: "Local" 323 | 324 | ## Expose service via external IPs that route to one or more cluster nodes 325 | externalIPs: [] 326 | 327 | ## LoadBalancer IP 328 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer 329 | loadBalancerIP: "" 330 | 331 | ## Source IP ranges permitted to access Network Load Balancer 332 | # ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ 333 | loadBalancerSourceRanges: [] 334 | 335 | ## Service ClusterIP 336 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 337 | # clusterIP: "" 338 | 339 | ## Service session affinity 340 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 341 | # sessionAffinity: "" 342 | 343 | ## Controller DaemonSet configuration 344 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ 345 | daemonset: 346 | useHostNetwork: false # also modify dnsPolicy accordingly 347 | useHostPort: false 348 | hostPorts: 349 | http: 80 350 | https: 443 351 | stat: 1024 352 | 353 | ## Controller deployment strategy definition 354 | ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy 355 | strategy: {} 356 | # rollingUpdate: 357 | # maxSurge: 25% 358 | # maxUnavailable: 25% 359 | # type: RollingUpdate 360 | 361 | ## Controller Pod PriorityClass 362 | ## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass 363 | priorityClassName: "" 364 | 365 | ## Controller container lifecycle handlers 366 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ 367 | lifecycle: {} 368 | ## Example preStop for graceful shutdown 369 | # preStop: 370 | # exec: 371 | # command: ["/bin/sh", "-c", "kill -USR1 $(pidof haproxy); while killall -0 haproxy; do sleep 1; done"] 372 | 373 | ## Set additional environment variables 374 | extraEnvs: [] 375 | ## Set TZ env to configure timezone on controller containers 376 | # - name: TZ 377 | # value: "Etc/UTC" 378 | 379 | ## Add additional containers 380 | extraContainers: [] 381 | ## Example sidecar 382 | # - name: sidecar 383 | # image: alpine # alpine is a simple Linux OS image 384 | # command: ["/bin/sh"] 385 | # args: ["-c", "while true; do date; sleep 5;done"] 386 | 387 | ## Additional volumeMounts to the controller main container 388 | extraVolumeMounts: [] 389 | ## Example empty volume mounts when using securityContext->readOnlyRootFilesystem 390 | # - name: etc-haproxy 391 | # mountPath: /etc/haproxy 392 | # - name: tmp 393 | # mountPath: /tmp 394 | # - name: var-state-haproxy 395 | # mountPath: /var/state/haproxy 396 | 397 | ## Additional volumes to the controller pod 398 | extraVolumes: [] 399 | ## Example empty volumes when using securityContext->readOnlyRootFilesystem 400 | # - name: etc-haproxy 401 | # emptyDir: {} 402 | # - name: tmp 403 | # emptyDir: {} 404 | # - name: var-state-haproxy 405 | # emptyDir: {} 406 | 407 | ## ServiceMonitor 408 | ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md 409 | serviceMonitor: 410 | ## Toggle the ServiceMonitor, true if you have Prometheus Operator installed and configured 411 | enabled: false 412 | 413 | ## Specify the labels to add to the ServiceMonitors to be selected for target discovery 414 | extraLabels: {} 415 | 416 | ## Specify the endpoints 417 | ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/design.md#servicemonitor 418 | endpoints: 419 | - port: stat 420 | path: /metrics 421 | scheme: http 422 | 423 | ## Default 404 backend 424 | defaultBackend: 425 | enabled: true 426 | name: default-backend 427 | replicaCount: 2 428 | 429 | image: 430 | repository: k8s.gcr.io/defaultbackend-amd64 431 | tag: 1.5 432 | pullPolicy: IfNotPresent 433 | runAsUser: 65534 434 | 435 | ## Compute Resources 436 | ## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 437 | resources: 438 | # limits: 439 | # cpu: 10m 440 | # memory: 16Mi 441 | requests: 442 | cpu: 10m 443 | memory: 16Mi 444 | 445 | ## Horizontal Pod Scaler 446 | ## Only to be used with Deployment kind 447 | ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ 448 | autoscaling: 449 | enabled: false 450 | minReplicas: 1 451 | maxReplicas: 2 452 | targetCPUUtilizationPercentage: 80 453 | # targetMemoryUtilizationPercentage: 80 454 | 455 | ## Listener port configuration 456 | ## ref: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/ 457 | containerPort: 8080 458 | 459 | ## Pod Node assignment 460 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ 461 | nodeSelector: {} 462 | 463 | ## Node Taints and Tolerations for pod-node cheduling through attraction/repelling 464 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 465 | tolerations: [] 466 | # - key: "key" 467 | # operator: "Equal|Exists" 468 | # value: "value" 469 | # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" 470 | 471 | ## Node Affinity for pod-node scheduling constraints 472 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 473 | affinity: {} 474 | 475 | ## Topology spread constraints 476 | ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ 477 | topologySpreadConstraints: [] 478 | # - maxSkew: 1 479 | # topologyKey: kubernetes.io/zone 480 | # whenUnsatisfiable: DoNotSchedule 481 | # labelSelector: 482 | # matchLabels: 483 | # app.kubernetes.io/name: kubernetes-ingress-kubernetes-ingress-default-backend 484 | # app.kubernetes.io/instance: haproxy-ingress 485 | 486 | ## Additional labels to add to the pod container metadata 487 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ 488 | podLabels: {} 489 | # key: value 490 | 491 | ## Additional annotations to add to the pod container metadata 492 | ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ 493 | podAnnotations: {} 494 | # key: value 495 | 496 | service: 497 | ## Service ports 498 | ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ 499 | port: 8080 500 | 501 | ## Configure Service Account 502 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ 503 | serviceAccount: 504 | create: true 505 | 506 | ## Pod PriorityClass 507 | ## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass 508 | priorityClassName: "" 509 | 510 | ## Set additional environment variables 511 | extraEnvs: [] 512 | ## Set TZ env to configure timezone on controller containers 513 | # - name: TZ 514 | # value: "Etc/UTC" 515 | --------------------------------------------------------------------------------