Openshift Flashcards

1
Q

Is storage class name spaced

A

Storage class is not namespaced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does Nutanix csi operator used for

A

Operator monitors for a CRD named nutanixcsistorages, when a CRD is created of this type in the same namespace as the operator, it installs csi driver.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some of custom resources created by the operator

A

nutanixcsistorages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can you have two csi drivers create 2 different nutanixcsistorages crd in different namespace

A

No it will not work as there are some common resources that the new installation will try to create and fail with release failed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how do you list all the resources created by custom CRD

A

oc api-resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Cmd to add a cluster role to a user

A

oc adm policy add-cluster-role-to-user ROLE username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Cmd to add a local role binding to a user

A

From the local project
oc policy add-role-to-user ROLE Username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Add a local role to service account

A

From the local project
oc policy add-role-to-user ROLE -z <svc_account_name></svc_account_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

add a local role to a group

A

From the local project
oc policy add-role-to-group ROLE groupname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how do you remove a user or group from current project

A

From the correct project
oc policy remove-user username
oc policy remove-group groupname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Find the user account that can perform a certain action in the project

A

oc policy who-can <action> <resource></resource></action>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how to add scc to a user or gruop

A

oc adm policy add-scc-to-user <username>
oc adm policy add-scc-to-group <groupname></groupname></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

create a new group with 2 usrs

A

oc adm groups new <grpname> <user1> <user2></user2></user1></grpname>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

set env variables from a secret and the variables should be prefixed with DB_

A

oc set env deploy/<name> --from secret/<secret_name> --prefix DB_</secret_name></name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List all the env variables in a deployment

A

oc set env deploy/<name> --list</name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Set env from a local file

A

oc set env RT/RN -f <file></file>

17
Q

Set env with key value pairs

A

oc set env RT/RN -e key=value -e key1=value1

18
Q

Remove an env variable named key from resource

A

oc set env RT/RN [–all] key-

19
Q

set env variables on certain containers

A

oc set env RT/RN -c “ctr_name” -e key1=value1

20
Q

What is the command to create a resource quota with limits for cpu set to 2 and memory is 2Gi

A

oc create quota <name> --hard limits.cpu=2,limits.memory=2Gi</name>

21
Q

What is the command to create a quota with requests cpu set to 1 and requests memory to 100Mi

A

oc create quota <name> --hard cpu=1,memory=100Mi</name>

22
Q

how to create a new template for project and which ns

A

oc create -f <templatefile> -n openshift-config</templatefile>

23
Q

List all tags in image stream or repository

A

skopeo inspect docker://<image_name></image_name>

24
Q

How to upload a local image to an internal registry

A

podman tag <localimage:tag> <registry_ip>:<port>/<image_name>:<tag></tag></image_name></port></registry_ip></localimage:tag>

25
Q

How to create a private registry auth info as username and password

A

oc create secret docker-registry –docker-server <quay.io> --docker-username <uname> --docker-password <pwd></pwd></uname></quay.io>

Link the secret to the service account

oc secrets link <svc_account_name> <secret_name> --for pull</secret_name></svc_account_name>

26
Q

How to list users added to cluster-admin role

A

for i in `oc get clusterrolebindings | awk ‘/cluster-admin/{print $1}’;do echo ==$i==; oc get clusterrolebindings $i -o yaml |grep -A1 User;done

27
Q

How do you remove kubeadmin user from system

A

oc delete secret kubeadmin -n kube-system

28
Q

how to check internal registry name

A

oc get images.config.openshift.io/cluster -o yaml | grep -i hostname

29
Q

how to check pod cidr and service cidr in cluster

A

oc get networks.config.openshift.io/cluster -o yaml

30
Q

how to check project templates configured in openshift cluster

A

oc get projects.config.openshift.io/cluster -o yaml

31
Q

how to list all the configurations related to cluster

A

oc api-resources –api-group config.openshift.io

32
Q

How to check API server internal and external url

A

oc get infrastructures.config.openshift.io/cluster -o yaml

33
Q

how to check all the trusted CA configured in the proxies

A

oc get proxies.config.openshift.io/cluster -o yaml

34
Q

how to check the console url from config

A

oc get consoles.config.openshift.io/cluster -o yaml

35
Q

How to list operator hub sources configured in the cluster

A

oc get operatorhubs.config.openshift.io/cluster -o yaml

36
Q

how to check and modify if master nodes are schedulable

A

oc get schedulers.config.openshift.io cluster -o yaml

37
Q

How to list all the tags for an image using skopeo

A

skopeo list-tags docker://quay.io/<image_name></image_name>