-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcert-issuer.sh
More file actions
executable file
·75 lines (61 loc) · 1.47 KB
/
cert-issuer.sh
File metadata and controls
executable file
·75 lines (61 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
set -e
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do SOURCE="$(readlink "$SOURCE")"; done
ROOTDIR="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
# shellcheck source=./helpers/output.sh
source "$ROOTDIR/scripts/helpers/output.sh"
# shellcheck source=./helpers/assert.sh
source "$ROOTDIR/scripts/helpers/assert.sh"
# Function to display usage
usage() {
echo -e "\
Install cert-manager via Helm
Usage: $0 [options]
-n, --namespace <namespace> Namespace for cert-manager (default: $NAMESPACE)
-h, --help Show this help message
Examples:
$0
$0 --namespace cert-manager
"
}
# Install cert-manager
install() {
print_info "Installing cert-manager"
# Add the Jetstack Helm repository
helm repo add jetstack https://charts.jetstack.io
# Update your local Helm chart repository cache
helm repo update
# Install the cert-manager Helm chart
helm upgrade --install \
cert-manager jetstack/cert-manager \
--namespace "$NAMESPACE" \
--create-namespace \
--set crds.enabled=true
print_info "cert-manager installed"
}
# Default values
NAMESPACE="ingress-nginx"
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
-n | --namespace)
NAMESPACE="$2"
shift 2
;;
-h | --help)
usage
exit 0
;;
*)
print_error "Unknown option: $1"
usage
exit 1
;;
esac
done
# Validate prerequisites
assert_is_installed "helm"
assert_is_installed "kubectl"
# Install cert-manager
install