Codeship Continuous Deployment For Docker Apps To Kubernetes
Codeship Continuous Deployment For Docker Apps To Kubernetes
Continuous Deployment
for Docker Apps
to Kubernetes
-2-
Share this
Codeship Guid
e
Continuous Deployment
for Docker Apps to
Kubernetes
What is Kubernetes?
-3-
Share this
Codeship Guid
e
Introduction
-4-
Share this
Codeship Guid
e
Deployment
replicas: 5
image: gcr.io/..
Hello Node Pod Hello Node Pod …
Dev
Machine
(Cloud Shell) …
$ kubectl node #1 node #2
Hello Service
selector:
name: hello-node
port: 8080
…
-5-
Share this
Codeship Guid
e
-6-
Share this
Codeship Guid
e
-7-
Share this
Codeship Guid
e
1 google_cloud_deployment:
C O D E S H I P - S E RV I C E S .Y M L
2 image: zachflower/google-cloud-deployment
3 add_docker: true
4 encrypted_env_file: gc.env.encrypted
5 volumes:
6 - ./:/deploy
7 gcr_dockercfg:
8 image: codeship/gcr-dockercfg-generator
9 add_docker: true
10 encrypted_env_file: gc.env.encrypted
-8-
Share this
Codeship Guid
e
Notice that there are two services defined, rather than one.
This is because one is for interacting with Google Cloud
services ( google_cloud_deployment ), while another is
used to enable Docker image push functionality to the
Google Cloud Registry ( gcr_dockercfg ). This is only half
of the puzzle, however, because although it creates the
necessary services for interacting with Google Cloud, it
doesn't automatically deploy newly built images or update
a Kubernetes Deployment.
1 - service: app
2 type: push
3 image_name: gcr.io/project-name/app-name
4 registry: https://gcr.io
5 dockercfg_service: gcr_dockercfg
-9-
Share this
Codeship Guid
e
1 - service: app
2 type: push
3 image_name: gcr.io/project-name/app-name
CODE
- 10 -
Share this
Codeship Guid
e
- 11 -
Share this
Codeship Guid
e
1 #!/bin/bash
2
3 set -e
4
K U B E R N E T E S - D E P L OY. S H
- 12 -
Share this
Codeship Guid
e
- 13 -
Share this
Codeship Guid
e
1 - service: google_cloud_deployment
2 command: /deploy/deploy.sh
- 14 -
Share this
Codeship Guid
e
Conclusion
- 15 -
Share this
Codeship Guid
e
An Introduction to Deploying
Docker Apps with Codeship Pro.
EBOOKS
- 16 -
Share this
Codeship Guid
e
About Codeship.
Codeship is a hosted Continuous Integration service that fits all your needs.
Codeship Basic provides pre-installed dependencies and a simple setup UI
that let you incorporate CI and CD in only minutes. Codeship Pro has native
Docker support and gives you full control of your CI and CD setup while
providing the convenience of a hosted solution.