fleetctl v0.7.1 fleet v0.7.1 deis v0.11.0
- Install the
gcloud
utility by runningcurl https://sdk.cloud.google.com | bash
- Follow the steps.
-
If using zsh, edit your
.zshrc
file near the bottom and find the lines that were added by the] gcloud util install. Replacepath.bash.inc
withpath.zsh.inc
, do the same with completion.# The next line updates PATH for the Google Cloud SDK. source '~/google-cloud-sdk/path.zsh.inc' # The next line enables bash completion for gcloud. source '~/google-cloud-sdk/completion.zsh.inc'
-
- run
gcloud auth login
to authorize your account. Follow the wizard. - Set the default project. In our case it's fourth-blend-666 (don't ask.) so the command would be
gcloud config set project fourth-blend-666
- clone deis
git clone https://github.com/deis/deis.git
- cd inside
deis/contrib/gce/
and run./create-gce-user-data $(curl -s https://discovery.etcd.io/new)
This will create gce-user-data inside the directory. I'm pretty sure we only need one gce-user-data and just have it shared for everyone but I'm not too sure
Clusters are group of hosts that Deis uses to run jobs and distribute applications. In our instance, our clusters are located inside Google Cloud Engine.
gcloud compute disks create "$env-disk$num" \
--zone asia-east1-b \
--size 100GB
or create disks via the Google Compute dashboard
We then launch instances using the latest CoreOS version. We can check for the latest CoreOS version using
gcloud compute images list
.
For one instance:
gcloud compute instances create "$env-instance$num" \
--image https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-alpha-410-0-0-v20140818 \
--boot-disk-device-name "$env-boot$num" \
--boot-disk-size 10GB \
--disk name="$env-disk$num" \
--machine-type n1-standard-2 \
--metadata-from-file user-data=gce-user-data sshKey=~/.ssh/deis.pub \
--zone asia-east1-b \
--tags staging
Create a new health check
gcloud compute http-health-checks create basic-check --request-path /health-check
Add new target pools
gcloud compute target-pools create staging-asia --health-check basic-check --region asia-east1
Assign instances to target pools
gcloud compute target-pools add-instances staging-asia --instances staging-instance1 staging-instance2 --zone asia-east1-b
Add a forwarding rule
gcloud compute forwarding-rules create staging-asia --target-pool staging-asia staging-us --region asia-east1
Set firewall
gcloud compute firewall-rules create staging-firewall --target-tags staging --allow tcp:80 tcp:2222
When deleting an existing machine, that is already part of the Deis cluster, the cluster apparently fails.
The solution is to run DEIS_NUM_INSTANCES=3 DEIS_NUM_ROUTERS=3 make run
again to reboot the services.
- How often do we delete servers though?
- If this is critical, then we should find a way how to delete machines in a cluster silently.