Advanced Orchestration with
IBM Bluemix Container Service
Chris Rosen (crosen@us.ibm.com)
Doug Davis (dug@us.ibm.com)
If you want to follow along with gitlab demo:
https://github.com/IBM/kubernetes-container-service-gitlab-sample
Agenda
• IBM Bluemix Container Service
• What is Kubernetes?
• Developer Journey – Deploying Gitlab into IBM's Kubernetes platform
• Services
Everyone’s container journey starts with one container….
IBM Bluemix Container Service
IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
At first the growth is easy to handle….
IBM Bluemix Container Service
IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
But soon it is overwhelming… chaos reins
IBM Bluemix Container Service
IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
Regain control with Kubernetes
IBM Bluemix Container Service
IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
Beta available now.
Combining Docker and Kubernetes to deliver powerful tools, an
intuitive user experience, and built-in security and isolation to
enable rapid delivery of applications - all while leveraging IBM
Cloud Services including cognitive capabilities from Watson.
www.ibm.com/cloud-computing/bluemix/containers
IBM Bluemix Container Service
IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
Agenda
• IBM Bluemix Container Service
• What is Kubernetes?
• Developer Journey – Deploying Gitlab into IBM's Kubernetes platform
• Services
What is Kubernetes?
• Building blocks of a platform to host Containers
• Open / Extensible System
• Replacements are encouraged
• APIs between components are not just for internal use
• Can add new Controllers w/o core API changes
• Auth / Storage / Network / etc… plugins
• Third Party Resources
• Many attempts to make local deployment easy
• Designed to be hosted in the Cloud
9
K8s
NodeNode
K8s Control Plane
App Client
K8s Client
LB
Kubelet
KubeProxy
API Server
Kubelet
KubeProxy
...Ctrs Sch etcd
Kubernetes - Managing Applications
• While there is some "porcelain":
$ kubectl run --image=myapp
$ kubectl scale --replicas=5 rs/myapp
• More common method is yaml/json:
$ kubectl create -f myapp.yaml
• Native scripting is possible, but many use
3rd party tooling - eg: Ansible, Helm
• Asynchronous Programming Model
• A RESTful Database with a set of Controllers
10
apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
name: myapp
spec:
replicas: 1
selector:
matchLabels:
name: web
template:
metadata:
labels:
name: web
spec:
containers:
- name: myappWeb
image: myapp
Kubernetes - Special Sauce
• Any type of application or code
• Pod: a collection of co-located containers
• Label Selectors
• App is more than just a Load Balancer + a scaled Pod
• The most customizable of the three (CF, Docker, K8s)
• More knobs than you can ever imagine - and more coming every day
• Supports limited multi-tenancy
• Service Accounts linked with Namespaces
• By default, no network isolation though
• Backed by Google
11
apiVersion: ...
kind: ReplicaSet
metadata:
name: myapp
spec:
replicas: 1
selector:
matchLabels:
name: web
template:
metadata:
labels:
name: web
spec:
containers:
- name: myappWeb
image: myapp
Kubernetes - Resource Model
• Component Status
• Config Maps / Secrets
• Daemon Sets
• Deployments
• Endpoints
• Horizontal Pod Autoscaler
• Ingress
• Jobs
• Namespaces
• Stateful Sets
• Pods
• Persistent Volumes
• Replica Sets
• Services
• Third Party Resources
• ...
• Nodes
• Service Accounts
• Orchestration
• Single instance pods - one-offs
• Scaled pods
• Stateful Set
• Daemon Sets
• Rolling upgrades of Deployments
• Many are alpha/beta - stability/longevity is ?
12
The Anatomy of a Resource
• API Version
• Kind
• Metadata
• Spec
• Status
apiVersion: v1
kind: Pod
metadata:
annotations:
foo: bar
creationTimestamp: 2017-04-14T15:23:26Z
labels:
app: server
name: ibm-keepalived-watcher-98wjm
namespace: ibm-system
spec:
containers:
- image: registry.ng.bluemix.net/myapp:39
imagePullPolicy: IfNotPresent
name: myapp
status:
conditions:
- lastTransitionTime: 2017-04-14T15:23:30Z
status: "True"
type: Initialized
Developer Journey Info
• Main page: https://github.ibm.com/developer-journeys/cloud-infra-journey-
gitlab-on-containers
• Video: https://w3.ibm.com/developer/content-showcase/videos/run-gitlab-on-
kubernetes/
• Overview: https://developer.ibm.com/code/journey/run-gitlab-kubernetes/
• Github: https://github.com/IBM/kubernetes-container-service-gitlab-sample
• If you want to follow along
Container Journey
• Gitlab – 3 Pods
• Gitlab UI
• Redis
• Postgresql
Container Journey - Outline
• Install the Bluemix client & Docker
• Create a Kubernetes Cluster
• Create a "namespace" in the Bluemix registry for our images
• Build and push the Postgres and Gitlab images
• Deploy Gitlab
• Deploy Postgres, Redis and Gitlab
Demo : Gitlab
Bluemix Value Add
• Security
• Vulnerability Scanning of Images
• Isolated Networking & Storage
• Private Registries
• Customizable Clusters
• Configurable Networking and Storage
• Persistent Volumes using IBM Cloud Storage
• Services
• Watson, IoT, Analytics and Data Services
• IP and application Load Balancing
• Built-in log and metrics collection with IBM
Bluemix log and metrics services
• Native Kubernetes Experience
• Seamless experience moving from local
development to IBM Bluemix
• 100% Kubernetes API and tools
• Supports Kubernetes dashboard
• Integrated Operational Tools
• Use with IBM DevOps tools such as Delivery
Pipeline
• Supports popular add-ons including
Prometheus, Weave, sysdig, fluentd and others
Bluemix Value Add: Services / Marketplace
Cloud Foundry Service Broker API
• Simplifies how users/apps leverage services
• Platform manages the service on behalf of the application
• Freeing the application to focus on its business logic
• Enables easier service integration
• Find a service: $ bx service offerings
• Create instance: $ bx service create cloudantNoSQLDB Lite myDB
• Bind it to an app: $ bx service bind myApp myDB
• Credentials are provided to the app
• CF / Docker : environment variable ( VCAP_SERVICES )
• Kubernetes : secret
Cloud Foundry Service Broker API
• Does not change interaction pattern between app and service
• Does relieve the developer from having to deploy, configure and manage the
service
• Service instances can be shared across CF, Docker and Kubernetes
• Future : Open Service Broker API
• CF donated SB API to a new org called Open Service Broker API: http://openservicebrokerapi.org/
• IBM, Pivotal, RedHat, Google, Fujitsu, SAP
• Expect to see it in: CF, Kubernetes, OpenShift
• Changes: removal of CF-ism, schema-tizing parameters, additional auth mechanisms, etc...
Demo : Services

