Skip to content

Commit 7f9049b

Browse files
authored
Merge pull request #2880 from openziti/upgrade-cert-manager
upgrade cert-manager
2 parents 53eac64 + be554c0 commit 7f9049b

File tree

5 files changed

+93
-59
lines changed

5 files changed

+93
-59
lines changed

.github/workflows/test-deployments.yml

+26-15
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121
build-linux-packages:
2222
name: Build ${{ matrix.package_name }} ${{ matrix.arch.gox }} ${{ matrix.packager }}
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04
2424
strategy:
2525
matrix:
2626
package_name:
@@ -77,7 +77,7 @@ jobs:
7777
dry-run-linux-packages:
7878
needs: build-linux-packages
7979
name: Dry Run ${{ format('{0}:{1}', matrix.distro.name, matrix.distro.version) }} ${{ matrix.arch.gox }}
80-
runs-on: ubuntu-latest
80+
runs-on: ubuntu-24.04
8181
env:
8282
ZITI_PWD: ziggypw
8383
ZITI_CTRL_ADVERTISED_ADDRESS: linux-controller.127.21.71.0.sslip.io
@@ -136,7 +136,10 @@ jobs:
136136
- name: Install Packages
137137
shell: bash
138138
run: |
139-
set -x
139+
140+
set -o pipefail
141+
set -o xtrace
142+
140143
ls -lR ./release/
141144
case "${{ matrix.distro.type }}" in
142145
rpm)
@@ -158,7 +161,10 @@ jobs:
158161
env:
159162
DEBUG: 1
160163
run: |
161-
set -x
164+
165+
set -o pipefail
166+
set -o xtrace
167+
162168
/opt/openziti/etc/controller/bootstrap.bash <<CTRL
163169
ZITI_CTRL_ADVERTISED_ADDRESS=${ZITI_CTRL_ADVERTISED_ADDRESS}
164170
ZITI_CTRL_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT}
@@ -176,9 +182,9 @@ jobs:
176182
ZITI_ARGS="--verbose"
177183
ROUTER
178184
179-
test-linux-services:
180-
name: Test Debian Linux Services
181-
runs-on: ubuntu-latest
185+
linux-deployments:
186+
name: Test Linux Deployments
187+
runs-on: ubuntu-24.04
182188
steps:
183189
- name: Shallow checkout
184190
uses: actions/checkout@v4
@@ -192,9 +198,13 @@ jobs:
192198
- name: Install nfpm
193199
shell: bash
194200
run: |
201+
202+
set -o pipefail
203+
set -o xtrace
204+
195205
echo ~/.local/bin >> $GITHUB_PATH
196206
mkdir -p ~/.local/bin
197-
wget -qO- https://github.com/goreleaser/nfpm/releases/download/v${{ env.NFPM_VERSION }}/nfpm_${{ env.NFPM_VERSION }}_Linux_x86_64.tar.gz | tar --directory ~/.local/bin -xz nfpm
207+
wget -qO- https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz | tar --directory ~/.local/bin -xz nfpm
198208
nfpm --version
199209
200210
- name: Bootstrap & Run
@@ -205,8 +215,10 @@ jobs:
205215
if: always()
206216
shell: bash
207217
run: |
208-
set -x
209-
set +e
218+
219+
set -o xtrace
220+
set +o errexit
221+
210222
sudo ss -lntp | grep -E ":(${ZITI_CTRL_ADVERTISED_PORT}|${ZITI_ROUTER_PORT})"
211223
sudo journalctl --no-pager -o cat -u ziti-controller.service
212224
sudo journalctl --no-pager -o cat -u ziti-router.service
@@ -215,7 +227,7 @@ jobs:
215227
216228
docker-deployments:
217229
name: Test Docker Deployments
218-
runs-on: ubuntu-latest
230+
runs-on: ubuntu-24.04
219231
env:
220232
ZIGGY_UID: 1001 # let container EUID run-as GHA "runner" user to share cache, etc.
221233
steps:
@@ -228,15 +240,15 @@ jobs:
228240
with:
229241
go-version-file: ./go.mod
230242

