GKE Extensions¶
Google Kubernetes Engine specific resources.
Models¶
Gateway¶
GatewaySpec
¶
Bases: BaseModel
GKE Gateway specification.
Example
GatewaySpec( ... name="main-gateway", ... namespace="gateway", ... gateway_class_name="gke-l7-global-external-managed", ... listeners=[{"name": "https", "port": 443, "protocol": "HTTPS"}], ... )
Source code in src/k8smith/gke/models.py
HTTPRoute¶
HTTPRouteSpec
¶
Bases: BaseModel
GKE HTTPRoute specification.
Example
HTTPRouteSpec( ... name="app-route", ... namespace="production", ... parent_refs=[{"name": "main-gateway", "namespace": "gateway"}], ... hostnames=["app.example.com"], ... rules=[{"matches": [{"path": {"value": "/"}}], "backendRefs": [...]}], ... )
Source code in src/k8smith/gke/models.py
HealthCheckPolicy¶
HealthCheckPolicySpec
¶
Bases: BaseModel
GKE HealthCheckPolicy specification.
Example
HealthCheckPolicySpec( ... name="app-healthcheck", ... namespace="production", ... target_ref={"group": "", "kind": "Service", "name": "app"}, ... config={"type": "HTTP", "httpHealthCheck": {"requestPath": "/health"}}, ... )
Source code in src/k8smith/gke/models.py
GCPBackendPolicy¶
GCPBackendPolicySpec
¶
Bases: BaseModel
GKE GCPBackendPolicy specification.
Example
GCPBackendPolicySpec( ... name="app-backend-policy", ... namespace="production", ... target_ref={"group": "", "kind": "Service", "name": "app"}, ... config={"timeoutSec": 30, "connectionDraining": {"drainingTimeoutSec": 60}}, ... )
Source code in src/k8smith/gke/models.py
PodMonitoring¶
PodMonitoringSpec
¶
Bases: BaseModel
GKE PodMonitoring specification (Cloud Monitoring).
Example
PodMonitoringSpec( ... name="app-monitoring", ... namespace="production", ... selector={"matchLabels": {"app": "web"}}, ... endpoints=[{"port": "metrics", "interval": "30s"}], ... )
Source code in src/k8smith/gke/models.py
ClusterPodMonitoring¶
ClusterPodMonitoringSpec
¶
Bases: BaseModel
GKE ClusterPodMonitoring specification.
Example
ClusterPodMonitoringSpec( ... name="cluster-monitoring", ... selector={"matchLabels": {"monitoring": "enabled"}}, ... endpoints=[{"port": "metrics", "interval": "60s"}], ... )
Source code in src/k8smith/gke/models.py
Builders¶
build_gateway(spec)
¶
Build a GKE Gateway resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
GatewaySpec
|
Gateway specification |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Gateway resource as a dict |
Source code in src/k8smith/gke/gateway.py
build_httproute(spec)
¶
Build a GKE HTTPRoute resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
HTTPRouteSpec
|
HTTPRoute specification |
required |
Returns:
| Type | Description |
|---|---|
dict
|
HTTPRoute resource as a dict |
Source code in src/k8smith/gke/httproute.py
build_healthcheckpolicy(spec)
¶
Build a GKE HealthCheckPolicy resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
HealthCheckPolicySpec
|
HealthCheckPolicy specification |
required |
Returns:
| Type | Description |
|---|---|
dict
|
HealthCheckPolicy resource as a dict |
Source code in src/k8smith/gke/healthcheck.py
build_gcp_backend_policy(spec)
¶
Build a GKE GCPBackendPolicy resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
GCPBackendPolicySpec
|
GCPBackendPolicy specification |
required |
Returns:
| Type | Description |
|---|---|
dict
|
GCPBackendPolicy resource as a dict |
Source code in src/k8smith/gke/backendpolicy.py
build_pod_monitoring(spec)
¶
Build a GKE PodMonitoring resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
PodMonitoringSpec
|
PodMonitoring specification |
required |
Returns:
| Type | Description |
|---|---|
dict
|
PodMonitoring resource as a dict |
Source code in src/k8smith/gke/monitoring.py
build_cluster_pod_monitoring(spec)
¶
Build a GKE ClusterPodMonitoring resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
ClusterPodMonitoringSpec
|
ClusterPodMonitoring specification |
required |
Returns:
| Type | Description |
|---|---|
dict
|
ClusterPodMonitoring resource as a dict |