This instruction provides the steps required to deploy a production cluster for Prow.
Use the following tools and configuration:
- Kubernetes 1.10+ on Google Kubernetes Engine (GKE)
- kubectl to communicate with Kubernetes
- gcloud to communicate with Google Cloud Platform (GCP)
- The
kyma-bot
GitHub account - Kubernetes cluster
- Two Secrets in the Kubernetes cluster:
hmac-token
which is a Prow HMAC token used to validate GitHub webhooksoauth-token
which is a GitHub token with read and write access to thekyma-bot
account
- Two buckets on Google Cloud Storage (GCS), one for storing Secrets and the second for storing logs
- GCP configuration that includes:
- A global static IP address with the
prow-production
name - A DNS registry for the
status.build.kyma-project.io
domain that points to theprow-production
address
- A global static IP address with the
-
When you communicate for the first time with Google Cloud, set the context to your Google Cloud project.
Export the PROJECT variable and run this command:
gcloud config set project $PROJECT
-
Make sure that kubectl points to the correct cluster.
Export these variables:
export CLUSTER_NAME=prow-production export ZONE=europe-west3-b export PROJECT=kyma-project
For GKE, run the following command:
gcloud container clusters get-credentials $CLUSTER_NAME --zone=$ZONE --project=$PROJECT
-
Export these environment variables, where:
- BUCKET_NAME is a GCS bucket in the Google Cloud project that stores Prow Secrets.
- KEYRING_NAME is the KMS key ring.
- ENCRYPTION_KEY_NAME is the key name in the key ring that is used for data encryption.
export BUCKET_NAME=kyma-prow export KEYRING_NAME=kyma-prow export ENCRYPTION_KEY_NAME=kyma-prow-encryption
-
Run the following script to start the installation process:
./install-prow.sh
The installation script performs the following steps to install Prow:
- Deploy the NGINX Ingress Controller.
- Create a ClusterRoleBinding.
- Deploy Prow components with the
a202e595a33ac92ab503f913f2d710efabd3de21
revision. - Deploy the Cert Manager.
- Deploy secure Ingress.
- Remove insecure Ingress.
-
Verify the installation.
To check if the installation is successful, perform the following steps:
- Check if all Pods are up and running:
kubeclt get pods
- Check if the Deck is accessible from outside of the cluster:
kubectl get ingress tls-ing
- Copy the address of the
tls-ing
Ingress and open it in a browser to display the Prow status on the dashboard.
- Check if all Pods are up and running:
When you use the install-prow.sh
script to install Prow on your cluster, the list of plugins and configuration is empty. You can configure Prow by specifying the config.yaml
and plugins.yaml
files, and adding job definitions to the jobs
directory.
The config.yaml
file contains the basic Prow configuration. When you create a particular ProwJob, it uses the Preset definitions from this file. See the example of such a file here.
For more details, see the Kubernetes documentation.
The plugins.yaml
file contains the list of plugins you enable on a given repository. See the example of such a file here.
For more details, see the Kubernetes documentation.
The jobs
directory contains the ProwJobs configuration. See the example of such a file here.
For more details, see the Kubernetes documentation.
To check if the plugins.yaml
, config.yaml
, and jobs
configuration files are correct, run the validate-config.sh {plugins_file_path} {config_file_path} {jobs_dir_path}
script. For example, run:
./validate-config.sh ../prow/plugins.yaml ../prow/config.yaml ../prow/jobs
If the files are configured correctly, upload the files on a cluster.
-
Use the
update-plugins.sh {file_path}
script to apply plugin changes on a cluster../update-plugins.sh ../prow/plugins.yaml
-
Use the
update-config.sh {file_path}
script to apply Prow configuration on a cluster../update-config.sh ../prow/config.yaml
-
Use the
update-jobs.sh {jobs_dir_path}
script to apply jobs configuration on a cluster../update-jobs.sh ../prow/jobs
After you complete the required configuration, you can test the uploaded plugins and configurations. You can also create your own job pipeline and test it against the forked repository.
To clean up everything created by the installation script, run the removal script:
./remove-prow.sh