5. 1 Networking For Applications Flashcards

1
Q

Que significa SDN

A

Openshift Software-defined networking

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

Cuales son los 5 requerimientos que satisface el SDN

A

Manejar tráfico de red programática mente
Manejar comunicación entre contenedores del mismo proyecto
Manejar comunicación entre pods del mismo u otro proyecto
Manejar comunicación se un pod a un servicio
Manejar comunicación entre una red externa a servicio o de contenedores a redes externas

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

Que es CNI

A

Container network interface

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

Como se crea un recurso desde un archivo todo.yaml

A

oc create -f todo.yaml

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

Como se copia un archivo llamado test.txt dentro del pod mypod a la ruta /tmp

A

oc cp test.txt mypod:/tmp

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

Como nos firmamos por ssh al pod mysql-73 con bash mysql-73-bdhfo1h-hhdj

A

oc rsh mysql-73-bdhfo1h-hhdj /bin/bash

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

Como se expone el servicio de la app frontend en el hostname todo.apps.ocp4.example.com

A

oc expose service/frontend –hostname todo.apps.ocp4.example.com

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

Como se validan los servicios expuestos

A

oc get routes

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

Como se ven los logs del pod frontend para corregir el problema de red

A

oc logs PODNAME

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

Como obtener ip de cluster del servicio frontend usando jsonpath

A

oc get service/frontend -o jsonpath=“{.spec.clusterIP}{‘\n’}”

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

Como se hace crea una imagen de debug del deployment MySQL imagen registry.access.redhat.com/ubi8/ubi:8.0

A

oc debug -t deployment/mysql –image registry.access.redhat.com/ubi8/ubi:8.0

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

Como se hace la validación de aplicación por curl al puerto 8080

A

curl -m 10 -v http://clusterIP:8080

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

Como nos conectamos a un pod por su ip privada

A

oc get pods -o wide -l name=frontend

debug pod -t deployment/ MySQL –image registry example

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

Como se obtienen los servicios

A

oc get svc

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

Como podemos ver la información del servicio frontend

A

oc describe svc/frontend

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

Como se ve la información de Labels y una linea posterior de despliegue

A

oc describe deployment/frontend | grep Labels -A1

17
Q

Como se edita un servicio

A

oc edit svc/frontend

18
Q

Como se modifica el selector name de un servicio

A

oc edit svc/frontend

19
Q

Proceso completo para troubleshooting de red

A
  1. Crear deployments frontend/mysql y servicios
  2. Obtener logs de pod de app
  3. Obtener ip de mysql, debug a pod frontend, curl a mysql service
  4. Obtener ip de frontend, debug a pod mysql, curl a frontend
  5. Obtener ip interna de frontend, debug a pod mysql, curl a ipinterna y puerto interno.
  6. Describir servicio de frontend para mostrar el selector, endpoints
  7. Editar servicio frontend y cambiar selector por el correcto
  8. Prueba de url de servicio frontend
20
Q

Estructura de servicio en yaml

A

kind: service
apiVersion: v1
metadata:
name: application-frontend
labels:
app: frontend-svc
spec:
ports:
- name: HTTP
protocol: TCP
port: 443
targetPort: 8443
selector:
app: shopping-cart
name: frontend
type:ClusterIP

21
Q

Como se muestra el operador de dns

A

oc describe DNS.operator/default

22
Q

Cuales son los servicios que DNS resuelve

A

A para servicios SRV port

23
Q

Como obtener el cluster domain e ip

A

oc describe dns.operator/default

Status:
Cluster Domain: cluster.local
Cluster IP: 172.30.0.10

24
Q

Como te puedes firmar al pod por ssh example-6c4984d949-7m26r

A

oc rsh example-6c4984d949-7m26r \
> curl hello.test.svc.cluster.local:8080

25
Q

Que estructura de servicio crea CoreDNS por defecto

A

_port-name._port-protocol.svc-name.namespace.svc.cluster-domain.cluster-domain.

Ejemplo
_443-tcp._tcp.https.frontend.svc.cluster.local.

26
Q

Que es OVN kubernetes

A

Open Virtual Network para kubernetes

27
Q

