Campo gcloud deploy example
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Campo Gcloud

Campo Google Cloud deploy example.


Create Cluster

Create an independent Google Cloud Kubenetes Cluster, or you will need to add namespace config.

Creating a Container Cluster

Connect to cluster with kubectl.

Create Postgres Instance

Create Google Cloud SQL Postgres instance, Database user and password, and SQL service account. Put service account credential file at secrets/cloudsql/credentials.json.

Connecting from Kubernetes Engine

Create secret:

$ kubectl create secret generic cloudsql-secrets --from-file=secrets/cloudsql/credentials.json

Replace [INSTANCE_CONNECTION_NAME] with real connection name in web.yaml, and [DATABASE_URL] with real connection url in Campo .env.

Campo ENV

Edit Campo .env file, put it at secrets/app/env.

Create secret:

$ kubectl create secret generic app-secrets --from-file=secrets/app/env

TLS Certificate (Optional)

If you want to protect by TLS, add certificate to secrets/ingress/tls.crt and private key to secrets/ingress/tls.key.

Create secret:

$ kubectl create secret generic ingress-secrets --from-file=secrets/ingress/tls.crt --from-file=secrets/ingress/tls.key

Uncomment tls settings in ingress.yaml:

  - secretName: ingress-secrets

Push docker image

There is no official image now, so build and push Campo image to your own docker registry.

Replace [IMAGE_NAME] with real image path in web.yaml.

Create static IP

Create static IP and replace [STATIC_IP_NAME] in ingress.yaml.

Configuring a static IP address



$ kubectl apply -f redis.yaml -f web.yaml -f ingress.yaml