Giter Site home page Giter Site logo

deploy-to-kubernetes-in-googlecloud's Introduction

Deploy-to-kubernetes-in-googlecloud

------------------First Task ----------------

gsutil cat gs://cloud-training/gsp318/marking/setup_marking.sh | bash gcloud source repos clone valkyrie-app cd valkyrie-app cat > Dockerfile <<EOF FROM golang:1.10 WORKDIR /go/src/app COPY source . RUN go install -v ENTRYPOINT ["app","-single=true","-port=8080"] EOF docker build -t valkyrie-app:v0.0.1 . cd .. cd marking ./step1.sh

------------------Second Task ------------

cd .. cd valkyrie-app docker run -p 8080:8080 valkyrie-app:v0.0.1 &

cd .. cd marking ./step2.sh

-------------------Third Task --------------

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 sed -i s#IMAGE_HERE#gcr.io/$GOOGLE_CLOUD_PROJECT/valkyrie-app:v0.0.1#g k8s/deployment.yaml

--------------------Fourth Task-------------

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

-------------------Fifth Task --------------------

git merge origin/kurt-dev kubectl edit deployment valkyrie-dev

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

---------------Sixth and Final Task -------------------

docker ps docker kill container_id

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 &gt;&gt; /dev/null &amp; printf $(kubectl get secret cd-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo

gcloud source repos list

sed -i "s/green/orange/g" source/html.go sed -i "s/YOUR_PROJECT/$GOOGLE_CLOUD_PROJECT/g" Jenkinsfile git config --global user.email "[email protected]"
git config --global user.name "student"
git add . git commit -m "built pipeline init" git push

deploy-to-kubernetes-in-googlecloud's People

Contributors

ronak1801 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.