231-
- name: Run the Compose Test Script
243+
- name: Run the Docker Test Script
232244
shell: bash
233-
run: dist/docker-images/compose.test.bash
245+
run: dist/docker-images/docker.test.bash
234246
env:
235247
ZITI_GO_VERSION: ${{ steps.setup-go.outputs.go-version }}
236248

237249
kubernetes-deployments:
238250
name: Test Kubernetes Deployments
239-
runs-on: ubuntu-latest
251+
runs-on: ubuntu-24.04
240252
env:
241253
ZITI_NAMESPACE: zititest
242254
steps:
@@ -257,4 +269,3 @@ jobs:
257269
- name: Run the Kubernetes Test Script
258270
shell: bash
259271
run: ./dist/docker-images/k8s.test.bash --cpus=2 # GitHub runners have 4 vCPUs
260-

dist/dist-packages/linux/linux.test.bash

+12-4
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,26 @@ else
182182
exit 1
183183
fi
184184

185+
export \
185186
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS=${ZITI_CTRL_ADVERTISED_ADDRESS} \
186-
ZITI_CTRL_EDGE_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT} \
187-
go test -v -count=1 -tags="quickstart manual" ./ziti/cmd/edge/...
187+
ZITI_CTRL_EDGE_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT}
188+
189+
_test_result=$(go test -v -count=1 -tags="quickstart manual" ./ziti/run/...)
190+
191+
# check for failure modes that don't result in an error exit code
192+
if [[ "${_test_result}" =~ "no tests to run" ]]
193+
then
194+
echo "ERROR: test failed because no tests to run"
195+
exit 1
196+
fi
188197

189198
ATTEMPTS=5
190199
DELAY=3
191200

192201
# verify console is available
193202
curl_cmd="curl -skSfw '%{http_code}\t%{url}\n' -o/dev/null \"https://${ZITI_CTRL_ADVERTISED_ADDRESS}:${ZITI_CTRL_ADVERTISED_PORT}/zac/\""
194-
until ! ((ATTEMPTS)) || eval "${curl_cmd}" &> /dev/null
203+
until ! (( ATTEMPTS-- )) || eval "${curl_cmd}" &> /dev/null
195204
do
196-
(( ATTEMPTS-- ))
197205
echo "Waiting for zac"
198206
sleep ${DELAY}
199207
done

dist/docker-images/compose.test.bash dist/docker-images/docker.test.bash

+12-4
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,26 @@ ziti edge create edge-router "${ZITI_ROUTER_NAME}" -to ~ziggy/.config/ziti/"${ZI
124124
docker compose up ziti-router --detach
125125

126126
unset GOOS
127+
export \
127128
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS=${ZITI_CTRL_ADVERTISED_ADDRESS} \
128-
ZITI_CTRL_EDGE_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT} \
129-
go test -v -count=1 -tags="quickstart manual" ./ziti/cmd/edge/...
129+
ZITI_CTRL_EDGE_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT}
130+
131+
_test_result=$(go test -v -count=1 -tags="quickstart manual" ./ziti/run/...)
132+
133+
# check for failure modes that don't result in an error exit code
134+
if [[ "${_test_result}" =~ "no tests to run" ]]
135+
then
136+
echo "ERROR: test failed because no tests to run"
137+
exit 1
138+
fi
130139

131140
ATTEMPTS=5
132141
DELAY=3
133142

134143
# verify console is available
135144
curl_cmd="curl -skSfw '%{http_code}\t%{url}\n' -o/dev/null \"https://${ZITI_CTRL_ADVERTISED_ADDRESS}:${ZITI_CTRL_ADVERTISED_PORT}/zac/\""
136-
until ! ((ATTEMPTS)) || eval "${curl_cmd}" &> /dev/null
145+
until ! (( ATTEMPTS-- )) || eval "${curl_cmd}" &> /dev/null
137146
do
138-
(( ATTEMPTS-- ))
139147
echo "Waiting for zac"
140148
sleep ${DELAY}
141149
done

dist/docker-images/k8s.test.bash

+20-14
Original file line numberDiff line numberDiff line change
@@ -122,34 +122,40 @@ image:
122122
pullPolicy: Never
123123
ROUTER
124124

