> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# GKE Cluster Setup

> Guide for creating a GKE cluster using the gcloud CLI.

## Create a GKE Cluster

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

```bash theme={null}
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.

```bash theme={null}
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
```

```bash theme={null}
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.

```bash theme={null}
helm repo add jetstack https://charts.jetstack.io
helm repo update
```

```bash theme={null}
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.

```bash theme={null}
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-test
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: standard
  resources:
    requests:
      storage: 1Gi
EOF
```

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

  ```bash theme={null}
  kubectl get pvc pvc-test
  ```

  ```bash theme={null}
  NAME       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS              AGE
  pvc-test   Bound    pvc-40b4e7fa-54e7-4d2b-be45-6b4e7e191b00   1Gi        RWO            standard                  16s
  ```
</Note>
