Skip to content

Commit 730d48c

Browse files
committed
Add GCP GKE documentation: include access and upgrade guides with detailed instructions for managing clusters and RBAC configurations.
1 parent 253e655 commit 730d48c

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed

docs/references/gcp_gke_access.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# GCP GKE Access
2+
3+
How to access GKE clusters generated by pltf.
4+
5+
## Kubeconfig
6+
1. Fetch outputs:
7+
```bash
8+
pltf terraform output -f env.yaml -e <env> --json
9+
```
10+
Note `k8s_cluster_name`, `k8s_endpoint`, and `k8s_ca_data` (output names may be prefixed if there are duplicates).
11+
2. Authenticate and update kubeconfig:
12+
```bash
13+
gcloud auth login
14+
gcloud container clusters get-credentials <cluster> \
15+
--region <region> \
16+
--project <project-id>
17+
```
18+
Use the same GCP project configured in your environment entry (`environments.<env>.account`).
19+
20+
Generated Terraform already configures Kubernetes and Helm providers using these outputs when you run `pltf terraform plan/apply`.
21+
22+
## Kubernetes RBAC
23+
GKE access is controlled by Kubernetes RBAC. Grant access via `ClusterRoleBinding` or `RoleBinding`.
24+
25+
Example cluster role binding:
26+
```yaml
27+
apiVersion: rbac.authorization.k8s.io/v1
28+
kind: ClusterRoleBinding
29+
metadata:
30+
name: platform-admins
31+
roleRef:
32+
apiGroup: rbac.authorization.k8s.io
33+
kind: ClusterRole
34+
name: cluster-admin
35+
subjects:
36+
- kind: User
37+
name: user@example.com
38+
apiGroup: rbac.authorization.k8s.io
39+
```
40+
41+
## Summary
42+
- Use `gcloud container clusters get-credentials` with cluster outputs to access the cluster.
43+
- Manage RBAC with Kubernetes bindings (Terraform/Helm if you want it in code).

docs/references/gcp_gke_upgrade.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# GCP GKE Upgrade
2+
3+
How to upgrade a GKE cluster created by pltf.
4+
5+
## Overview
6+
pltf configures the GKE release channel via `gke_channel` (RAPID, REGULAR, STABLE). Upgrades happen according to Google’s channel policy. You can also trigger manual upgrades with `gcloud`.
7+
8+
## Option 1: Change release channel (recommended)
9+
Update your spec:
10+
```yaml
11+
modules:
12+
- id: gke
13+
type: gcp_gke
14+
inputs:
15+
gke_channel: "REGULAR"
16+
```
17+
Then:
18+
```bash
19+
pltf terraform plan -f env.yaml -e prod
20+
pltf terraform apply -f env.yaml -e prod
21+
```
22+
23+
## Option 2: Manual upgrade with gcloud
24+
1. Inspect available versions:
25+
```bash
26+
gcloud container get-server-config --region <region>
27+
```
28+
2. Upgrade control plane:
29+
```bash
30+
gcloud container clusters upgrade <cluster> \
31+
--region <region> \
32+
--project <project-id>
33+
```
34+
3. Upgrade node pools:
35+
```bash
36+
gcloud container node-pools upgrade <node-pool> \
37+
--cluster <cluster> \
38+
--region <region> \
39+
--project <project-id>
40+
```
41+
42+
## Notes
43+
- Upgrade one minor version at a time.
44+
- Check add-on compatibility (CNI, ingress, metrics).
45+
- For private clusters, ensure your admin network can reach the control plane before upgrading.
46+
47+
## References
48+
- GKE upgrades: https://cloud.google.com/kubernetes-engine/docs/how-to/upgrading-a-cluster
49+
- Release channels: https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels

mkdocs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ nav:
104104
- Overview: references/aws.md
105105
- EKS Access: references/aws_eks_access.md
106106
- EKS Upgrade: references/aws_eks_upgrade.md
107+
- GCP:
108+
- Overview: references/gcp.md
109+
- GKE Access: references/gcp_gke_access.md
110+
- GKE Upgrade: references/gcp_gke_upgrade.md
107111
- Modules:
108112
- AWS:
109113
- aws_base: references/modules/aws_base.md
@@ -123,6 +127,17 @@ nav:
123127
- aws_sns: references/modules/aws_sns.md
124128
- aws_sqs: references/modules/aws_sqs.md
125129
- helm_chart: references/modules/helm_chart.md
130+
- GCP:
131+
- gcp_base: references/modules/gcp_base.md
132+
- gcp_dns: references/modules/gcp_dns.md
133+
- gcp_gcs: references/modules/gcp_gcs.md
134+
- gcp_gke: references/modules/gcp_gke.md
135+
- gcp_k8s_service: references/modules/gcp_k8s_service.md
136+
- gcp_mysql: references/modules/gcp_mysql.md
137+
- gcp_nodepool: references/modules/gcp_nodepool.md
138+
- gcp_postgres: references/modules/gcp_postgres.md
139+
- gcp_redis: references/modules/gcp_redis.md
140+
- gcp_service_account: references/modules/gcp_service_account.md
126141
- Examples:
127142
- ML Cluster: example/ml.md
128143
- Full Stack application: example/fsapp.md

0 commit comments

Comments
 (0)