125-
./quickstart/kubernetes/miniziti.bash start \
125+
bash -x ./quickstart/kubernetes/miniziti.bash start \
126126
--profile "${ZITI_NAMESPACE}" \
127127
--no-hosts \
128-
--debug \
129128
--values-dir "${EXTRA_VALUES_DIR}"
130129

131130
MINIKUBE_IP="$(minikube --profile "${ZITI_NAMESPACE}" ip)"
131+
ZITI_CTRL_ADVERTISED_ADDRESS="miniziti-controller.${MINIKUBE_IP}.sslip.io"
132132

133133
# verify console is available
134-
curl -skSfw '%{http_code}\t%{url}\n' -o/dev/null "https://miniziti-controller.${MINIKUBE_IP}.sslip.io/zac/"
134+
curl -skSfw '%{http_code}\t%{url}\n' -o/dev/null "https://${ZITI_CTRL_ADVERTISED_ADDRESS}:${ZITI_CTRL_ADVERTISED_PORT}/zac/"
135135

136136
ZITI_PWD=$(
137-
minikube kubectl --profile "${ZITI_NAMESPACE}" -- \
138-
--context "${ZITI_NAMESPACE}" \
139-
get secrets "ziti-controller-admin-secret" \
140-
--namespace "${ZITI_NAMESPACE}" \
141-
--output go-template='{{index .data "admin-password" | base64decode }}'
137+
minikube kubectl --profile "${ZITI_NAMESPACE}" -- \
138+
--context "${ZITI_NAMESPACE}" \
139+
get secrets "ziti-controller-admin-secret" \
140+
--namespace "${ZITI_NAMESPACE}" \
141+
--output go-template='{{index .data "admin-password" | base64decode }}'
142142
)
143143

144144

145145
export \
146146
ZITI_PWD \
147147
ZITI_ROUTER_NAME="miniziti-router" \
148-
ZITI_CTRL_ADVERTISED_ADDRESS="miniziti-controller.${MINIKUBE_IP}.sslip.io"
149-
150-
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS=${ZITI_CTRL_ADVERTISED_ADDRESS} \
151-
ZITI_CTRL_EDGE_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT} \
152-
ZITI_TEST_BIND_ADDRESS="ziti-controller-client.${ZITI_NAMESPACE}.svc.cluster.local" \
153-
go test -v -count=1 -tags="quickstart manual" ./ziti/cmd/edge/...
148+
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS="${ZITI_CTRL_ADVERTISED_ADDRESS}" \
149+
ZITI_CTRL_EDGE_ADVERTISED_PORT="${ZITI_CTRL_ADVERTISED_PORT}" \
150+
ZITI_TEST_BIND_ADDRESS="ziti-controller-client.${ZITI_NAMESPACE}.svc.cluster.local"
151+
152+
_test_result=$(go test -v -count=1 -tags="quickstart manual" ./ziti/run/...)
153+
154+
# check for failure modes that don't result in an error exit code
155+
if [[ "${_test_result}" =~ "no tests to run" ]]
156+
then
157+
echo "ERROR: test failed because no tests to run"
158+
exit 1
159+
fi
154160

155161
cleanup

quickstart/kubernetes/miniziti.bash

