Create a GKE Cluster

Use the following gcloud command to create a GKE cluster with the specified settings.

gcloud beta container --project $GCP_PROJECT_ID clusters create $CLUSTER_NAME \
  --region $GCP_REGION \
  --tier "standard" \
  --cluster-version "1.30.5-gke.1443001" \
  --machine-type "e2-standard-4" \
  --image-type "COS_CONTAINERD" \
  --disk-size "100" \
  --enable-ip-alias \
  --enable-google-cloud-access \
  --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \
  --enable-autoupgrade \
  --enable-autorepair \
  --enable-network-policy \
  --node-locations $NODE_LOCATIONS

Install Nginx Ingress Controller

Install the Nginx Ingress Controller.

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx \
  --version 4.11.2 \
  --namespace ingress-nginx --create-namespace \
  --set controller.service.type=LoadBalancer \
  --set controller.allowSnippetAnnotations=true \
  --set controller.admissionWebhooks.enabled=false

Install Cert Manager

Install Cert Manager using Helm.

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
      cert-manager jetstack/cert-manager \
      --namespace cert-manager \
      --create-namespace \
      --version v1.15.3 \
      --set crds.enabled=true

Set GKE Standard Storage Class

Execute the following command to test PVC creation.

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-test
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: standard
  resources:
    requests:
      storage: 1Gi
EOF

Check the status of the PVC. If it is successfully created, the STATUS should be Bound.

kubectl get pvc pvc-test
NAME       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS              AGE
pvc-test   Bound    pvc-40b4e7fa-54e7-4d2b-be45-6b4e7e191b00   1Gi        RWO            standard                  16s