Guest User

Untitled

a guest
Jan 22nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. ## Working with Kubernetes, Docker and Google Cloud
  2.  
  3. ### Requirements
  4. - `docker` and `kubectl` set up
  5. - a working `Dockerfile` within a project
  6. - a Google Cloud Container registry
  7.  
  8. 1. Build a docker image locally
  9.  
  10. `docker build -t cryptokitties-api-abhi .`
  11.  
  12. 2. Configure your docker to work with Google Cloud
  13.  
  14. `gcloud auth configure-docker`
  15.  
  16. 2. Add a docker tag to the remote registry
  17.  
  18. `docker tag cryptokitties-api-abhi gcr.io/az-cryptokitties/cryptokitties-api/`
  19.  
  20. 3. Push the tag to the Container Registry
  21.  
  22. `docker push gcr.io/az-cryptokitties/cryptokitties-api-abhi`
  23.  
  24. 4. Use the image in your `k8` YAML file. Once you have update the file
  25.  
  26. `kubectl apply -f kitty-birth-worker-deployment-staging.yml`
  27.  
  28. 5. Use the `-n` flag to get the running pods for your container by running
  29.  
  30. `kubectl get pods -n staging`
  31.  
  32. 6. Use the `logs` command to see the output of the container. The `-f` flag allows you to follow the tail of this log.
  33.  
  34. `kubectl logs cryptokitties-api-kitty-autobirth-worker-fb5ffdf8d-8vnjb -n staging -f`
Add Comment
Please, Sign In to add comment