Deployment template input variables
gcp:cloud-run@1
Variable | Required/Optional | Comments |
---|---|---|
region | Required | Region name for cluster |
repository | Required | Enter Full container URL without tag |
tag | Required | Tagged container will deploy |
allowUnauthenticated | Required | Boolean to allow Unauthenticated traffic |
domain | Required | Creates a domain mapping provided the domain has been already verified with the GCP project |
containerPort | Required | Requests will be sent to the container on this port, default is 8080 |
job_type | Required | This is to deploy or undeploy application |
vpcConnector | Required | Name of the VPC Connector |
Summary:
The template contains a series of steps executed during the deployment process. Here's a summary of the main steps:
If the job_type is set to "deploy":
Add secrets to the secret manager by creating and deleting secrets using the gcloud command.
Create a Cloud Run application by generating a configuration file (app.yaml) based on the provided inputs.
Replace the existing Cloud Run service with the updated configuration using the gcloud command.
If a custom domain is provided, create a domain mapping using the gcloud command.
If allowUnauthenticated is set to true, allow public access by setting IAM policy using the gcloud command.
If the job_type is set to "undeploy":
Delete the Cloud Run application using the gcloud command.
Delete the associated secrets from the secret manager.
The template also includes various variable assignments and configurations for different parameters used in the deployment process.
Please note that the template contains specific instructions and commands tailored for GCP and Cloud Run deployments.
gcp:basic-gke-regional@1
Variable | Required/Optional | Comments |
---|---|---|
cluster | Required | Cluster name in which the deployment will happen. |
region | Required | Region name for the cluster. |
ports | Optional | Ports used in services. |
summary:
This deployment template is used to deploy an application using Helm in a Google Cloud Platform (GCP) environment. Here is a summary of the key steps and actions performed:
- Set up the environment variables and paths required for the deployment.
- Retrieve credentials for the GCP Kubernetes cluster specified.
- Install Helm by cloning the cloud-builders-community repository and building the Docker image.
- If the job type is "deploy," set up the Helm values for the deployment:
- Copy files from a Google Cloud Storage bucket and decrypt them if necessary.
- Generate the values.yaml file with the deployment configuration, including application name, environment, project, replica count, health checks, image details, service configuration, resource quotas, lifecycle commands, and environment variables.
- Read environment variable and secret values from .env and .secret.env files, respectively, and add them to values.yaml.
- Install or upgrade the application using Helm:
- Upgrade the Helm release with the generated values.yaml file.
- Restart and check the deployment's status using kubectl commands.
- Retrieve the service URL and add it as an output if available.
- If the job type is not "deploy," uninstall the application using Helm.
Overall, this template sets up the necessary environment, installs Helm, prepares the deployment configuration, deploys or uninstalls the application, and retrieves relevant information about the deployed service.
gcp:istio-gke-regional@1
Variable | Required/Optional | Comments |
---|---|---|
cluster | Required | Cluster name in which the deployment will happen. |
region | Required | Region name for the cluster. |
istioInjection | Optional | Enable Istio injection in namespace. |
serviceAccountEnabled | Optional | Use GCP Service Account. |
manageCertificate | Optional | Use GCP to procure Certificates. |
negEnabled | Optional | Expose GCP Network Endpoint Group. |
projectName | Optional | CodePipes Project Name. |
domains | Optional | Domain Names for Ingress/Certificates. |
virtualService | Optional | Istio Virtual Service. |
deployment | Optional | Create Deployment. |
service_port | Optional | Service port. |
ingressIP | Optional | GKE Ingress IP. |
ingressIPName | Optional | GKE Ingress IP Name. |
deployment_timeout | Optional | Deployment Timeout. |
autoscalingEnabled | Optional | Enable Autoscaling. |
minReplicas | Optional | Minimum number of Replicas. |
maxReplicas | Optional | Maximum number of Replicas. |
targetCPUUtilizationPercentage | Optional | Target CPU Utilization to scale replicas. |
| memoryRequest
| Optional | Memory Request for the pods. |
| cpuLimit | Optional | CPU Limit for the pods. |
| memoryLimit | Optional | Memory Limit for the pods. |
| cpuRequest | Optional | CPU Request for the pods. |
| replicaCount | Optional | Replica Count. |
| maxUnavail | Optional | Maximum Unavailable Percentage or absolute value for Pods. |
| maxSurge | Optional | Maximum Surge Percentage or absolute value for Pods. |
| terminationGracePeriodSeconds | Optional | Grace Period before terminating pod in seconds. |
| liveFailThreshold | Optional | Successive Fail Threshold for Liveliness Probe. |
| liveSuccThreshold | Optional | Successive Success Threshold for Liveliness Probe. |
| readFailThreshold | Optional | Successive Fail Threshold for Readiness Probe. |
| readSuccThreshold | Optional | Successive Success Threshold for Readiness Probe. |
| probeDelay | Optional | Delay in seconds between probes. |
| probePeriod | Optional | Probe Period in seconds. |
| probeTimeout | Optional | Probe Timeout in seconds. |
You can retrieve some of these required parameter values from the output obtained after deploying the environment. For example, if you have a Kubernetes cluster name provided as an output in Terraform, you can map it to a deployment template input variable using the following syntax: cluster_name=${terraform.cluster_name.value}
.
This deployment template is used to deploy an application using Helm in a Google Cloud Platform (GCP) environment. The template includes the following steps:
- "gcloud container setup": Retrieves credentials for the GCP container cluster.
- "Install helm": Builds a Docker image for Helm.
- "Setup helm values": Sets up the Helm values for the deployment, including environment variables, image repository details, ports, resource quotas, lifecycle settings, and more.
- "Install Application": Upgrades or installs the application using Helm, specifying the values defined in the previous step.
- "Extract summary vars": Retrieves the IP address of the ingress load balancer and adds it as an output variable.
Additionally, there is a step for uninstalling the application if the job type is not "deploy."
The template uses variables for various configuration parameters such as workspace, pipeline environment file, pipeline secret file, Helm chart path, service name, project name, application name, environment, Istio injection, service account, certificate management, deployment settings, image details, ports, service type, domains, virtual service, ingress IP, autoscaling, resource quotas, resources, lifecycle, artifacts, environment variables, secrets, deployment timeout, and more.
For more information, you can refer to the Code Pipes documentation on deployments.
Updated about 1 year ago