Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Deploy cert-manager on Google Kubernetes Engine (GKE) and create SSL cert
description: Learn how to deploy cert-manager on Google Kubernetes (GKE) Engine and then configure it to sign SSL certificates using Let's Encrypt
---

*Last Verified: 15 July 2022*
*Last Verified: 6 June 2025*

In this tutorial you will learn how to deploy and configure cert-manager on Google Kubernetes Engine (GKE).
You will learn how to configure cert-manager to get a signed SSL certificate from Let's Encrypt,
Expand Down Expand Up @@ -84,22 +84,27 @@ or (2) export the variable in your shell session. This applies to all environmen
We will go with option (2), so we need to export the environment variables before continuing using the information that was printed by `gcloud init`:

```bash
export PROJECT=your-project # Your Google Cloud project ID.
export REGION=europe-west1 # Your Google Cloud region.
export CLOUDSDK_CORE_PROJECT=your-project # Your Google Cloud project ID.
export CLOUDSDK_COMPUTE_ZONE=europe-west2-b # Your Google Cloud zone
```

> 📖 Learn more about [Setting configuration properties in the gcloud CLI](https://cloud.google.com/sdk/docs/configurations#setting_configuration_properties).

## 1. Create a Kubernetes Cluster

To get started, let's create a Kubernetes cluster in Google Cloud. You will need to pick a name for your cluster. Here, we will go with "test-cluster-1". Let us save it in an environment variable:

```bash
export CLUSTER=test-cluster-1
export CLOUDSDK_CONTAINER_CLUSTER=test-cluster-1
```

Now, create the cluster using the following command:

```bash
gcloud container clusters create $CLUSTER --preemptible --num-nodes=1
gcloud container clusters create $CLOUDSDK_CONTAINER_CLUSTER \
--preemptible \
--machine-type e2-small \
--num-nodes=1
```
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ gcloud container clusters create $CLOUDSDK_CONTAINER_CLUSTER \
    --preemptible \
    --machine-type e2-small \
    --num-nodes=1
Note: The Kubelet readonly port (10255) is now deprecated. Please update your workloads to use the recommended alternatives. See https://cloud.google.com/kubernetes-engine/docs/how-to/disable-kubelet-readonly-port for ways to check usage and for migration instructions.
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
Creating cluster test-cluster-1 in europe-west1-b... Cluster is being health-checked (Kubernetes Control Plane is healthy)...done.
Created [https://container.googleapis.com/v1/projects/jetstack-richard/zones/europe-west1-b/clusters/test-cluster-1].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/europe-west1-b/test-cluster-1?project=jetstack-richard
kubeconfig entry generated for test-cluster-1.
NAME            LOCATION        MASTER_VERSION      MASTER_IP       MACHINE_TYPE  NODE_VERSION        NUM_NODES  STATUS
test-cluster-1  europe-west1-b  1.32.4-gke.1106006  35.187.180.134  e2-small      1.32.4-gke.1106006  1          RUNNING


Set up the [Google Kubernetes Engine auth plugin for kubectl](https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke):
Expand All @@ -119,9 +124,9 @@ kubectl get nodes -o wide
> ⏲ It will take 4-5 minutes to create the cluster.
>
> 💵 To minimize your cloud bill, this command creates a 1-node cluster using a
> [preemptible virtual
> machine](https://cloud.google.com/kubernetes-engine/docs/how-to/preemptible-vms)
> which is cheaper than a normal virtual machine.
> [preemptible virtual machine](https://cloud.google.com/kubernetes-engine/docs/how-to/preemptible-vms)
> which is cheaper than a normal virtual machine,
> and it uses a [cost effective E2 shared-core machine type](https://cloud.google.com/compute/docs/general-purpose-machines#e2-shared-core).

## 2. Deploy a sample web server

Expand Down Expand Up @@ -180,7 +185,7 @@ gcloud compute addresses describe web-ip --format='value(address)' --global
Then, copy the output and save it into an environment variable:

```bash
export IP_ADDRESS=198.51.100.1 # Replace with your IP address
export IP_ADDRESS=192.0.2.100 # Replace with your IP address
```

## 4. Create a domain name for your website
Expand Down Expand Up @@ -554,7 +559,7 @@ After completing the tutorial you can clean up by deleting the cluster and the d

```bash
# Delete the cluster and all the Google Cloud resources related to the Ingress that it contains
gcloud container clusters delete $CLUSTER
gcloud container clusters delete $CLOUDSDK_CONTAINER_CLUSTER

# Delete the domain name
gcloud dns record-sets delete $DOMAIN_NAME --zone $ZONE --type A
Expand Down