aplicacao.yml
apiVersion: v1
kind: Pod
metadata:
name: aplicacao-noticia
spec:
containers:
- name: container-aplicacao
image: jnlucas/image-phpmysql:latest
ports:
- containerPort: 80
deployment-aplicacao.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: aplicacao-noticia-deployment
spec:
selector:
matchLabels:
name: aplicacao-noticia-pod
template:
metadata:
labels:
name: aplicacao-noticia-pod
spec:
containers:
- name: container-aplicacao
image: jnlucas/image-phpmysql:latest
ports:
- containerPort: 80
servico-aplicacao-noticia.yml
insira seu código aqui
apiVersion: v1
kind: Service
metadata:
name: servico-aplicacao-noticia
spec:
type: LoadBalancer
ports:
- name: http
port: 80
selector:
name: aplicacao-noticia-pod
Imagem do carregamento;
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> minikube start * minikube v1.8.2 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
* Automatically selected the docker driver
* Creating Kubernetes in docker container with (CPUs=2) (2 available), Memory=1989MB (1989MB available) ...
* Preparing Kubernetes v1.17.3 on Docker 19.03.2 ...
- kubeadm.pod-network-cidr=10.244.0.0/16
* Launching Kubernetes ...
* Enabling addons: default-storageclass, storage-provisioner
* Waiting for cluster to come online ...
* Done! kubectl is now configured to use "minikube"
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> kubectl get pods -o wide No resources found in default namespace.
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> kubectl create -f .\aplicacao.yml pod/aplicacao-noticia created
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> kubectl create -f .\deployment-aplicacao.yml deployment.apps/aplicacao-noticia-deployment created
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> kubectl create -f .\servico-aplicacao-noticia.yml service/servico-aplicacao-noticia created
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> kubectl get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
aplicacao-noticia 0/1 ContainerCreating 0 28s <none> m01 <none> <none>
aplicacao-noticia-deployment-fb4856bcd-qfq4n 0/1 ContainerCreating 0 21s <none> m01 <none> <none>
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates> minikube service servico-aplicacao-noticia |-----------|---------------------------|-------------|-------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|---------------------------|-------------|-------------------------|
| default | servico-aplicacao-noticia | | http://172.17.0.2:31864 |
|-----------|---------------------------|-------------|-------------------------|
* Opening service default/servico-aplicacao-noticia in default browser...
PS D:\workspace\curso-kubernates\curso-kubernetes\kubernates>