Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify cert-manager install with 'kubectl wait', #152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions src/go/k8s/hack/install-cert-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,7 @@ set -o nounset
set -o pipefail

CERT_MANAGER_VERSION="v1.13.3"
CERT_MANAGER_VERIFIER_VERSION="0.3.0"

# TODO: support more OS/architectures as they are needed
if [ "$(kubectl get deploy --sort-by=.metadata.name --namespace cert-manager -o=jsonpath='{.items[*].metadata.name}')" = "cert-manager cert-manager-cainjector cert-manager-webhook" ]; then
echo "cert manager already installed"
exit 0
fi

mkdir -p ./bin

CURL_OUTPUT="${1:-.}"

if [ "$(uname)" == 'Darwin' ]; then
curl -Lv https://github.com/alenkacz/cert-manager-verifier/releases/download/v"${CERT_MANAGER_VERIFIER_VERSION}"/cert-manager-verifier_"${CERT_MANAGER_VERIFIER_VERSION}"_Darwin_x86_64.tar.gz 2>"${CURL_OUTPUT}"/cert-manager-verifier-download-output.txt | tar -xvf - -C ./bin
else
curl -Lv https://github.com/alenkacz/cert-manager-verifier/releases/download/v"${CERT_MANAGER_VERIFIER_VERSION}"/cert-manager-verifier_"${CERT_MANAGER_VERIFIER_VERSION}"_Linux_x86_64.tar.gz 2>"${CURL_OUTPUT}"/cert-manager-verifier-download-output.txt | tar -xzvf - -C ./bin
fi

HOME=$(mktemp -d)
# the recommended approach using a static manifest:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml

./bin/cm-verifier --timeout 5m
kubectl -n cert-manager wait --for=condition=Available deploy/cert-manager-cainjector deploy/cert-manager-webhook deploy/cert-manager