-
Notifications
You must be signed in to change notification settings - Fork 5
How to deploy to a new Google cluster
General steps:
- Create a new cluster in GCP.
- Install the prerequisites in the newly created cluster.
- Create a new pipeline in Codefresh to automate deployments.
- Deploy.
The cluster can be created in the GCP console. Define a node pool that satisfies application requirements. The node pool can be always scaled to have a different node number, so the only important choice is the node type. Also other node pools can be added at any point of time to the cluster to replace the original one.
After creating the cluster, use gcloud
command line client to get the credentials in your machine:
gcloud init
gcloud container clusters get-credentials --zone us-central1-a <CLUSTER_NAME>
Helm 3 is used to deploy MNP. Install Helm and ensure is working on your command line.
Follow this instructions to deploy cert-manager
Important! Use the helm chart installation and set use-webhook to false. The webhook causes some issues to create certificates
helm install --name cert-manager --namespace cert-manager --version v0.14.0 jetstack/cert-manager --set webhook.enabled=false
Ingress controller is the entry point of all cloudharness applications. Info on how to deploy nginx-ingress can be found here.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx
The nginx-ingress chart will deploy a Load Balancer with a given IP address. Use that address to create the CNames and A records for the website.
We are using a codefresh yaml file generated in the repository, so the only thing you need to do is to point to that codefresh.yaml
file at the moment of creating the pipeline.
Select "use yaml from repository" There are 2 pipelines to choose:
- ./deployment/codefresh-dev.yaml - builds and deploys
- ./deployment/codefresh-prod.yaml - deploys from a previous tagged build
- Go to Codefresh under
Account Settings > kubernetes
and choose to add custom cluster. - Follow the instructions to get the
host
,token
, etc.
On your codefresh pipeline, configure variables to specify the cluster, registry and other custom values.
Go to codefresh webpage and in Pipelines click RUN
.