Fix creating namespace for cert-manager deployment

This commit is contained in:
Lari Hotari 2024-01-17 17:50:38 +02:00
parent e49bd32378
commit 23211c998a

View File

@ -31,16 +31,6 @@ VERSION=v1.11.4
echo "Installing cert-manager CRD resources ..." echo "Installing cert-manager CRD resources ..."
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/${VERSION}/cert-manager.crds.yaml kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/${VERSION}/cert-manager.crds.yaml
# Create the namespace
kubectl get ns ${NAMESPACE}
if [ $? == 0 ]; then
echo "Namespace '${NAMESPACE}' already exists."
else
echo "Creating namespace '${NAMESPACE}' ..."
kubectl create namespace ${NAMESPACE}
echo "Successfully created namespace '${NAMESPACE}'."
fi
# Add the Jetstack Helm repository. # Add the Jetstack Helm repository.
echo "Adding Jetstack Helm repository." echo "Adding Jetstack Helm repository."
helm repo add jetstack https://charts.jetstack.io helm repo add jetstack https://charts.jetstack.io
@ -53,6 +43,7 @@ helm repo update
echo "Installing cert-manager ${VERSION} to namespace ${NAMESPACE} as '${NAME}' ..." echo "Installing cert-manager ${VERSION} to namespace ${NAMESPACE} as '${NAME}' ..."
helm install \ helm install \
--namespace ${NAMESPACE} \ --namespace ${NAMESPACE} \
--create-namespace \
--version ${VERSION} \ --version ${VERSION} \
${NAME} \ ${NAME} \
jetstack/cert-manager jetstack/cert-manager