Kube journey 2017-04-19

  • 1.
    Advanced Orchestration with IBMBluemix Container Service Chris Rosen (crosen@us.ibm.com) Doug Davis (dug@us.ibm.com) If you want to follow along with gitlab demo: https://github.com/IBM/kubernetes-container-service-gitlab-sample
  • 2.
    Agenda • IBM BluemixContainer Service • What is Kubernetes? • Developer Journey – Deploying Gitlab into IBM's Kubernetes platform • Services
  • 3.
    Everyone’s container journeystarts with one container…. IBM Bluemix Container Service IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
  • 4.
    At first thegrowth is easy to handle…. IBM Bluemix Container Service IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
  • 5.
    But soon itis overwhelming… chaos reins IBM Bluemix Container Service IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
  • 6.
    Regain control withKubernetes IBM Bluemix Container Service IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
  • 7.
    Beta available now. CombiningDocker and Kubernetes to deliver powerful tools, an intuitive user experience, and built-in security and isolation to enable rapid delivery of applications - all while leveraging IBM Cloud Services including cognitive capabilities from Watson. www.ibm.com/cloud-computing/bluemix/containers IBM Bluemix Container Service IBM Bluemix Container Service | IBM Confidential | ©2017 IBM Corporation
  • 8.
    Agenda • IBM BluemixContainer Service • What is Kubernetes? • Developer Journey – Deploying Gitlab into IBM's Kubernetes platform • Services
  • 9.
    What is Kubernetes? •Building blocks of a platform to host Containers • Open / Extensible System • Replacements are encouraged • APIs between components are not just for internal use • Can add new Controllers w/o core API changes • Auth / Storage / Network / etc… plugins • Third Party Resources • Many attempts to make local deployment easy • Designed to be hosted in the Cloud 9 K8s NodeNode K8s Control Plane App Client K8s Client LB Kubelet KubeProxy API Server Kubelet KubeProxy ...Ctrs Sch etcd
  • 10.
    Kubernetes - ManagingApplications • While there is some "porcelain": $ kubectl run --image=myapp $ kubectl scale --replicas=5 rs/myapp • More common method is yaml/json: $ kubectl create -f myapp.yaml • Native scripting is possible, but many use 3rd party tooling - eg: Ansible, Helm • Asynchronous Programming Model • A RESTful Database with a set of Controllers 10 apiVersion: extensions/v1beta1 kind: ReplicaSet metadata: name: myapp spec: replicas: 1 selector: matchLabels: name: web template: metadata: labels: name: web spec: containers: - name: myappWeb image: myapp
  • 11.
    Kubernetes - SpecialSauce • Any type of application or code • Pod: a collection of co-located containers • Label Selectors • App is more than just a Load Balancer + a scaled Pod • The most customizable of the three (CF, Docker, K8s) • More knobs than you can ever imagine - and more coming every day • Supports limited multi-tenancy • Service Accounts linked with Namespaces • By default, no network isolation though • Backed by Google 11 apiVersion: ... kind: ReplicaSet metadata: name: myapp spec: replicas: 1 selector: matchLabels: name: web template: metadata: labels: name: web spec: containers: - name: myappWeb image: myapp
  • 12.
    Kubernetes - ResourceModel • Component Status • Config Maps / Secrets • Daemon Sets • Deployments • Endpoints • Horizontal Pod Autoscaler • Ingress • Jobs • Namespaces • Stateful Sets • Pods • Persistent Volumes • Replica Sets • Services • Third Party Resources • ... • Nodes • Service Accounts • Orchestration • Single instance pods - one-offs • Scaled pods • Stateful Set • Daemon Sets • Rolling upgrades of Deployments • Many are alpha/beta - stability/longevity is ? 12
  • 13.
    The Anatomy ofa Resource • API Version • Kind • Metadata • Spec • Status apiVersion: v1 kind: Pod metadata: annotations: foo: bar creationTimestamp: 2017-04-14T15:23:26Z labels: app: server name: ibm-keepalived-watcher-98wjm namespace: ibm-system spec: containers: - image: registry.ng.bluemix.net/myapp:39 imagePullPolicy: IfNotPresent name: myapp status: conditions: - lastTransitionTime: 2017-04-14T15:23:30Z status: "True" type: Initialized
  • 14.
    Developer Journey Info •Main page: https://github.ibm.com/developer-journeys/cloud-infra-journey- gitlab-on-containers • Video: https://w3.ibm.com/developer/content-showcase/videos/run-gitlab-on- kubernetes/ • Overview: https://developer.ibm.com/code/journey/run-gitlab-kubernetes/ • Github: https://github.com/IBM/kubernetes-container-service-gitlab-sample • If you want to follow along
  • 15.
    Container Journey • Gitlab– 3 Pods • Gitlab UI • Redis • Postgresql
  • 16.
    Container Journey -Outline • Install the Bluemix client & Docker • Create a Kubernetes Cluster • Create a "namespace" in the Bluemix registry for our images • Build and push the Postgres and Gitlab images • Deploy Gitlab • Deploy Postgres, Redis and Gitlab
  • 17.
  • 18.
    Bluemix Value Add •Security • Vulnerability Scanning of Images • Isolated Networking & Storage • Private Registries • Customizable Clusters • Configurable Networking and Storage • Persistent Volumes using IBM Cloud Storage • Services • Watson, IoT, Analytics and Data Services • IP and application Load Balancing • Built-in log and metrics collection with IBM Bluemix log and metrics services • Native Kubernetes Experience • Seamless experience moving from local development to IBM Bluemix • 100% Kubernetes API and tools • Supports Kubernetes dashboard • Integrated Operational Tools • Use with IBM DevOps tools such as Delivery Pipeline • Supports popular add-ons including Prometheus, Weave, sysdig, fluentd and others
  • 19.
    Bluemix Value Add:Services / Marketplace
  • 20.
    Cloud Foundry ServiceBroker API • Simplifies how users/apps leverage services • Platform manages the service on behalf of the application • Freeing the application to focus on its business logic • Enables easier service integration • Find a service: $ bx service offerings • Create instance: $ bx service create cloudantNoSQLDB Lite myDB • Bind it to an app: $ bx service bind myApp myDB • Credentials are provided to the app • CF / Docker : environment variable ( VCAP_SERVICES ) • Kubernetes : secret
  • 21.
    Cloud Foundry ServiceBroker API • Does not change interaction pattern between app and service • Does relieve the developer from having to deploy, configure and manage the service • Service instances can be shared across CF, Docker and Kubernetes • Future : Open Service Broker API • CF donated SB API to a new org called Open Service Broker API: http://openservicebrokerapi.org/ • IBM, Pivotal, RedHat, Google, Fujitsu, SAP • Expect to see it in: CF, Kubernetes, OpenShift • Changes: removal of CF-ism, schema-tizing parameters, additional auth mechanisms, etc...
  • 22.

Editor's Notes

  • #15 Info: https://www.eventbrite.com/e/docker-kubernetes-workshop-on-creating-a-cluster-and-deploying-an-app-tickets-33600955362?utm_term=eventurl_text Time: 6:30pm – 8:00pm Location: Galvanize, 119 Nueces Street, Austin, TX 78701