Skip to content

Instantly share code, notes, and snippets.

@MayankFawkes
Last active October 25, 2023 13:03
Show Gist options
  • Save MayankFawkes/ec99568e3e8eb39820a994fe8d9d1837 to your computer and use it in GitHub Desktop.
Save MayankFawkes/ec99568e3e8eb39820a994fe8d9d1837 to your computer and use it in GitHub Desktop.
k8s testing yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
spec:
selector:
matchLabels:
run: hello-world-selector
replicas: 2
template:
metadata:
labels:
run: hello-world-selector
spec:
containers:
- name: hello-world
image: strm/helloworld-http
ports:
- containerPort: 80
protocol: TCP
resources:
requests:
cpu: 500m
---
apiVersion: v1
kind: Service
metadata:
name: hello-world-svc
spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
selector:
run: hello-world-selector
type: LoadBalancer
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: hello-world-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: hello-world
minReplicas: 2
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: default-path
spec:
ingressClassName: public
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello-world-svc
port:
number: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment