Skip to content
Prev Previous commit
Next Next commit
Oddly /run/secrets doesn't get mounted
  • Loading branch information
solsson committed Aug 2, 2017
commit 56f0f9ce51c9119d29b4fd9b146fbe39f1d0e389
1 change: 1 addition & 0 deletions 01rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: ServiceAccount
metadata:
name: kafka
namespace: kafka
automountServiceAccountToken: true
---
# Sufficient rights to look up self's pod description and pod's node description
kind: ClusterRole
Expand Down
77 changes: 77 additions & 0 deletions test/rack-awareness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
kind: ConfigMap
metadata:
name: test-rack-awareness
# To test using the service account we need to be in the kafka namespace for now
namespace: kafka
apiVersion: v1
data:

setup.sh: |-
touch /tmp/testlog

tail -f /tmp/testlog

continue.sh: |-
exit 0

run.sh: |-
exec >> /tmp/testlog
exec 2>&1

exit 0

---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: test-rack-awareness
# To test using the service account we need to be in the kafka namespace for now
namespace: kafka
spec:
replicas: 1
template:
metadata:
labels:
test-target: kafka
test-type: readiness
spec:
serviceAccountName: kafka
containers:
- name: testcase
image: solsson/curl@sha256:8c0c5d669b3dd67932da934024252af59fb9d0fa0e5118b5a737b35c5e1487bf
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
# Test set up
command:
- /bin/bash
- -e
- /test/setup.sh
# Test run, again and again
readinessProbe:
exec:
command:
- /bin/bash
- -e
- /test/run.sh
# Test quit on nonzero exit
livenessProbe:
exec:
command:
- /bin/bash
- -e
- /test/continue.sh
volumeMounts:
- name: config
mountPath: /test
volumes:
- name: config
configMap:
name: test-rack-awareness