-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathctnrontkg.sh
73 lines (36 loc) · 1.65 KB
/
ctnrontkg.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
########################
#include the magic
########################
. ./magic-demo.sh
clear
DEMO_PROMPT="ubuntu@cli-vm-corp-local:~/scripts$ "
#login in native namespace, just creck the correct namespace either --tanzu-kubernetes-cluster-namespace tkg or tkg-<ip_addrss of cluster>
#pe "kubectl vsphere login --server k8s.corp.local --vsphere-username [email protected] --insecure-skip-tls-verify"
#login in TKG cluster
pe "kubectl vsphere login --server k8s.corp.local -u [email protected] --insecure-skip-tls-verify --tanzu-kubernetes-cluster-name tkg-cluster --tanzu-kubernetes-cluster-namespace tkg"
#change to context aka TKG namespace
pe "kubectl configure use-context tkg-cluster"
#describe the sit
pe "kubectl describe managedcluster tkg-cluster"
#check is empty
pe "kubectl get pods"
#download yaml of policy nonroot this is the alternative but we have it on the repo
#pe "wget https://github.com/mwest44/pacific/raw/master/authorize-psp-for-gc-service-accounts.yaml"
#apply the run as nonroot policy
"kubectl apply -f allow-runasnonroot-clusterrole.yaml"
#create the app from github repo of google to run online boutique app
pe "git clone https://github.com/GoogleCloudPlatform/microservices-demo.git demo-app"
#move the app
pe "cd /demo-app/release"
#check the app to be deployed manifest
pe "cat kubernetes-manifests.yaml"
#apply the manifesto
pe "kubectl apply -f kubernetes-manifests.yaml"
#check everything is being created
pe "kubectl get pods --watch"
#check services
pe "kubectl get services"
pe "kubectl get pods -o wide"
pe "kubectl get all"
#pe "kubectl delete -f kubernetes-manifests.yaml"