EX180 OpenShift Flashcards

1
Q

create deployment

A

oc create deployment gitea –port 3030
–image=registry.ocp4.example.com:8443/redhattraining/podman-gitea:latest

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

bind or volume mount security options

A

Z, ro

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

Troubleshoot mount file permissions

A

1) podman unshare ls -l ~/www

2) podman run –rm image-url id -g

3) podman unshare chgrp -R 994 ~/www

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

Good DB practices

A

1) Use volume
2) Use private network instead of exposing port

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

How to load data into postgres

A

1) If PG container has psql, enter the container and use it
2) If it doesn’t have a psql then use a temp container in same network

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

Dum postgres db

A

pg_dump -Fc DATABASE -f BACKUP_DUMP

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

Import data into postgres

A

psql -U DATABASE_USER -h DATABASE_CONTAINER \
-d DATABASE_NAME -f /tmp/SQL_FILE

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

Display socket stats

A

podman exec -it CONTAINER ss -pant

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

Run the host ss command withing container namespace

A

sudo nsenter -n -t CONTAINER_PID ss -pant

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

Troubleshooting reachability

A

1) Check logs
2) Check port maps
3) Check port stats
4) if ss command missing then get PID and run ss with nsender
5) Check container binds on 0.0.0.0 instead of 127
6) Inspect container to see which network it uses
7) Inspect if DNS is enabled on network

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

Troubleshoot volume

A

1) Check permission on source folder with unshare
2) Check Z option ( ls -Zd /www). result should be container_type instead of default_type

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

Container PID

A

podman inspect CONTAINER –format ‘{{.State.Pid}}’

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