Commit 0bbdb134 authored by Clenimar Souza's avatar Clenimar Souza
Browse files

add meeting 6 (Services)t

parent e460692e
# 6 - Kubernetes
## Atividade prática
### 1 - Flickor Service e NodePort
Na atividade passada, você criou um Deployment do Flickor com HAProxy (flickor-deployment.yaml). Agora é hora de desacoplar um pouco as coisas e acessar seu serviço.
- O deployment do Flickor agora deve conter somente o Flickor. Remova o HAProxy do deployment, junto com seu ConfigMap.
- Crie um Service do tipo NodePort para o Flickor (flickor-service.yaml).
- Acesse o Flickor de fora do cluster. Lembre-se: você precisa estar com a VPN do LSD ativa para poder alcançar os nós do cluster. Dica: para ver qual a node port selecionada pelo Kubernetes, use `kubectl get service nomedoservice` e veja a coluna `PORTS`.
- Acompanhe os logs de cada réplica do Flickor e mande requisições em sequência. Assim você vai poder ver o Service balanceando a carga.
> **Entregável**
> 1. O arquivo flickor-deployment.yaml que você atualizou (sem HAProxy).
> 2. O arquivo flickor-service.yaml que você criou.
## Entregáveis
[Todos os entregáveis devem ser enviados através deste formulário.](https://forms.gle/ESxKfaoSV54iPKYKA)
apiVersion: apps/v1
kind: Deployment
metadata:
name: dummy-client
spec:
replicas: 1
selector:
matchLabels:
app: dummy-client
template:
metadata:
labels:
app: dummy-client
spec:
containers:
- name: dummy-client
image: clenimar/test:dummy-client
tty: true
resources:
requests:
memory: "128M"
limits:
memory: "512M"
apiVersion: apps/v1
kind: Deployment
metadata:
name: dummy-server
spec:
replicas: 3
selector:
matchLabels:
app: dummy-server
template:
metadata:
labels:
app: dummy-server
spec:
containers:
- name: dummy-server
image: clenimar/test:dummy-server
resources:
requests:
memory: "128M"
limits:
memory: "256M"
apiVersion: v1
kind: Service
metadata:
name: dummy-server
spec:
type: NodePort
selector:
app: dummy-server
ports:
- port: 9999
targetPort: 5001
apiVersion: apps/v1
kind: Deployment
metadata:
name: haproxy
spec:
replicas: 3
selector:
matchLabels:
app: haproxy
template:
metadata:
labels:
app: haproxy
spec:
volumes:
- name: haproxy-conf-volume
configMap:
name: haproxy-conf
containers:
- name: haproxy
image: haproxy:latest
volumeMounts:
- name: haproxy-conf-volume
mountPath: /usr/local/etc/haproxy
resources:
requests:
memory: "128M"
limits:
memory: "256M"
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: haproxy-ds
spec:
selector:
matchLabels:
app: haproxy
template:
metadata:
labels:
app: haproxy
spec:
volumes:
- name: haproxy-conf-volume
configMap:
name: haproxy-conf
containers:
- name: haproxy
image: haproxy:latest
volumeMounts:
- name: haproxy-conf-volume
mountPath: /usr/local/etc/haproxy
resources:
requests:
memory: "128M"
limits:
memory: "256M"
apiVersion: v1
kind: Pod
metadata:
name: haproxy
spec:
volumes:
- name: haproxy-conf-volume
configMap:
name: haproxy-conf
containers:
- name: haproxy
image: haproxy:latest
volumeMounts:
- name: haproxy-conf-volume
mountPath: /usr/local/etc/haproxy
resources:
requests:
memory: "128M"
limits:
memory: "256M"
apiVersion: v1
kind: Pod
metadata:
name: dummy-server
spec:
volumes:
- name: test1
emptyDir: {}
containers:
- name: dummy-flickor
image: caetanobca/flickor:v0.1
volumeMounts:
- name: test1
mountPath: /test-data-haproxy
- name: dummy-server
image: clenimar/test:dummy-server
volumeMounts:
- name: test1
mountPath: /test-1-emptydir
ports:
- containerPort: 5001
env:
- name: TEST
value: "hello"
resources:
requests:
memory: "128M"
limits:
memory: "256M"
......@@ -26,6 +26,12 @@ Sem entregáveis.
- [ ] [Atividade prática: utilizando ConfigMaps e Deployments.](5-kubernetes)
### 6 - Kubernetes - Services (27/10)
- [ ] [Questionário sobre Kubernetes.](https://forms.gle/ESxKfaoSV54iPKYKA)
- [ ] [Atividade prática: utilizando Services.](6-kubernetes)
## Links e material extra
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment