Commit b216bd14 authored by Mark Pundsack's avatar Mark Pundsack

Grammar and other changes

parent 45aaa154
...@@ -2,22 +2,20 @@ ...@@ -2,22 +2,20 @@
This is a step-by-step guide to deploying a project hosted on GitLab.com to Google Cloud, using Auto Deploy. This is a step-by-step guide to deploying a project hosted on GitLab.com to Google Cloud, using Auto Deploy.
We made a minimal [Ruby application](https://gitlab.com/gitlab-examples/minimal-ruby-app) to use as an example for this guide. It contains several files that we need to make auto deploy possible. We made a minimal [Ruby application](https://gitlab.com/gitlab-examples/minimal-ruby-app) to use as an example for this guide. It contains two files:
* `server.rb` - our application. It will start an HTTP server on port 5000 and render “Hello, world!” * `server.rb` - our application. It will start an HTTP server on port 5000 and render “Hello, world!”
* `Dockerfile` - to build our app into a container image. It will use a ruby base image and run `server.rb` * `Dockerfile` - to build our app into a container image. It will use a ruby base image and run `server.rb`
These are the absolute minimal requirement to have your application automatically build and deploy to Google Container Engine every time you push to the repository.
### Fork sample project on GitLab.com ### Fork sample project on GitLab.com
Let’s start by forking our sample application. Go to [the project page](https://gitlab.com/gitlab-examples/minimal-ruby-app) and press the `Fork` button. In few minutes you should have a project under your namespace with all the necessary files. Let’s start by forking our sample application. Go to [the project page](https://gitlab.com/gitlab-examples/minimal-ruby-app) and press the `Fork` button. Soon you should have a project under your namespace with the necessary files.
### Setup your own cluster on Google Container Engine ### Setup your own cluster on Google Container Engine
We assume you already have account for https://console.cloud.google.com. If not - you need to create one. If you do not already have a Google Cloud account, create one at https://console.cloud.google.com.
Visit the [`Container Engine`](https://console.cloud.google.com/kubernetes/list) tab and create a new cluster. You can change the name and leave the rest of the default settings. Once you have your cluster running, you need to connect to the cluster by following Google interface. Visit the [`Container Engine`](https://console.cloud.google.com/kubernetes/list) tab and create a new cluster. You can change the name and leave the rest of the default settings. Once you have your cluster running, you need to connect to the cluster by following the Google interface.
### Connect to Kubernetes cluster ### Connect to Kubernetes cluster
...@@ -26,9 +24,10 @@ On OSX, install [homebrew](https://brew.sh): ...@@ -26,9 +24,10 @@ On OSX, install [homebrew](https://brew.sh):
1. Install Brew Caskroom: `brew install caskroom/cask/brew-cask` 1. Install Brew Caskroom: `brew install caskroom/cask/brew-cask`
2. Install Google Cloud SDK: `brew cask install google-cloud-sdk` 2. Install Google Cloud SDK: `brew cask install google-cloud-sdk`
3. Run: `gcloud components install kubectl` 3. Add `kubectl`: `gcloud components install kubectl`
4. Log in: `gcloud auth login`
Connect to the cluster and open Kubernetes Dashboard Now go back to the Google interface, find your cluster, and follow the instructions under `Connect to the cluster` and open the Kubernetes Dashboard. It will look something like `gcloud container clusters get-credentials ruby-autodeploy \ --zone europe-west2-c --project api-project-XXXXXXX` and then `kubectl proxy`.
![connect to cluster](img/guide_connect_cluster.png) ![connect to cluster](img/guide_connect_cluster.png)
...@@ -38,11 +37,11 @@ Once you have the Kubernetes Dashboard interface running, you should visit `Secr ...@@ -38,11 +37,11 @@ Once you have the Kubernetes Dashboard interface running, you should visit `Secr
![connect to cluster](img/guide_secret.png) ![connect to cluster](img/guide_secret.png)
You need to copy-paste these the ca.crt and token into your project on GitLab.com in the Kubernetes integration page under project `Settings` > `Integrations` > `Project services` > `Kubernetes`. Don't actually copy the namespace though. Each project should have a unique namespace, and by leaving it blank, GitLab will create one for you. You need to copy-paste the ca.crt and token into your project on GitLab.com in the Kubernetes integration page under project `Settings` > `Integrations` > `Project services` > `Kubernetes`. Don't actually copy the namespace though. Each project should have a unique namespace, and by leaving it blank, GitLab will create one for you.
![connect to cluster](img/guide_integration.png) ![connect to cluster](img/guide_integration.png)
For API URL setting you should use the `Endpoint` IP from your cluster page on Google Cloud Platform. That will ensure GitLab.com can deploy containers to your cluster at Google Container Engine. For API URL, you should use the `Endpoint` IP from your cluster page on Google Cloud Platform.
### Expose application to the world ### Expose application to the world
...@@ -74,15 +73,14 @@ Use `nslookup minimal-ruby-app-staging.<yourdomain>` to confirm that domain is a ...@@ -74,15 +73,14 @@ Use `nslookup minimal-ruby-app-staging.<yourdomain>` to confirm that domain is a
### Setup Auto Deploy ### Setup Auto Deploy
Visit home page of your GitLab.com project and press "Setup Auto Deploy" button. Visit the home page of your GitLab.com project and press "Set up Auto Deploy" button.
![auto deploy button](img/auto_deploy_btn.png) ![auto deploy button](img/auto_deploy_btn.png)
You will be redirected to the New file page where you can apply one of the Auto Deploy templates. Select "Kubernetes" to apply the template, then in the file, replace "domain.example.com" with your domain name and any other adjustments you feel comfortable with.
You will be redirected to new file page where you can apply one of the several Auto Deploy templates. Select "Kubernetes", replace "domain.example.com" with your domain name and any other adjustments you feel comfortable with. ![auto deploy template](img/auto_deploy_dropdown.png)
![auto deplote template](img/auto_deploy_dropdown.png)
Once submitted, your changes should create a new pipeline with several jobs. If you made only domain changes it will be 3 jobs: build, staging and production. The build job will create a docker image with your new change and push it to the GitLab Container Registry. Staging job will deploy this image on your cluster. Once the deploy job succeeds you should be able to see your application by visiting the Kubernetes dashboard. Select the namespace of your project, which will look like `ruby-autodeploy-23`, but with a unique ID for your project, and your app will be listed as “staging” under the Deployment tab. Change the target branch to `master`, and submit your changes. This should create a new pipeline with several jobs. If you made only the domain name change, the pipeline will have 3 jobs: `build`, `staging` and `production`. The `build` job will create a docker image with your new change and push it to the GitLab Container Registry. The `staging` job will deploy this image on your cluster. Once the deploy job succeeds you should be able to see your application by visiting the Kubernetes dashboard. Select the namespace of your project, which will look like `ruby-autodeploy-23`, but with a unique ID for your project, and your app will be listed as “staging” under the Deployment tab.
Once its ready - just visit http://minimal-ruby-app-staging.yourdomain.com to see “Hello, world!” Once its ready - just visit http://minimal-ruby-app-staging.yourdomain.com to see “Hello, world!”
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment