Created
July 5, 2023 17:57
-
-
Save cardil/71c1e291ec65507d9902e9a87401994d to your computer and use it in GitHub Desktop.
Ubi8 shell for K8s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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