Campo Google Cloud deploy example.
Create an independent Google Cloud Kubenetes Cluster, or you will need to add namespace config.
Connect to cluster with kubectl
.
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
.
Edit Campo .env
file, put it at secrets/app/env
.
Create secret:
$ kubectl create secret generic app-secrets --from-file=secrets/app/env
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
:
tls:
- secretName: ingress-secrets
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 and replace [STATIC_IP_NAME]
in ingress.yaml
.
Configuring a static IP address
Run:
$ kubectl apply -f redis.yaml -f web.yaml -f ingress.yaml