-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
56 lines (46 loc) · 1.21 KB
/
entrypoint.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
50
51
52
53
54
55
56
#!/bin/sh
# exit when any command fails
#set -e
# keep track of the last executed command
#trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
# echo an error message before exiting
#trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
# Extract the base64 encoded config data and write this to the KUBECONFIG
echo "$KUBE_CONFIG_DATA" | base64 -d > /tmp/config
export KUBECONFIG=/tmp/config
find /|grep kubectl
kubectl version
kubectl config current-context
kubectl get nodes
ls -la
Namespace=$(find . -name "namespace*"|grep -v prod)
Configmap=$(find . -name "configmap*.yaml"|grep -v prod)
Secret=$(find . -name secret.yaml|grep -v prod)
Deployment=$(find . -name deployment.yaml|grep -v prod)
Service=$(find . -name service.yaml|grep -v prod)
RBAC=$(find . -name rbac.yaml|grep -v prod)
for namespace in $Namespace
do
kubectl apply -f $namespace
done
for configmap in $Configmap
do
kubectl apply -f $configmap
done
for secret in $Secret
do
kubectl apply -f $secret
done
for deployment in $Deployment
do
kubectl apply -f $deployment
done
for service in $Service
do
kubectl apply -f $service
done
for rbac in $RBAC
do
kubectl apply -f $rbac
done
rm /tmp/config