Skip to content

Instantly share code, notes, and snippets.

@cardil
Created July 5, 2023 17:57
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 cardil/71c1e291ec65507d9902e9a87401994d to your computer and use it in GitHub Desktop.
Save cardil/71c1e291ec65507d9902e9a87401994d to your computer and use it in GitHub Desktop.
Ubi8 shell for K8s
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: shell-cluster-admin
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: shell-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: shell-cluster-admin
namespace: REPLACE-ME
---
# kubectl apply -f ubi8-k8s-shell.yml
# kubectl exec -it shell
kind: Pod
apiVersion: v1
metadata:
name: shell
labels:
purpose: manual-inspection
spec:
containers:
- name: shell-ubi8
image: registry.access.redhat.com/ubi8/ubi-minimal
command: ["/usr/bin/bash", "-c", "while true; do sleep 10; done"]
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "2Gi"
cpu: "1"
serviceAccount: shell-cluster-admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment