This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch helm in repository https://gitbox.apache.org/repos/asf/skywalking-showcase.git
commit 868e583025a3c7cacd44b5deab5a0db333518622 Author: kezhenxu94 <[email protected]> AuthorDate: Thu Dec 15 19:17:27 2022 +0800 Polish some scripts to fix deployment failure --- deploy/platform/kubernetes/features.mk | 9 +++--- scripts/wait-cert-manager-ready.sh | 59 ---------------------------------- 2 files changed, 4 insertions(+), 64 deletions(-) diff --git a/deploy/platform/kubernetes/features.mk b/deploy/platform/kubernetes/features.mk index 65494b1..a918ab0 100644 --- a/deploy/platform/kubernetes/features.mk +++ b/deploy/platform/kubernetes/features.mk @@ -108,12 +108,11 @@ feature-java-agent-injector: .PHONY: install-cert-manager install-cert-manager: @kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml - @sh ../../../scripts/wait-cert-manager-ready.sh # @feature: java-agent-injector; the java agent injector is a component of the swck operator, so we need to deploy the swck operator firstly .PHONY: deploy.feature-java-agent-injector deploy.feature-java-agent-injector: install-cert-manager - @curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl apply -f - + curl -L https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl apply -f - @kubectl label namespace --overwrite $(NAMESPACE) swck-injection=enabled # @feature: java-agent-injector; we can update the agent's backend address in a single-node cluster firstly so that we don't need to add the same backend env for every java agent @kubectl get configmap skywalking-swck-java-agent-configmap -n skywalking-swck-system -oyaml | sed "s/127.0.0.1/$(NAMESPACE)-$(BACKEND_SERVICE).$(NAMESPACE)/" | kubectl apply -f - @@ -122,8 +121,8 @@ deploy.feature-java-agent-injector: install-cert-manager # @feature: java-agent-injector; uninstall the swck operator and cert-manager .PHONY: undeploy.feature-java-agent-injector undeploy.feature-java-agent-injector: - @curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl delete --ignore-not-found -f - - @kubectl delete --ignore-not-found -f https://github.com/jetstack/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml + curl -Ls https://archive.apache.org/dist/skywalking/swck/${SWCK_OPERATOR_VERSION}/skywalking-swck-${SWCK_OPERATOR_VERSION}-bin.tgz | tar -zxf - -O ./config/operator-bundle.yaml | kubectl delete --ignore-not-found -f - + kubectl delete --ignore-not-found -f https://github.com/jetstack/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml $(MAKE) undeploy FEATURE_FLAGS=agent AGENTLESS=false SHOW_TIPS=false BACKEND_SERVICE=$(BACKEND_SERVICE) .PHONY: helm @@ -154,4 +153,4 @@ feature-function: .PHONY: undeploy.feature-function undeploy.feature-function: helm - @helm uninstall openfunction -n openfunction + @helm uninstall openfunction -n openfunction --timeout 20m diff --git a/scripts/wait-cert-manager-ready.sh b/scripts/wait-cert-manager-ready.sh deleted file mode 100644 index 2067170..0000000 --- a/scripts/wait-cert-manager-ready.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# 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. -# - -TIMEOUT=120 - -MANIFEST=$(mktemp) - -cat << EOF > $MANIFEST -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: test-selfsigned - namespace: default -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: selfsigned-cert - namespace: default -spec: - dnsNames: - - example.com - secretName: selfsigned-cert-tls - issuerRef: - name: test-selfsigned -EOF - -( bash -c -- "\ - while ! kubectl apply -f $MANIFEST 2> /dev/null; \ - do \ - sleep 0.1; \ - done" ) & pid=$! -( sleep $TIMEOUT && pkill -HUP $pid ) 2>/dev/null & watcher=$! -if wait $pid 2>/dev/null; then - pkill -HUP -P $watcher - wait $watcher -fi - -# make sure the dummy Issuer and Certificate will be deleted -trap "kubectl delete -f $MANIFEST; rm $MANIFEST" 0 2 3 15
