Make zookeeper healthchecks compatible with Alpine's busybox nc (#504)

* Make zookeeper healthchecks compatible with Alpine's busybox nc

* Test Pulsar 3.3.0 image

* Use 127.0.0.1 instead of localhost in zookeeper healthchecks

- Alpine nc fails if "localhost" is used.
  - perhaps it defaults to use IPv6?

* Disable testing with Pulsar 3.3.0 image until 3.3.1 is released

- the image needs "apk add bind-tools" since busybox nslookup isn't compatible with kubernetes
This commit is contained in:
Lari Hotari 2024-06-08 08:52:06 +03:00 committed by GitHub
parent 47c2ac442a
commit 9db0cccaca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 5 deletions

View File

@ -0,0 +1,20 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
defaultPulsarImageTag: 3.3.0

View File

@ -209,6 +209,13 @@ jobs:
values_file: .ci/clusters/values-pulsar-manager.yaml values_file: .ci/clusters/values-pulsar-manager.yaml
shortname: pulsar-manager shortname: pulsar-manager
include: include:
# - k8sVersion:
# version: "1.21.14"
# kind_image_tag: v1.21.14@sha256:8a4e9bb3f415d2bb81629ce33ef9c76ba514c14d707f9797a01e3216376ba093
# testScenario:
# name: "Pulsar Latest"
# values_file: .ci/clusters/values-pulsar-latest.yaml
# shortname: pulsar-latest
- k8sVersion: - k8sVersion:
version: "1.21.14" version: "1.21.14"
kind_image_tag: v1.21.14@sha256:8a4e9bb3f415d2bb81629ce33ef9c76ba514c14d707f9797a01e3216376ba093 kind_image_tag: v1.21.14@sha256:8a4e9bb3f415d2bb81629ce33ef9c76ba514c14d707f9797a01e3216376ba093

View File

@ -156,9 +156,9 @@ spec:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}" name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
{{- $zkConnectCommand := "" -}} {{- $zkConnectCommand := "" -}}
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} {{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
{{- $zkConnectCommand = print "openssl s_client -quiet -crlf -connect localhost:" .Values.zookeeper.ports.clientTls " -cert /pulsar/certs/zookeeper/tls.crt -key /pulsar/certs/zookeeper/tls.key" -}} {{- $zkConnectCommand = print "openssl s_client -quiet -crlf -connect 127.0.0.1:" .Values.zookeeper.ports.clientTls " -cert /pulsar/certs/zookeeper/tls.crt -key /pulsar/certs/zookeeper/tls.key" -}}
{{- else -}} {{- else -}}
{{- $zkConnectCommand = print "nc -q 1 localhost " .Values.zookeeper.ports.client -}} {{- $zkConnectCommand = print "nc 127.0.0.1 " .Values.zookeeper.ports.client -}}
{{- end }} {{- end }}
{{- if .Values.zookeeper.probe.readiness.enabled }} {{- if .Values.zookeeper.probe.readiness.enabled }}
{{- if and (semverCompare "<1.25-0" .Capabilities.KubeVersion.Version) .Values.rbac.enabled .Values.rbac.psp }} {{- if and (semverCompare "<1.25-0" .Capabilities.KubeVersion.Version) .Values.rbac.enabled .Values.rbac.psp }}
@ -172,7 +172,7 @@ spec:
- "{{ .Values.zookeeper.probe.readiness.timeoutSeconds }}" - "{{ .Values.zookeeper.probe.readiness.timeoutSeconds }}"
- bash - bash
- -c - -c
- 'echo ruok | {{ $zkConnectCommand }} | grep imok' - '{ echo ruok; sleep 1; } | {{ $zkConnectCommand }} | grep imok'
initialDelaySeconds: {{ .Values.zookeeper.probe.readiness.initialDelaySeconds }} initialDelaySeconds: {{ .Values.zookeeper.probe.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.zookeeper.probe.readiness.periodSeconds }} periodSeconds: {{ .Values.zookeeper.probe.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.zookeeper.probe.readiness.timeoutSeconds }} timeoutSeconds: {{ .Values.zookeeper.probe.readiness.timeoutSeconds }}
@ -186,7 +186,7 @@ spec:
- "{{ .Values.zookeeper.probe.liveness.timeoutSeconds }}" - "{{ .Values.zookeeper.probe.liveness.timeoutSeconds }}"
- bash - bash
- -c - -c
- 'echo ruok | {{ $zkConnectCommand }} | grep imok' - '{ echo ruok; sleep 1; } | {{ $zkConnectCommand }} | grep imok'
initialDelaySeconds: {{ .Values.zookeeper.probe.liveness.initialDelaySeconds }} initialDelaySeconds: {{ .Values.zookeeper.probe.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.zookeeper.probe.liveness.periodSeconds }} periodSeconds: {{ .Values.zookeeper.probe.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.zookeeper.probe.liveness.timeoutSeconds }} timeoutSeconds: {{ .Values.zookeeper.probe.liveness.timeoutSeconds }}
@ -200,7 +200,7 @@ spec:
- "{{ .Values.zookeeper.probe.startup.timeoutSeconds }}" - "{{ .Values.zookeeper.probe.startup.timeoutSeconds }}"
- bash - bash
- -c - -c
- 'echo ruok | {{ $zkConnectCommand }} | grep imok' - '{ echo ruok; sleep 1; } | {{ $zkConnectCommand }} | grep imok'
initialDelaySeconds: {{ .Values.zookeeper.probe.startup.initialDelaySeconds }} initialDelaySeconds: {{ .Values.zookeeper.probe.startup.initialDelaySeconds }}
periodSeconds: {{ .Values.zookeeper.probe.startup.periodSeconds }} periodSeconds: {{ .Values.zookeeper.probe.startup.periodSeconds }}
timeoutSeconds: {{ .Values.zookeeper.probe.startup.timeoutSeconds }} timeoutSeconds: {{ .Values.zookeeper.probe.startup.timeoutSeconds }}