Moving From Kubernetes to OpenShift Flashcards

1
Q

File updated by oc login

A

~/.kube/config

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

What is the structure of ~/.kube/config

A

1) Clusters (name, server, insure)
2) Contexts (server, namespace, user)
2) Users (name, token)

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

Command for inspecting login contexts

A

oc config get-contexts

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

Command to switch login contexts

A

oc config use-context

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

Command to create a login contexts

A

oc config set-context

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

Using kubectl CLI and the provided manifest, to create a namespace

A

kubectl create -f ns.yml

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

Using kubectl find the ingresses in a namespace

A

kubectl get ingresses.v1.networking.k8s.io

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

Using kubectl apply customization

A

kubectl apply -k overlays/prod

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

Content of kustomization.yml that changes the image tag of a deployment

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

In one single command display list of deployments, pods, and services

A

oc get deployments,pods,services

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

Using jq, identify the container image specified by the deployment

A

oc get deployment/hello -o json | jq ‘.spec.template.spec.containers[0].image’

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

Using jsonpath, identify the container image specified by the deployment

A

oc get deployment/hello -o jsonpath=’{.spec.template.spec.containers[].image}{“\n”}’

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

Duplicate an image in quay.io

A

skopeo copy \
docker://quay.io/redhattraining/versioned-hello:v1.0 \
docker://quay.io/your_account/versioned-hello:latest

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

Import the image from quay.io, and enable periodically scheduled imports.

A

oc import-image \
quay.io/your_account/versioned-hello:latest –confirm –scheduled

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

Add a stream trigger to a deployment

A

oc set triggers deployment/hello \
–from-image versioned-hello:latest -c hello

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

Verify if a deployment has a stream trigget

A

oc get deployment/hello -o json | \
jq ‘.metadata.annotations’