Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions Deploy to Kubernetes in Google Cloud:challenge lab
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#WATCH FULL VIDEO ON : https://www.youtube.com/watch?v=4cRGGbxqymk

step 1:
gsutil cat gs://cloud-training/gsp318/marking/setup_marking.sh | bash
gcloud source repos clone valkyrie-app
cd valkyrie-app
Expand All @@ -14,37 +14,55 @@ docker build -t valkyrie-app:v0.0.1 .
cd ..
cd marking
./step1.sh

step 2:
cd ..
cd valkyrie-app
docker run -p 8080:8080 valkyrie-app:v0.0.1 &
cd ..
cd marking
./step2.sh
./step2.sh
step 3:
cd ..
cd valkyrie-app
docker tag valkyrie-app:v0.0.1 gcr.io/$GOOGLE_CLOUD_PROJECT/valkyrie-app:v0.0.1
docker push gcr.io/$GOOGLE_CLOUD_PROJECT/valkyrie-app:v0.0.1
step 4:
sed -i s#IMAGE_HERE#gcr.io/$GOOGLE_CLOUD_PROJECT/valkyrie-app:v0.0.1#g k8s/deployment.yaml
gcloud container clusters get-credentials valkyrie-dev --zone us-east1-d
kubectl create -f k8s/deployment.yaml
kubectl create -f k8s/service.yaml
step 5:
git merge origin/kurt-dev
kubectl edit deployment valkyrie-dev

step6:
docker build -t gcr.io/$GOOGLE_CLOUD_PROJECT/valkyrie-app:v0.0.2 .
docker push gcr.io/$GOOGLE_CLOUD_PROJECT/valkyrie-app:v0.0.2
kubectl edit deployment valkyrie-dev

step 7:
docker ps

step 8:
docker kill container_id
step 9:
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/component=jenkins-master" -l "app.kubernetes.io/instance=cd" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 8080:8080 >> /dev/null &
printf $(kubectl get secret cd-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo

step 10: gcloud source repos list

step 11:
sed -i "s/green/orange/g" source/html.go
step 12:
# Update project in Jenkinsfile
step 13:
sed -i "s/YOUR_PROJECT/$GOOGLE_CLOUD_PROJECT/g" Jenkinsfile
step 14:
git config --global user.email "[email protected]"
step 15:
git config --global user.name "student"
step 16
git add .
step 17:git comit -m "built pipeline init"
step 18 :
git push