+23-22
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ checkCommand() {
432432

433433
main(){
434434
checkBashVersion >&2
435-
MINIZITI_DEBUG=0
435+
436436
# require commands
437437
declare -a BINS=(awk grep helm jq minikube nslookup pgrep sed xargs)
438438
for BIN in "${BINS[@]}"; do
@@ -442,6 +442,14 @@ main(){
442442
# open a descriptor for debug messages
443443
exec 3>/dev/null
444444

445+
# xtrace opt implies --verbose
446+
if [[ $- =~ x ]]; then
447+
MINIZITI_DEBUG=1
448+
exec 3>&1
449+
else
450+
MINIZITI_DEBUG=0
451+
fi
452+
445453
# local strings with defaults that never produce an error
446454
declare DELETE_MINIZITI=0 \
447455
DETECTED_OS \
@@ -768,12 +776,6 @@ main(){
768776
--selector app.kubernetes.io/component=controller \
769777
--timeout "${MINIZITI_TIMEOUT_SECS}s" >&3
770778

771-
logDebug "applying Custom Resource Definitions: Certificate, Issuer, and Bundle"
772-
kubectlWrapper apply \
773-
--filename https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.crds.yaml >&3
774-
kubectlWrapper apply \
775-
--filename https://raw.githubusercontent.com/cert-manager/trust-manager/v0.7.0/deploy/crds/trust.cert-manager.io_bundles.yaml >&3
776-
777779
declare -A HELM_REPOS
778780
HELM_REPOS[openziti]="openziti.io/helm-charts"
779781
HELM_REPOS[jetstack]="charts.jetstack.io"
@@ -788,21 +790,26 @@ main(){
788790
fi
789791
done
790792

793+
helmWrapper upgrade --install cert-manager jetstack/cert-manager \
794+
--namespace cert-manager --create-namespace \
795+
--set crds.enabled=true
796+
kubectlWrapper wait deployments -n cert-manager --for condition=Available --timeout="${MINIZITI_TIMEOUT_SECS}s" --all >&3
797+
798+
kubectlWrapper get namespace "${ZITI_NAMESPACE}" &>/dev/null || kubectlWrapper create namespace "${ZITI_NAMESPACE}" >&3
799+
helmWrapper upgrade --install trust-manager jetstack/trust-manager \
800+
--namespace cert-manager \
801+
--set crds.keep=false \
802+
--set app.trust.namespace="${ZITI_NAMESPACE}"
803+
kubectlWrapper wait deployments -n cert-manager --for condition=Available --timeout="${MINIZITI_TIMEOUT_SECS}s" trust-manager >&3
804+
791805
#
792806
## Ensure OpenZiti Controller is Upgraded and Ready
793807
#
794808

795809
logInfo "installing openziti controller chart"
796-
(( ZITI_CHARTS_ALT )) && {
797-
logDebug "building ${ZITI_CHARTS_REF}/ziti-controller Helm Chart dependencies"
798-
helmWrapper dependency build "${ZITI_CHARTS_REF}/ziti-controller" >&3
799-
}
800810
local -a _controller_cmd=(upgrade --install "ziti-controller" "${ZITI_CHARTS_REF}/ziti-controller"
801811
--namespace "${ZITI_NAMESPACE}" --create-namespace
802812
--set clientApi.advertisedHost="miniziti-controller.${MINIZITI_INGRESS_ZONE}"
803-
--set trust-manager.app.trust.namespace="${ZITI_NAMESPACE}"
804-
--set trust-manager.enabled=true
805-
--set cert-manager.enabled=true
806813
--values "${ZITI_CHARTS_URL}/ziti-controller/values-ingress-nginx.yaml"
807814
--set ctrlPlane.service.enabled=false
808815
--set ctrlPlane.ingress.enabled=false
@@ -816,13 +823,11 @@ main(){
816823
kubectlWrapper config set-context "${MINIKUBE_PROFILE}" \
817824
--namespace "${ZITI_NAMESPACE}" >&3
818825

819-
for DEPLOYMENT in ziti-controller-cert-manager trust-manager ziti-controller; do
820-
logInfo "waiting for $DEPLOYMENT to be ready"
821-
kubectlWrapper wait deployments "$DEPLOYMENT" \
826+
logInfo "waiting for ziti-controller to be ready"
827+
kubectlWrapper wait deployments ziti-controller \
822828
--namespace "${ZITI_NAMESPACE}" \
823829
--for condition=Available=True \
824830
--timeout "${MINIZITI_TIMEOUT_SECS}s" >&3
825-
done
826831

827832
#
828833
## Ensure Minikube Tunnel is Running on macOS and WSL
@@ -964,10 +969,6 @@ EOF
964969
fi
965970

966971
logDebug "installing router chart as 'ziti-router'"
967-
(( ZITI_CHARTS_ALT )) && {
968-
logDebug "building ${ZITI_CHARTS_REF}/ziti-router Helm Chart dependencies"
969-
helmWrapper dependency build "${ZITI_CHARTS_REF}/ziti-router" >&3
970-
}
971972
local -a _router_cmd=(upgrade --install "ziti-router" "${ZITI_CHARTS_REF}/ziti-router"
972973
--namespace "${ZITI_NAMESPACE}"
973974
--set-file enrollmentJwt="$ROUTER_OTT"

0 commit comments

Comments
 (0)