-
Notifications
You must be signed in to change notification settings - Fork 2
Lab‐7: Deploying privileged container using SCC
STEP-1 Create a namespace/project to deploy the application
[student@servera ~]$ oc create namespace test500
STEP-2 Switch to test500 namespace.
[student@servera ~]$ oc config set-context --namespace test500 --current
STEP-3 Ensure that you are in test500 project/namespace.
[student@servera ~]$ oc project
STEP-4 Create a test5 deployment resource.
[student@servera ~]$ oc create deployment test5 --image quay.io/anandpavithran/infosys:no
STEP-5 Watch the resources created. It will show errors.
[student@servera ~]$ oc get all
STEP-6 Inspect the resoucrces.
[student@servera ~]$ oc describe pod test5-xxxxx|grep scc
**[student@servera ~]$ oc describe replicaset/test5-xxxx | grep scc **
STEP-7 Take the backup of namespace test500 for comparing and delete the namespace.
[student@servera ~]$ oc get namespace test500 -o yaml > test500-project.yaml
[student@servera ~]$ oc delete namepspace test500
STEP-8 Create namespace test500 again.Download the file from https://github.com/anandpavithran/microshift/test500-project.yaml
[student@servera ~]$ oc apply -f test500-project.yaml
STEP-9 Set the SCC to run with anyuid in test500 project and deploy the application.Verify also
[student@servera ~]$ oc adm policy add-scc-to-user anyuid -z default
[student@servera ~]$ oc create deployment test5 --image quay.io/anandpavithran/infosys:no
**[student@servera ~]$ oc describe pod test5-xxxx | grep scc **
STEP-10 Enter the pod and execute 'id' command.
[student@servera ~]$ oc rsh test5-xxx
sh-4.4$ id
STEP-11 Delete the namespace test500.
[student@servera ~]$ oc delete namespace test500