Skip to content

Instantly share code, notes, and snippets.

@obervinov
Created April 9, 2024 14:04
Show Gist options
  • Save obervinov/4eeaee1b203f91f5fe8ccc33c12a1cf4 to your computer and use it in GitHub Desktop.
Save obervinov/4eeaee1b203f91f5fe8ccc33c12a1cf4 to your computer and use it in GitHub Desktop.
HTTPBin deployment + service + sa for testing communications between services in kubernetes
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: httpbin
...
---
apiVersion: v1
kind: Service
metadata:
name: httpbin
labels:
app: httpbin
service: httpbin
spec:
ports:
- name: http
port: 8000
targetPort: 80
selector:
app: httpbin
...
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpbin
spec:
replicas: 1
selector:
matchLabels:
app: httpbin
version: v1
template:
metadata:
labels:
app: httpbin
version: v1
spec:
serviceAccountName: httpbin
containers:
- image: kong/httpbin
imagePullPolicy: IfNotPresent
name: httpbin1
ports:
- containerPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment