-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·50 lines (31 loc) · 1.36 KB
/
install.sh
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
# get current namespace
ns=$(kubectl config view --minify --output 'jsonpath={..namespace}')
# if no current context set, change current context to default
if [[ $ns == "" ]];
then
ns="default";
fi
# create new namespace: sidecar-injector
kubectl create ns sidecar-injector
# switch to the new namespace
kubectl config set-context --current --namespace=sidecar-injector
# first installing the webhook
kubectl create -f webhook/deployment/inject_sidecar.yaml
./webhook/deployment/webhook-create-signed-cert.sh \
--service sidecar-injector-webhook-svc \
--secret sidecar-injector-webhook-certs \
--namespace sidecar-injector
kubectl create -f webhook/deployment/clusterrole.yaml
kubectl create -f webhook/deployment/deployment.yaml
kubectl create -f webhook/deployment/service.yaml
kubectl create -f webhook/deployment/mutatingwebhook-ca-bundle.yaml
cat webhook/deployment/mutating-webhook.yaml | ./webhook/deployment/webhook-patch-ca-bundle.sh > webhook/deployment/mutatingwebhook-ca-bundle.yaml
# Setup the custom controller
kubectl create -f CustomResource/deployment/sample-operator.yaml
# Setup the logger
kubectl create -f logger/deployment/deployment.yaml
# setup for example
kubectl config set-context --current --namespace=default
kubectl create -f sidecar/clusterrole.yaml
# go back to initial namespace
kubectl config set-context --current --namespace=$ns