Created
April 25, 2023 04:40
-
-
Save jkeam/e80f0841b493bbf7b7004a4048f731b9 to your computer and use it in GitHub Desktop.
Deploy vista on OCP
This file contains hidden or 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
#!/bin/bash | |
# create namespace | |
oc new-project vista | |
# sa | |
# can use default, this is convenient but not best practice | |
# oc adm policy add-scc-to-user anyuid -z default | |
oc create sa root | |
oc adm policy add-scc-to-user privileged -z root | |
oc adm policy add-scc-to-user anyuid -z root | |
# deploy app | |
oc new-app --image=docker.io/worldvista/foiavista | |
# patch deployments to allow privileged | |
oc patch deployment foiavista -p '{"spec":{"template":{"spec":{"containers":[{"name":"foiavista","securityContext":{"privileged":true, "runAsNonRoot": false, "allowPrivilegeEscalation": true}}]}}}}' | |
# set sa to use for deployment | |
oc set sa deploy foiavista root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment