PIVOTAL
Pivotal
Why PCF (Pivotal Cloud Foundry) ?
- Easy to learn, down curve learning
- Accelerate your move to public cloud
cf push ...
Introduction
To start the application you will install the CLI Pivotal or follow the tutorial
https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry-dev/introduction$ cf install
Configurate
$ cf login -a https://api.run.pivotal.io
Build Pack
Os Buildpacks compilam e empacotam aplicativos para serem executados no Pivotal Cloud Foundry (PCF), eles podem executar aplicativos Java com um método main(), desde que sejam empacotados como JARs auto-executáveis.
Se for determinado um build pack no
manifest.yml não precisa determinar a stack por que o build pack tem uma stack associada, apenas em alguns casos que a build pack não possui uma stack associada.
É possível determinar ENV que serão responsável por "configurar" os build packs como por exemplo: JBP_CONFIG_SPRING_AUTO_RECONFIGURATION (JBP = Java Build Packs)
Push
Quando é executado o
cf push são feitos 3 etapas:- Upload Package ( .jar )
- Criado o Droplet
- Determina qual build pack é o correto
- Executa o build pack e cria o Droplet
- Deployment Droplet
Acronyms
Org - Entreprise, Business Unit, Team Name or a Group of Microservices
Space - Environments [QA, Developments], there in Space we are push the application
Org > Space > Application
Requests
Spring Boot Starter Sleuth
Able to trace the request accross multiple microservices. It Associate a id with each of these requests.
Scale
To scale a app you need execute the command:
$ cf scale [app] -i [qtd_instances]
Scale Process
The service is being automatically distributed among the different instances which are live of the currency.
PCF User Request Flow
User => Load Balancer => Go Router => Cell/App
Don't need do anything. it is automatically load balancing between all the servers that are avaible.
Endpoint Config
http://[url]/manage # Managenment
http://[url]/manage/env # Variable Environment
Variable Environment
To set a variable environment you need execute the command:
$ cf set-env [app] [name_variable] [value_variable]
$ cf restart [app]
and to see the variable environment just type:
$ cf env [app]
Eureka (Service Registry)
Eureka Server consiste em uma aplicação que atua como Service Registry permitindo que outras aplicações registrem suas instâncias, com isso, ele controla os endereços registrados mantendo-os atualizados e sinalizando quando um serviço não está disponível.
- Service Provider – Fornecerá o serviço e está sujeito a mudança de endereço.
- Service Consumer – Consumirá o serviço e precisa conhecer o endereço que será chamado.
- Service Registry – Mantém o endereço atualizado de todas as instâncias dos serviços.
O reconhecimento e chamada da URL de outro serviço é baseado no name spring.application.name que está definido no application.properties.
Comentários
Postar um comentário