Package your micro service into a shipping container.
orchestrate your containers!
Docker / kubernetes based PaaS
Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
group of one or more containers
makes sure that a pod is always up & available
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 3
selector:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
each service has its own unique IP addres
kind: Service
apiVersion: v1
metadata:
name: myapp-service
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 9376
type: LoadBalancer //ClusterIp and NodePort
Each microservice typically has:
For a service called foo-bar here is how you discover to it:
Build docker image:
$ mvn docker:build
Generate kubernetes json:
$ mvn fabric8:json
Apply kubernetes json and image to kubernetes:
$ mvn fabric8:apply
@Inject
@ServiceName("myapp-service")
String myServiceUrl;
@Inject
@ServiceName("some-other-app")
@Protocol("http")
@External
String externalAppUrl;
@Inject
@Endpoint
@ServiceName("cheese-service")
List<String> cheeseEndpointUrls;
© 2017. Sanjay Rawat