Files
my-rook-config/tests/scripts/tmate-pod.yaml
T
Blaine Gardner e58b09c01c test: add tmate pod manifest
Add a tmate manifest that can be added to CI tests to allow manually
debugging them in real-time while the test is ongoing.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2023-05-19 16:59:23 -06:00

80 lines
1.7 KiB
YAML

# Apply this manifest to CI clusters to allow debugging complex failures during CI runs
#
# Usage:
# kubectl apply -f tests/scripts/tmate-pod.yaml
# kubectl -n tmate wait --for=condition=ready -l app=tmate pod --timeout=300
# sleep 1 # just in case tmate hasn't output its web/ssh links yet
# kubectl -n tmate logs deploy/tmate
apiVersion: v1
kind: Namespace
metadata:
name: tmate
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tmate
namespace: tmate
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: allow-all
rules:
- apiGroups:
- "*"
resources:
- "*"
verbs:
- "*"
- nonResourceURLs:
- "*"
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tmate-allow-all
subjects:
- kind: ServiceAccount
name: tmate
namespace: tmate
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: allow-all
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tmate
namespace: tmate
spec:
selector:
matchLabels:
app: tmate
template:
metadata:
labels:
app: tmate
spec:
serviceAccountName: tmate
containers:
- name: tmate
image: quay.io/fedora/fedora:39
command:
- sh
- -c
- |
dnf install -y tmate kubernetes-client bash vim
tmate -F -S /var/tmp/tmate.sock
resources: {}
readinessProbe:
exec:
# return ready only when the tmate socket exists -- when tmate is officially running
command:
- ls
- /var/tmp/tmate.sock