Created
October 25, 2024 05:49
-
-
Save tpai/d20cd63c6692d8f67fa46e6d29cbf4b9 to your computer and use it in GitHub Desktop.
kubernetes summit 2024 code snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: delayed-http-response-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: delayed-http-response | |
template: | |
metadata: | |
labels: | |
app: delayed-http-response | |
spec: | |
containers: | |
- name: delayed-http-response | |
image: deminy/delayed-http-response | |
ports: | |
- containerPort: 80 | |
readinessProbe: | |
httpGet: | |
path: /sleep/2 | |
port: 80 | |
livenessProbe: | |
httpGet: | |
path: /sleep/2 | |
port: 80 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: delayed-http-response-service | |
spec: | |
selector: | |
app: delayed-http-response | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 80 | |
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl --request POST --url http://localhost:8080/consume-mem --data megabytes=16384 --data durationSec=60 | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: resource-consumer-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: resource-consumer | |
template: | |
metadata: | |
labels: | |
app: resource-consumer | |
spec: | |
containers: | |
- name: resource-consumer | |
image: dj80hd/resource-consumer | |
ports: | |
- containerPort: 8080 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: resource-consumer-service | |
spec: | |
selector: | |
app: resource-consumer | |
ports: | |
- protocol: TCP | |
port: 8080 | |
targetPort: 8080 | |
type: ClusterIP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment