Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kuboで快適k8s運用

 Kuboで快適k8s運用

第35回 PaaS勉強会で発表した資料です。 Kubernetes + BOSHなKuboを紹介します。

※ なお、このスライドの作成直後にCFの依存なく単体でKubernetesのデプロイが可能になりました

Kazuto Kusama

May 18, 2017
Tweet

More Decks by Kazuto Kusama

Other Decks in Technology

Transcript

  1. VM OS VM OS VM OS IaaS app app app

    • σϓϩΠ͢Δઌ͸طʹଘࡏ͢Δલఏ • σϓϩΠͨ͠ΒͦΕͰऴΘΓ
  2. VM OS VM OS VM OS IaaS kubelet docker kube-proxy

    kubelet docker kube-proxy api etcd τϥϒϧͰϓϩηε͕μ΢ϯͨ͠Βʁ
  3. VM OS VM OS VM OS IaaS kubelet docker kube-proxy

    kubelet docker kube-proxy api etcd τϥϒϧͰVM͕μ΢ϯͨ͠Βʁ
  4. VM OS VM OS VM OS IaaS kubelet docker kube-proxy

    kubelet docker kube-proxy api etcd ੬ऑੑ͕൑໌ͨ͠Βʁ
  5. VM OS VM OS VM OS IaaS kubelet docker kube-proxy

    kubelet docker kube-proxy api etcd
  6. VM OS VM OS VM OS release deployment release -

    ΞϓϦέʔγϣϯͷόΠφϦ΍ίϯϑΟάҰࣜ deployment - release΍stemcellΛͲ͜ʹͲΕ͚ͩσϓϩΠ ͢Δ͔ͷࢦࣔॻ
  7. VM OS VM OS VM OS release deployment kubelet docker

    kube-proxy kubelet docker kube-proxy api etcd
  8. VM OS VM OS VM OS kubelet docker kube-proxy kubelet

    docker kube-proxy api etcd σϓϩΠޙ͸ɺbosh͕ϓϩηεɺVMͷ؂ࢹ͓Αͼ ϩάऩू
  9. VM OS VM OS VM OS kubelet docker kube-proxy kubelet

    docker kube-proxy api etcd ΋͠VM͕ಥવࢮͯ͠΋ Σ
  10. VM OS VM OS VM OS kubelet docker kube-proxy kubelet

    docker kube-proxy api etcd BOSH͕௚͢
  11. VM OS VM OS VM OS release deployment VM VM

    ΋͠εέʔϧΞ΢τͨ͘͠ͳͬͯ΋
  12. VM OS VM OS VM OS release deployment VM VM

    deploymentʹ૿΍͍ͨ͠෼͚ͩॻ͍ͯɺ BOSHʹ৯ΘͤΕ͹εέʔϧ׬ྃ
  13. Day1 • ࠷ॳͷσϓϩΠ • AnsibleͰ΋ChefͰ΋PuppetͰ΋্ख͘΍ΕΔ ӡ༻ͷ2ϑΣʔζ Day2 • ϞχλϦϯά •

    Ξοϓσʔτ • ϥΠϑαΠΫϧϚωδϝϯτ • όοΫΞοϓ ӡ༻͸Day2໋͕ͦ͜ɻ ͚ͩͲɺͳ͔ͥ͜͜ΛμΫτςʔϓʹ ͍ͯ͠Δέʔε͕ଟ͍
  14. Day2Λҙࣝ͠ͳ͍ͱɾɾɾ • ӡ༻ίετ͕O(n)Ͱ૿େɹ( Լख͢Ε͹O(n^2)ͷέʔε΋ŋŋŋ ) • AnsibleͰ͍͍έʔε • খن໛ͳΞϓϦ •

    1ճσϓϩΠͨ͠ΒҎ߱͋·ΓΞοϓσʔτ͠ͳ͍ΞϓϦ • Day2ͷҙ͕ࣝඞਢͳέʔε • େن໛ɺ෼ࢄܕ • ͭ·Γ͸Cloud Foundryͱ͔BOSHͱ͔
  15. - name: doppler azs: - z1 instances: 1 vm_type: small

    stemcell: default networks: - name: default jobs: - name: consul_agent release: consul consumes: consul: {from: consul_link} consul_common: nil consul_server: nil consul_client: nil properties: consul: agent: services: doppler: name: doppler - name: doppler release: loggregator properties: doppler: etcd: client_cert: "((etcd_client.certificate))" client_key: "((etcd_client.private_key))" loggregator: tls: ca_cert: "((loggregator_tls_doppler.ca))" doppler: cert: "((loggregator_tls_doppler.certificate))" key: "((loggregator_tls_doppler.private_key))" etcd: require_ssl: true ca_cert: "((etcd_server.ca))" machines: - cf-etcd.service.cf.internal doppler_endpoint: shared_secret: "((dropsonde_shared_secret))" - name: syslog_drain_binder release: loggregator properties: loggregator: tls: key: "((loggregator_tls_syslogdrainbinder.private_key))" [437/1737] etcd: require_ssl: true ca_cert: "((etcd_server.ca))" machines: - cf-etcd.service.cf.internal syslog_drain_binder: etcd: client_cert: "((etcd_client.certificate))" client_key: "((etcd_client.private_key))" system_domain: "((system_domain))" cc: mutual_tls: ca_cert: "((loggregator_tls_syslogdrainbinder.ca))" srv_api_uri: https://api.((system_domain)) ssl: *ssl - name: metron_agent release: loggregator properties: *metron_agent_properties - name: log-api azs: - z1 instances: 1 vm_type: small stemcell: default update: max_in_flight: 1 serial: true networks: ntroller: ͔ͭͯͷBOSH YAML - name: default jobs: - name: consul_agent release: consul consumes: consul: {from: consul_link} consul_common: nil consul_server: nil consul_client: nil properties: consul: agent: services: loggregator_trafficcontroller: {} - name: loggregator_trafficcontroller release: loggregator properties: traffic_co properties: traffic_controller: etcd: client_cert: "((etcd_client.certificate))" client_key: "((etcd_client.private_key))" uaa: url: https://uaa.((system_domain)) loggregator: tls: ca_cert: "((loggregator_tls_tc.ca))" trafficcontroller: cert: "((loggregator_tls_tc.certificate))" key: "((loggregator_tls_tc.private_key))" etcd: require_ssl: true ca_cert: "((etcd_server.ca))" machines: - cf-etcd.service.cf.internal uaa: client_secret: "((uaa_clients_doppler_secret))" system_domain: "((system_domain))" ssl: *ssl cc: srv_api_uri: "http://cloud-controller-ng.service.cf.internal:9022" - name: route_registrar release: routing properties: route_registrar: routes: - name: loggregator port: 8080 registration_interval: 20s uris: - loggregator.((system_domain)) - name: doppler port: 8081 registration_interval: 20s uris: - doppler.((system_domain)) - "*.doppler.((system_domain))" - name: metron_agent release: loggregator properties: *metron_agent_properties variables: - name: blobstore_admin_users_password type: password - name: blobstore_secure_link_secret - name: doppler azs: - z1 instances: 1 vm_type: small stemcell: default networks: - name: default jobs: - name: consul_agent release: consul consumes: consul: {from: consul_link} consul_common: nil consul_server: nil consul_client: nil properties: consul: agent: services: doppler: name: doppler - name: doppler release: loggregator properties: doppler: etcd: client_cert: "((etcd_client.certificate))" client_key: "((etcd_client.private_key))" loggregator: tls: ca_cert: "((loggregator_tls_doppler.ca))" doppler: cert: "((loggregator_tls_doppler.certificate))" key: "((loggregator_tls_doppler.private_key))" etcd: require_ssl: true ca_cert: "((etcd_server.ca))" machines: - cf-etcd.service.cf.internal doppler_endpoint: shared_secret: "((dropsonde_shared_secret))" - name: syslog_drain_binder release: loggregator properties: loggregator: tls: key: "((loggregator_tls_syslogdrainbinder.private_key))" [437/1737] etcd: require_ssl: true ca_cert: "((etcd_server.ca))" machines: - cf-etcd.service.cf.internal syslog_drain_binder: etcd: client_cert: "((etcd_client.certificate))" client_key: "((etcd_client.private_key))" system_domain: "((system_domain))" cc: mutual_tls: ca_cert: "((loggregator_tls_syslogdrainbinder.ca))" srv_api_uri: https://api.((system_domain)) ssl: *ssl - name: metron_agent release: loggregator properties: *metron_agent_properties - name: log-api azs: - z1 instances: 1 vm_type: small stemcell: default update: max_in_flight: 1 serial: true networks: ntroller: - name: default jobs: - name: consul_agent release: consul consumes: consul: {from: consul_link} consul_common: nil consul_server: nil consul_client: nil properties: consul: agent: services: loggregator_trafficcontroller: {} - name: loggregator_trafficcontroller release: loggregator properties: traffic_co properties: traffic_controller: etcd: client_cert: "((etcd_client.certificate))" client_key: "((etcd_client.private_key))" uaa: url: https://uaa.((system_domain)) loggregator: tls: ca_cert: "((loggregator_tls_tc.ca))" trafficcontroller: cert: "((loggregator_tls_tc.certificate))" key: "((loggregator_tls_tc.private_key))" etcd: require_ssl: true ca_cert: "((etcd_server.ca))" machines: - cf-etcd.service.cf.internal uaa: client_secret: "((uaa_clients_doppler_secret))" system_domain: "((system_domain))" ssl: *ssl cc: srv_api_uri: "http://cloud-controller-ng.service.cf.internal:9022" - name: route_registrar release: routing properties: route_registrar: routes: - name: loggregator port: 8080 registration_interval: 20s uris: - loggregator.((system_domain)) - name: doppler port: 8081 registration_interval: 20s uris: - doppler.((system_domain)) - "*.doppler.((system_domain))" - name: metron_agent release: loggregator properties: *metron_agent_properties variables: - name: blobstore_admin_users_password type: password - name: blobstore_secure_link_secret
  16. ࠓͷBOSH • Manifest v2ʹͳ͍ͬͯͩͿݟ௨͕͠ྑ͘ͳͬͨ • BOSH CLI v2 (Go) ͕ࠓ݄GAʹ

    • ൿ఻ͷλϨʹͳΓ͕ͪͩͬͨdeployment manifest͕ͦͦ͜͜ ݟ௨͠Α͘ɻ
  17. Function Systems Event-driven microservices. Developers use a variety of abstractions

    today. App-centric Systems Full-featured applications. Container Systems Deep control over app packaging and runtime behavior. Data Services On Demand Services via interfaces. Infrastructure On-premise and/or public clouds. BOSH Cloud NativeͳΞϓϦέʔγϣϯͷ ։ൃɾӡ༻͸CF͕ϕετ
  18. Function Systems Event-driven microservices. Developers use a variety of abstractions

    today. App-centric Systems Full-featured applications. Container Systems Deep control over app packaging and runtime behavior. Data Services On Demand Services via interfaces. Infrastructure On-premise and/or public clouds. BOSH CFͰ͸ରԠ͖͠Εͳ͍ϨΨγʔΞϓϦ΍ StatefulͳΞϓϦέʔγϣϯ͸k8sͰ
  19. Function Systems Event-driven microservices. Developers use a variety of abstractions

    today. App-centric Systems Full-featured applications. Container Systems Deep control over app packaging and runtime behavior. Data Services On Demand Services via interfaces. Infrastructure On-premise and/or public clouds. BOSH ͦΕΒΛBOSHͰ؅ཧ
  20. Product Roadmap 2017 • K8 Parity: cloud packages for LB

    & Volumes, LB deployment type • Networking: app routes externally accessible, replace powerDNS • Persistence: stateful workloads for COTS data services • High Availability: Single-AZ & Multi-AZ / failover • Core: Migration to Etcd v3 • Rolling upgrades: Cluster upgrades w/Zero-downtime • Multi-IAAS: extend support for all BOSH-supported IAAS
 https://docs.google.com/presentation/d/1z-qGCcHLlPpz5LtS0TOcvBZIK4hUQ4GhB-jjQyHEF3c/edit?usp=sharing