Skip to content

Instantly share code, notes, and snippets.

@jkeam
Created April 25, 2023 04:40
Show Gist options
  • Save jkeam/e80f0841b493bbf7b7004a4048f731b9 to your computer and use it in GitHub Desktop.
Save jkeam/e80f0841b493bbf7b7004a4048f731b9 to your computer and use it in GitHub Desktop.
Deploy vista on OCP
#!/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