Networking Flashcards

1
Q

review the configuration of the DNS operator

A

oc describe dns.operator/default

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

Expose a service so it is accessible with a given hostname

A

oc expose service api-frontend –hostname api.apps.acme.com

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

create a secure edge route with a TLS certificate

A

oc create route edge
–service api-frontend
–hostname api.apps.acme.com
–key api.key
–cert api.crt

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

Create the network policy

A

oc create -n network-policy -f allow-specific.yaml

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

View the network policies in the network-policy namespace

A

oc get networkpolicies -n network-policy

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

apply the name=network-test label to a namespace

A

oc label namespace network-test name=network-test

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

label a node with env=dev

A

oc label node master01 env=dev

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

change an existing label

A

oc label node master01 env=prod –overwrite

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

Remove a label

A

oc label node master01 env-

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

see labels assigned to a node

A

oc get node master02 –show-labels

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

determine the value of a single label for a node

A

oc get node -L failure-domain.beta.kubernetes.io/region

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

Get list of machines

A

oc get machines -n openshift-machine-api -o wide

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

Get list of machine sets

A

oc get machineset -n openshift-machine-api

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

edit a machine set

A

oc edit machineset ocp-qz7hf-worker-us-west-1b -n openshift-machine-api

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

configure app so that its pods only run on nodes with label env=qa

A

oc patch deployment/myapp –patch \
> ‘{“spec”:{“template”:{“spec”:{“nodeSelector”:{“env”:”dev”}}}}}’

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

creates a new project named demo, where all pods will be deployed to nodes that have the label of tier=1

A

oc adm new-project demo –node-selector “tier=1”

17
Q

configure a default node selector for an existing project

A

oc annotate namespace demo \
> openshift.io/node-selector=”tier=2” –overwrite

18
Q

scaled number of pods in a deployment to three

A

oc scale –replicas 3 deployment/myapp

19
Q

Import content of file into mysql

A

mysql -u root items < /tmp/db-data.sql

20
Q

How do you print a service IP and nothing else

A

oc get service/mysql -o jsonpath=”{.spec.clusterIP}”

21
Q

Connect to mysql using curl

A

curl -v telnet://172.30.103.29:3306

22
Q

How do you retrieve the internal IP of a POD

A

oc get pods -o wide

23
Q

Troubleshooting steps frontend-mysql

A

1) Get mysql external and internal IP addresses
2) Start debug frontend pod
3) From debug frontend pod check if mysql is reachable
4) Get frontend IP address
5) Start debug mysql pod
6) From debug mysql pod, check if frontend is reachable
7) Review frontend service: check selector, check endpoint

24
Q

Network policy to deny all pods network in the namespace

A
25
Q

Network policy to allow traffic to hello pod in the network-policy namespace from sample-app pod in network-test namespace over TCP on port 8080.

A
26
Q

Network policy to allow trafic from default ingress controller

A
27
Q

Second step to allow traffic from default ingress control

A

put label on default namespace that contains default ingress controller:

oc label namespace default network.openshift.io/policy-group=ingress

28
Q

Remove the label env from all nodes

A

oc label node -l env env-

29
Q

Create secure route

A

oc create route edge todo-https
–service todo-http
–hostname todo-https.apps.ocp4.example.com

30
Q

Get svc IP

A

oc get svc -o wide

31
Q

Create a debug pod for the todo-http deployment using specific image

A

oc debug deployment/todo-http –image registry.access.redhat.com/ubi8/ubi:8.4