Skip to content

Instantly share code, notes, and snippets.

@mark-church
Last active January 10, 2022 13:53
Show Gist options
  • Save mark-church/28ded2812e8be06f6f8345c6b041b251 to your computer and use it in GitHub Desktop.
Save mark-church/28ded2812e8be06f6f8345c6b041b251 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: store-autoscale
spec:
replicas: 2
selector:
matchLabels:
app: store-autoscale
template:
metadata:
labels:
app: store-autoscale
spec:
containers:
- name: whereami
image: gcr.io/google-samples/whereami:v1.2.2
ports:
- containerPort: 8080
---
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: store-autoscale
spec:
gatewayClassName: gke-l7-gxlb
listeners:
- protocol: HTTP
port: 80
routes:
kind: HTTPRoute
selector:
matchLabels:
gateway: store-autoscale
---
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: store-autoscale
labels:
gateway: store-autoscale
spec:
rules:
- forwardTo:
- serviceName: store-autoscale
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: store-autoscale
annotations:
networking.gke.io/max-rate-per-endpoint: "10"
spec:
ports:
- port: 8080
targetPort: 8080
name: http
selector:
app: store-autoscale
type: ClusterIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment