Skip to content

Instantly share code, notes, and snippets.

@memory
Created July 11, 2019 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memory/21cf2a81637253889f8fe3b11e4e3bc8 to your computer and use it in GitHub Desktop.
Save memory/21cf2a81637253889f8fe3b11e4e3bc8 to your computer and use it in GitHub Desktop.
---
kind: ConfigMap
apiVersion: v1
metadata:
name: gethello
data:
gethello.sh: |
while true; do
echo checking http://hello-0.hello.default.svc.cluster.local/
curl -o /dev/null -s -w "%{http_code}\n" http://hello-0.hello.default.svc.cluster.local/
echo checking http://hello-1.hello.default.svc.cluster.local/
curl -o /dev/null -s -w "%{http_code}\n" http://hello-1.hello.default.svc.cluster.local/
echo checking http://hello-2.hello.default.svc.cluster.local/
curl -o /dev/null -s -w "%{http_code}\n" http://hello-2.hello.default.svc.cluster.local/
sleep 3
done
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
app: gethello
name: gethello
spec:
replicas: 1
template:
metadata:
labels:
app: gethello
name: gethello
annotations:
linkerd.io/inject: disabled
spec:
containers:
- name: gethello
image: jessecollier/curl-alpine
imagePullPolicy: Always
command: ["/bin/sh"]
args:
- "/tmp/gethello/gethello.sh"
volumeMounts:
- name: gethello
mountPath: /tmp/gethello
volumes:
- name: gethello
configMap:
name: gethello
items:
- key: gethello.sh
path: gethello.sh
---
kind: Service
apiVersion: v1
metadata:
name: hello
labels:
app: hello
service: hello
spec:
clusterIP: None
ports:
- name: hello
port: 80
targetPort: hello
selector:
app: hello
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: hello
labels:
app: hello
spec:
replicas: 3
serviceName: hello
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
annotations:
linkerd.io/inject: disabled
spec:
containers:
- name: hello
image: gcr.io/hightowerlabs/helloworld:3.0.0
ports:
- containerPort: 8080
name: hello
args:
- "-http=127.0.0.1:8080"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment