4.3 Scale and Expose Applications to External Access Flashcards

1
Q

Como se expone externamente un servicio api-frontend en el hostname api.apps.acme.com

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
2
Q

Cual es la estructura por default de nombrado de DNS

A

<route-name>-<project-name>.<default-domain>
</default-domain></project-name></route-name>

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

Estructura de yaml Route

name: a-simple-route
labels
app: API
name: api-frontend
host: api.apps.acme.com
name: api-frontend
port: 8080
targetPort: 8443

A

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

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

Como se elimina una ruta ejemplo myapp-route

A

oc delete route myapp-route

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

estructura yaml de un tipo ingress

A

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: frontend
spec:
rules:
- host: “www.example.com
http:
paths:
- backend:
service:
name: frontend
port:
number: 80
pathType: Prefix
path: /
tls:
- hosts:
- www.example.com
secretName: example-com-tls-certificate

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

Como se crea un ingress con oc nombre ingr-sakila y regla ingr-sakila.apps.ocp4.example.com a puerto 8080

A

oc create ingress ingr-sakila \
–rule=”ingr-sakila.apps.ocp4.example.com/*=sakila-service:8080”

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

Como eliminar un recurso ingress example-ingress

A

oc delete ingress example-ingress

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

Como se configura cookie sticky session en ingress example-ingress

A

oc annotate ingress ingr-example \
ingress.kubernetes.io/affinity=cookie

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

Como se configura cookie sticky session

A

oc annotate route route-example \
router.openshift.io/cookie_name=myapp

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

Como se obtiene el host de la ruta route_name

A

oc get route <route_name> -o jsonpath='{.spec.host}'</route_name>

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

Como se escala a 5 replicas el deployment scale

A

oc scale –replicas 5 deployment/scale

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

Como se crea deployment de mysql

A

oc create deployment mysql-app –image registry.ocp4.example.com:8443/redhattraining/mysql-app:v1

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

Como se setean variables a un deployment cuando este las necesite:

MYSQL_USER redhat
MYSQL_PASSWORD redhat123
MYSQL_DATABASE world_x

A

oc set env deployment/mysql-app MYSQL_USER=redhat MYSQL_PASSWORD=redhat123 MYSQL_DATABASE=world_x

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

Como se carga una base de datos mysql de un contenedor mysql y con los datos en /tmp/world_x.sql

A

/bin/bash -c “mysql -uredhat -predhat123 </tmp/world_x.sql”

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

Como se expone un servicio de un deployment php-app name php-svc
puerto 8080
target port 8080

A

oc expose deployment php-app –name php-svc
–port 8080 –target-port 8080

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

Como se expone una ruta del servicio php-svc

A

oc expose service/php-svc –name phpapp