Add Helm test for HAProxy
- Added a helm test to test HAProxy's health via kubernetes healthz endpoint. Change-Id: I0ffba39d4e4245fad69c27f0fcafdcb58fdc9067
This commit is contained in:
parent
c1e7a74c1e
commit
2885218d35
|
@ -38,7 +38,7 @@ spec:
|
||||||
- {{ . }}
|
- {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- --advertise-address=$(POD_IP)
|
- --advertise-address=$(POD_IP)
|
||||||
- --anonymous-auth=false
|
- --anonymous-auth=true
|
||||||
- --bind-address=0.0.0.0
|
- --bind-address=0.0.0.0
|
||||||
- --secure-port={{ .Values.network.kubernetes_apiserver.port }}
|
- --secure-port={{ .Values.network.kubernetes_apiserver.port }}
|
||||||
- --insecure-port=0
|
- --insecure-port=0
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
{{/*
|
||||||
|
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
*/}}
|
||||||
|
{{/*
|
||||||
|
Test that HAProxy is running and the config is valid */}}
|
||||||
|
{{- if .Values.manifests.test_haproxy }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: "{{ .Release.Name }}-haproxy-test"
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": "test-success"
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: "{{ .Release.Name }}-haproxy-test"
|
||||||
|
env:
|
||||||
|
- name: HOST_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.hostIP
|
||||||
|
- name: 'HAPROXY_URL'
|
||||||
|
value: https://$(HOST_IP):{{ .Values.endpoints.health.port }}/{{ .Values.endpoints.health.path }}
|
||||||
|
image: {{ .Values.images.tags.test }}
|
||||||
|
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||||
|
{{ tuple . .Values.pod.resources.test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
|
||||||
|
command: ["/bin/sh", "-c", "wget --no-check-certificate --spider ${HAPROXY_URL}; exit $?"]
|
||||||
|
...
|
||||||
|
{{- end }}
|
|
@ -26,11 +26,9 @@ conf:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:6553
|
- bind *:6553
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
kube-system:
|
kube-system:
|
||||||
|
@ -39,11 +37,9 @@ conf:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:2378
|
- bind *:2378
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
|
|
||||||
|
@ -65,8 +61,17 @@ images:
|
||||||
tags:
|
tags:
|
||||||
anchor: gcr.io/google_containers/hyperkube-amd64:v1.8.6
|
anchor: gcr.io/google_containers/hyperkube-amd64:v1.8.6
|
||||||
haproxy: haproxy:1.8.3
|
haproxy: haproxy:1.8.3
|
||||||
|
test: busybox:1.28.3
|
||||||
pull_policy: "IfNotPresent"
|
pull_policy: "IfNotPresent"
|
||||||
|
|
||||||
|
manifests:
|
||||||
|
test_haproxy: true
|
||||||
|
|
||||||
|
endpoints:
|
||||||
|
health:
|
||||||
|
port: 6553
|
||||||
|
path: "healthz"
|
||||||
|
|
||||||
pod:
|
pod:
|
||||||
lifecycle:
|
lifecycle:
|
||||||
upgrades:
|
upgrades:
|
||||||
|
@ -95,5 +100,12 @@ pod:
|
||||||
limits:
|
limits:
|
||||||
memory: "256Mi"
|
memory: "256Mi"
|
||||||
cpu: "2000m"
|
cpu: "2000m"
|
||||||
|
test:
|
||||||
|
limits:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
|
||||||
release_group: null
|
release_group: null
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License. */}}
|
# limitations under the License.
|
||||||
|
*/}}
|
||||||
{{/*
|
{{/*
|
||||||
Test that the API is up and the health endpoint returns a 2XX code */}}
|
Test that the API is up and the health endpoint returns a 2XX code */}}
|
||||||
{{- if .Values.manifests.test_promenade_api }}
|
{{- if .Values.manifests.test_promenade_api }}
|
||||||
|
|
|
@ -572,6 +572,7 @@ data:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
wait:
|
wait:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
|
test: true
|
||||||
upgrade:
|
upgrade:
|
||||||
no_hooks: true
|
no_hooks: true
|
||||||
values:
|
values:
|
||||||
|
@ -585,11 +586,9 @@ data:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:6553
|
- bind *:6553
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
kube-system:
|
kube-system:
|
||||||
|
@ -598,11 +597,9 @@ data:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:2378
|
- bind *:2378
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
|
|
||||||
|
@ -610,6 +607,7 @@ data:
|
||||||
tags:
|
tags:
|
||||||
anchor: gcr.io/google_containers/hyperkube-amd64:v1.8.6
|
anchor: gcr.io/google_containers/hyperkube-amd64:v1.8.6
|
||||||
haproxy: haproxy:1.8.3
|
haproxy: haproxy:1.8.3
|
||||||
|
test: busybox:1.28.3
|
||||||
|
|
||||||
source:
|
source:
|
||||||
type: local
|
type: local
|
||||||
|
@ -1139,6 +1137,7 @@ data:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
wait:
|
wait:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
|
test: true
|
||||||
values:
|
values:
|
||||||
pod:
|
pod:
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -612,6 +612,7 @@ data:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
wait:
|
wait:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
|
test: true
|
||||||
upgrade:
|
upgrade:
|
||||||
no_hooks: true
|
no_hooks: true
|
||||||
values:
|
values:
|
||||||
|
@ -625,11 +626,9 @@ data:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:6553
|
- bind *:6553
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
kube-system:
|
kube-system:
|
||||||
|
@ -638,11 +637,9 @@ data:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:2378
|
- bind *:2378
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
|
|
||||||
|
@ -650,6 +647,7 @@ data:
|
||||||
tags:
|
tags:
|
||||||
anchor: gcr.io/google_containers/hyperkube-amd64:v1.8.6
|
anchor: gcr.io/google_containers/hyperkube-amd64:v1.8.6
|
||||||
haproxy: haproxy:1.8.3
|
haproxy: haproxy:1.8.3
|
||||||
|
test: busybox:1.28.3
|
||||||
|
|
||||||
source:
|
source:
|
||||||
type: local
|
type: local
|
||||||
|
@ -1816,6 +1814,7 @@ data:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
wait:
|
wait:
|
||||||
timeout: 600
|
timeout: 600
|
||||||
|
test: true
|
||||||
values:
|
values:
|
||||||
pod:
|
pod:
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -234,7 +234,7 @@ spec:
|
||||||
kubernetes.io/hostname: ${NODE}
|
kubernetes.io/hostname: ${NODE}
|
||||||
containers:
|
containers:
|
||||||
- name: noisy
|
- name: noisy
|
||||||
image: busybox:1.27.1
|
image: busybox:1.28.3
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- /bin/echo
|
- /bin/echo
|
||||||
|
|
|
@ -17,7 +17,6 @@ global
|
||||||
|
|
||||||
defaults
|
defaults
|
||||||
mode tcp
|
mode tcp
|
||||||
option tcpka
|
|
||||||
timeout connect 5000ms
|
timeout connect 5000ms
|
||||||
timeout client 24h
|
timeout client 24h
|
||||||
timeout server 24h
|
timeout server 24h
|
||||||
|
|
|
@ -123,7 +123,7 @@ spec:
|
||||||
- --advertise-address={{ config['Genesis:ip'] }}
|
- --advertise-address={{ config['Genesis:ip'] }}
|
||||||
- --authorization-mode=Node,RBAC
|
- --authorization-mode=Node,RBAC
|
||||||
- --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds
|
- --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds
|
||||||
- --anonymous-auth=false
|
- --anonymous-auth=true
|
||||||
- --client-ca-file=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
- --client-ca-file=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
||||||
- --kubelet-certificate-authority=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
- --kubelet-certificate-authority=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
||||||
- --kubelet-client-certificate=/etc/kubernetes/apiserver/pki/apiserver.pem
|
- --kubelet-client-certificate=/etc/kubernetes/apiserver/pki/apiserver.pem
|
||||||
|
|
|
@ -19,7 +19,7 @@ spec:
|
||||||
- --advertise-address={{ config['Genesis:ip'] }}
|
- --advertise-address={{ config['Genesis:ip'] }}
|
||||||
- --authorization-mode=Node,RBAC
|
- --authorization-mode=Node,RBAC
|
||||||
- --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds
|
- --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds
|
||||||
- --anonymous-auth=false
|
- --anonymous-auth=true
|
||||||
- --client-ca-file=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
- --client-ca-file=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
||||||
- --kubelet-certificate-authority=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
- --kubelet-certificate-authority=/etc/kubernetes/apiserver/pki/cluster-ca.pem
|
||||||
- --kubelet-client-certificate=/etc/kubernetes/apiserver/pki/apiserver.pem
|
- --kubelet-client-certificate=/etc/kubernetes/apiserver/pki/apiserver.pem
|
||||||
|
|
|
@ -564,11 +564,9 @@ data:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:6553
|
- bind *:6553
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
kube-system:
|
kube-system:
|
||||||
|
@ -577,11 +575,9 @@ data:
|
||||||
conf_parts:
|
conf_parts:
|
||||||
frontend:
|
frontend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- bind *:2378
|
- bind *:2378
|
||||||
backend:
|
backend:
|
||||||
- mode tcp
|
- mode tcp
|
||||||
- option tcpka
|
|
||||||
- option tcp-check
|
- option tcp-check
|
||||||
- option redispatch
|
- option redispatch
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue