Skip to content

Instantly share code, notes, and snippets.

@Takaharayuri122
Created August 26, 2019 20:47
Show Gist options
  • Save Takaharayuri122/abf81e040d5506c3d6c3823d02f42372 to your computer and use it in GitHub Desktop.
Save Takaharayuri122/abf81e040d5506c3d6c3823d02f42372 to your computer and use it in GitHub Desktop.
Passo a Passo Kubernets

Passo a Passo de como utilizar e dar Deploy em aplicações em Containers utilizando Kubernets

1 - Criar o Cluster

Passos…

2 - Entrar no Cluster

Passos

3 - Preparar o projeto para o Container

1 - Cria o arquivo yml com os dados do projeto: consultar ===> admin.yml
2 - Pega no provedor o arquivo kubeconfig com a configuração de acesso ao Cluster: no projeto admin está no arquivo kubeconfig.yml
3 - copia, do admin (por exemplo):
3.1 - A configuração do nginx para o projeto: nginx-custom.conf
3.2 - a lista de pastas que não irão para o container: .dockerignore
3.3 - a lista de comandos para criação da imagem no docker: Dockerfile

4 - Fazendo Deploy da Aplicação

1 - Cria a imagem no docker:

 docker build -t gerinus/zagil:v1 

2 - Sobe a imagem para o Docker hub

 docker push zagil

3 - Define o arquivo de configuração do Kube:

 SET KUBECONFIG=D:\Desenvolvimento\Asap\zagil\kubeconfig.yml

4 - Aplica o Projeto:

 kubectl apply -f zagil.yaml

Comandos úteis

List the pods
You have just deployed a in a pod in your worker node. Let’s verify that
everything is correct by listing the pods.

 kubectl -n=default get pods

List the deployments
You can also verify the deployment is active:

 kubectl -n=default get deploy

List the services
And now you’re going to use kubectl to see your service:

kubectl -n=default get services

Referências

http://www.cienciaedados.com/kubernetes-pods-nodes-containers-e-clusters/

https://www.linode.com/docs/applications/containers/kubernetes/deploy-container-image-to-kubernetes/

https://medium.com/marcosmota287/rodando-aplica%C3%A7%C3%A3o-angular-com-docker-e-nginx-9c28e7a99f4

https://docs.ovh.com/gb/en/kubernetes/configuring-kubectl/

https://docs.ovh.com/gb/en/kubernetes/deploying-an-application/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment