Files
my-rook-config/pkg/daemon/multus/client-daemonset.yaml
T
Blaine Gardner 8bb189c5c8 test: add multus validation test routine to rook binary
Add a more involved multus validation test to the Rook binary. Because
this is intended to be end-user runnable, make sure operator-only
commands are hidden.

Build this into the rook binary instead of creating a separate binary
for ease, and because any binary built with the kube api becomes 40+
megabytes. We save quite a bit of space by including this in the Rook
binary, which is good for keeping container layers as small as possible.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit 0f6e7ee921)
2023-05-02 17:38:10 +00:00

64 lines
2.4 KiB
YAML

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: multus-validation-test-client-{{ .ClientID }}
labels:
app: multus-validation-test-client
app.kubernetes.io/name: "client"
app.kubernetes.io/instance: "client-{{ .ClientID }}"
app.kubernetes.io/component: "client"
app.kubernetes.io/part-of: "multus-validation-test"
app.kubernetes.io/managed-by: "rook-cli"
spec:
selector:
matchLabels:
app: multus-validation-test-client
clientID: "{{ .ClientID }}"
template:
metadata:
labels:
app: multus-validation-test-client
clientID: "{{ .ClientID }}"
annotations:
k8s.v1.cni.cncf.io/networks: "{{ .NetworksAnnotationValue }}"
spec:
# TODO: selectors, affinities, tolerations
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
{{ range $name, $address := .NetworkNamesAndAddresses }}
- name: readiness-check-web-server-{{ $name }}-addr
# use nginx image because it's already pulled for the nginx pod and has a non-root user
image: nginx:stable-alpine
command:
- sleep
- infinity
resources: {}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
# A readiness probe makes validation testing easier than investigate container logs.
# Additionally, readiness probe failures don't result in CrashLoopBackoff -- ideal here,
# where ever-longer back-offs would cause tests to run for much longer than necessary.
readinessProbe:
# Low failure threshold and high success threshold. Intended to be very sensitive to
# failures. If probe fails with any regularity, Ceph OSDs likely won't be stable.
failureThreshold: 1
successThreshold: 12
periodSeconds: 5
# Assumption: a network with a latency more than 4 seconds for this validation test's
# simple client-server response likely won't support acceptable performance for any
# production Ceph cluster.
timeoutSeconds: 4
# TODO: exec:curl works but httpGet fails. Why? need custom header?
exec:
command:
- "curl"
- "--insecure"
- "{{ $address }}:8080"
{{ end }}