Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Migrate your traditional VM-based Clusters to Containers

Migrate your traditional VM-based Clusters to Containers

  • Login to see the comments

Migrate your traditional VM-based Clusters to Containers

  1. 1. Migrate  your  traditional  VM-­‐based   Clusters  to  Containers Arun Gupta, @arungupta Docker Captain, Java Champion
  2. 2. ©2016  Couchbase  Inc. Amazon  Web  Services 2
  3. 3. ©2016  Couchbase  Inc. Amazon  Web  Services 2 • Create VM 1, 2, 3 VM 1 VM 2 VM 3
  4. 4. ©2016  Couchbase  Inc. Amazon  Web  Services 2 • Create VM 1, 2, 3 • Add Couchbase 1, 2, 3 VM 1 VM 2 VM 3
  5. 5. ©2016  Couchbase  Inc. Cluster Amazon  Web  Services 2 • Create VM 1, 2, 3 • Add Couchbase 1, 2, 3 • Create cluster VM 1 VM 2 VM 3
  6. 6. ©2016  Couchbase  Inc. Cluster Amazon  Web  Services 2 • Create VM 1, 2, 3 • Add Couchbase 1, 2, 3 • Create cluster • Rebalance cluster VM 1 VM 2 VM 3
  7. 7. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3
  8. 8. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3 Swarm Master Swarm Node 01 Swarm Node 02 Consul Machine
  9. 9. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3 Swarm Master Swarm Node 01 Swarm Node 02 Consul Machine
  10. 10. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3 Swarm Master Swarm Node 01 Swarm Node 02 Consul Machine version: "2" services: db: image: arungupta/couchbase network_mode: "host" ports: - 8091:8091 - 8092:8092 - 8093:8093 - 11210:11210
  11. 11. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3 Swarm Master Swarm Node 01 Swarm Node 02 Consul Machine version: "2" services: db: image: arungupta/couchbase network_mode: "host" ports: - 8091:8091 - 8092:8092 - 8093:8093 - 11210:11210 scale db=2 docker-compose
  12. 12. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3 Swarm Master Swarm Node 01 Swarm Node 02 Consul Machine version: "2" services: db: image: arungupta/couchbase network_mode: "host" ports: - 8091:8091 - 8092:8092 - 8093:8093 - 11210:11210 scale db=2 docker-compose
  13. 13. ©2016  Couchbase  Inc. Docker  Machine  +  Compose  +  Swarm 3 Swarm Master Swarm Node 01 Swarm Node 02 Consul Machine version: "2" services: db: image: arungupta/couchbase network_mode: "host" ports: - 8091:8091 - 8092:8092 - 8093:8093 - 11210:11210 scale db=2 docker-compose
  14. 14. ©2016  Couchbase  Inc. Kubernetes 4
  15. 15. ©2016  Couchbase  Inc. Kubernetes 4 Master Minion 1 Minion 3 Minion 2 Minion 4
  16. 16. ©2016  Couchbase  Inc. Kubernetes 4 Master Minion 1 Minion 3 Minion 2 Minion 4 apiVersion: v1 kind: ReplicationController metadata: name: couchbase-controller spec: replicas: 1 selector: app: couchbase-master-pod template: metadata: labels: app: couchbase-master-pod spec: containers: - name: couchbase-master image: arungupta/couchbase env: - name: TYPE value: MASTER ports: - containerPort: 8091 ---- apiVersion: v1 kind: Service metadata: name: couchbase-service labels: app: couchbase-master-service spec: ports: - port: 8091 selector: app: couchbase-master-pod
  17. 17. ©2016  Couchbase  Inc. Kubernetes 4 Master Minion 1 Minion 3 Minion 2 Minion 4 apiVersion: v1 kind: ReplicationController metadata: name: couchbase-controller spec: replicas: 1 selector: app: couchbase-master-pod template: metadata: labels: app: couchbase-master-pod spec: containers: - name: couchbase-master image: arungupta/couchbase env: - name: TYPE value: MASTER ports: - containerPort: 8091 ---- apiVersion: v1 kind: Service metadata: name: couchbase-service labels: app: couchbase-master-service spec: ports: - port: 8091 selector: app: couchbase-master-pod
  18. 18. ©2016  Couchbase  Inc. Kubernetes 4 Master Minion 1 Minion 3 Minion 2 Minion 4 apiVersion: v1 kind: ReplicationController metadata: name: couchbase-controller spec: replicas: 1 selector: app: couchbase-master-pod template: metadata: labels: app: couchbase-master-pod spec: containers: - name: couchbase-master image: arungupta/couchbase env: - name: TYPE value: MASTER ports: - containerPort: 8091 ---- apiVersion: v1 kind: Service metadata: name: couchbase-service labels: app: couchbase-master-service spec: ports: - port: 8091 selector: app: couchbase-master-pod env: - name: TYPE value: WORKER - name: COUCHBASE_MASTER value: SERVICE_IP_OF_MASTER - name: AUTO_REBALANCE value: true
  19. 19. ©2016  Couchbase  Inc. Kubernetes 4 Master Minion 1 Minion 3 Minion 2 Minion 4 apiVersion: v1 kind: ReplicationController metadata: name: couchbase-controller spec: replicas: 1 selector: app: couchbase-master-pod template: metadata: labels: app: couchbase-master-pod spec: containers: - name: couchbase-master image: arungupta/couchbase env: - name: TYPE value: MASTER ports: - containerPort: 8091 ---- apiVersion: v1 kind: Service metadata: name: couchbase-service labels: app: couchbase-master-service spec: ports: - port: 8091 selector: app: couchbase-master-pod scale replicas=2 kubectlenv: - name: TYPE value: WORKER - name: COUCHBASE_MASTER value: SERVICE_IP_OF_MASTER - name: AUTO_REBALANCE value: true
  20. 20. ©2016  Couchbase  Inc. DC/OS 5
  21. 21. ©2016  Couchbase  Inc. DC/OS 5 Master Slave 1 Slave 3 Slave 2
  22. 22. ©2016  Couchbase  Inc. DC/OS 5 Master Slave 1 Slave 3 Slave 2
  23. 23. ©2016  Couchbase  Inc. DC/OS 5 Master Slave 1 Slave 3 Slave 2 { "id": "couchbase-mesos", "container": { "type": "DOCKER", "docker": { "image": "arungupta/couchbase", "network": "BRIDGE", "portMappings": [ { "hostPort": 0, "containerPort": 8091, "servicePort": 8091 }, { "hostPort": 0, "containerPort": 8092, "servicePort": 8092 }, { "hostPort": 0, "containerPort": 8093, "servicePort": 8093 }, { "hostPort": 0, "containerPort": 11210, "servicePort": 11210 } ], "forcePullImage":true } }, "instances": 1, "cpus": 2.0, "mem": 2048, "labels":{ "HAPROXY_GROUP":"external" } }
  24. 24. ©2016  Couchbase  Inc. DC/OS 5 Master Slave 1 Slave 3 Slave 2 { "id": "couchbase-mesos", "container": { "type": "DOCKER", "docker": { "image": "arungupta/couchbase", "network": "BRIDGE", "portMappings": [ { "hostPort": 0, "containerPort": 8091, "servicePort": 8091 }, { "hostPort": 0, "containerPort": 8092, "servicePort": 8092 }, { "hostPort": 0, "containerPort": 8093, "servicePort": 8093 }, { "hostPort": 0, "containerPort": 11210, "servicePort": 11210 } ], "forcePullImage":true } }, "instances": 1, "cpus": 2.0, "mem": 2048, "labels":{ "HAPROXY_GROUP":"external" } } Marathon
  25. 25. ©2016  Couchbase  Inc. DC/OS 5 Master Slave 1 Slave 3 Slave 2 { "id": "couchbase-mesos", "container": { "type": "DOCKER", "docker": { "image": "arungupta/couchbase", "network": "BRIDGE", "portMappings": [ { "hostPort": 0, "containerPort": 8091, "servicePort": 8091 }, { "hostPort": 0, "containerPort": 8092, "servicePort": 8092 }, { "hostPort": 0, "containerPort": 8093, "servicePort": 8093 }, { "hostPort": 0, "containerPort": 11210, "servicePort": 11210 } ], "forcePullImage":true } }, "instances": 1, "cpus": 2.0, "mem": 2048, "labels":{ "HAPROXY_GROUP":"external" } } app update instances=2 Marathon Marathon dcos
  26. 26. ©2016  Couchbase  Inc. References ▪Docker: docker.io – Interlock: https://github.com/ehazlett/interlock ▪Kubernetes: kubernetes.io ▪DC/OS: dcos.io ▪OpenShift: openshift.io ▪Couchbase on Containers: couchbase.com/containers 6

×