Openshift SDN
OVN-kubernetes
Kuryr son ejemplos de

A

default network providers

28
Q

Como se obtiene la configuracion del network cluster en yaml

A

oc get network/cluster -o yaml

apiVersion: config.openshift.io/v1
kind: Network
…output omitted…
spec:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
externalIP:
policy: {}
networkType: OpenshiftSDN
serviceNetwork:
- 172.30.0.0/16
…output omitted…

29
Q

Que es CIDR

A

Classless Inter-Domain Routing

30
Q

Como se diagnostica un error de red en dos pods frontend y mysql

A

oc expose service frontend –hostname todo.apps.ocp4.example.com

oc get routes

ver logs

oc logs frontend-57b8b445df-f56qh
App is ready at : 8080

Obtener IP de mysql
oc get service/mysql -o jsonpath=”{.spec.clusterIP}{‘\n’}”

Crear debug pod desde frontend app
oc debug -t deployment/frontend

Telnet hacia mysql
curl -v telnet://172.30.103.29:3306
——————————————
Obtener ip de frontend service
oc get service/frontend -o jsonpath=”{.spec.clusterIP}{‘\n’}”

Crear pod debug de mysql
oc debug -t deployment/mysql –image registry.access.redhat.com/ubi8/ubi:8.4

curl hacia aplicacion frontend
curl -m 10 -v http://172.30.23.147:8080

  • Rebuilt URL to: http://172.30.23.147:8080/
  • Trying 172.30.23.147…
  • TCP_NODELAY set
  • Connection timed out after 10000 milliseconds
  • Closing connection 0
    curl: (28) Connection timed out after 10000 milliseconds

Como obtener la ip privada de la app frontend para comprobar si el servicio esta abajo o es solo la red

oc get pods -o wide -l name=frontend

NAME READY STATUS RESTARTS AGE IP …
frontend-57b8b445df-f56qh 1/1 Running 0 39m 10.128.2.61 …

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

curl -v http://10.128.2.61:8080/todo

  • Trying 10.128.2.61…
  • TCP_NODELAY set
  • Connected to 10.128.2.61 (10.128.2.61) port 8080 (#0)
    > GET /todo/ HTTP/1.1
    > Host: 10.128.2.61:8080
    > User-Agent: curl/7.61.1
    > Accept: /
    >
    < HTTP/1.1 200 OK
    …output omitted…

Comprobar configuracion de frontsend service
oc get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend ClusterIP 172.30.23.147 <none> 8080/TCP 93m
mysql ClusterIP 172.30.103.29 <none> 3306/TCP 93m</none></none>

[student@workstation network-sdn]$ oc describe svc/frontend
Name: frontend
Namespace: network-sdn
Labels: app=todonodejs
name=frontend
Annotations: <none>
Selector: name=api
Type: ClusterIP
IP: 172.30.23.147
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
Endpoints: <none>
Session Affinity: None
Events: <none></none></none></unset></none>

oc describe deployment/frontend | \
> grep -A1 Labels
Labels: app=todonodejs
name=frontend

Labels: app=todonodejs
name=frontend

oc edit svc/frontend
[student@workstation network-sdn]$ oc describe svc/frontend
Name: frontend
Namespace: network-sdn
Labels: app=todonodejs
name=frontend
Annotations: <none>
Selector: name=frontend
Type: ClusterIP
IP: 172.30.169.113
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
Endpoints: 10.128.2.61:8080
Session Affinity: None
Events: <none></none></unset></none>

31
Q

Como se forma un yaml de una ruta

A

kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: a-simple-route 1
labels: 2
app: API
name: api-frontend
spec:
host: api.apps.acme.com 3
to:
kind: Service
name: api-frontend 4
port: 5
targetPort: 8443

32
Q

Como se genera una ruta del servicio api-frontend con hostname api.apps.acme.com key api.key y cert

A

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

33
Q

Como se establece un certificado mountado desde un volumen en modo lectura

A

volumeMount:
- name: tls-certs
readOnly: true
mountPath: /usr/local/etc/ssl/ssl

  • volumes:
  • name: tls_certs
  • secret:
  • secretName: