Click here to load reader

Kubernetes at Spreadshirt - First steps to production

  • View
    166

  • Download
    6

Embed Size (px)

Text of Kubernetes at Spreadshirt - First steps to production

PowerPoint-Prsentation

Kubernetes at SpreadshirtFirst steps to production

Jens Hadlich, Chief Architect

Spreadshirt

SpreadshirtWE PRINT IDEAS

SpreadshirtNot all that long ago We want to build a service with Ruby Why? and the other team was allowed to build a service with Node.js Sure, I already forgot. Hmm OK. Lets try.Ruby is the right tool for the job ...We could build it in Java but that would be too much Other companies use it for years already Its a very simple service 3

SpreadshirtSome time later To run it, you just need some to install some gems.Didnt work.Sure not. You need Ruby in Version X.X? You can only have Y.Whats a gem?How about using Docker?Ecosystem man.4

Spreadshirt5

Docker

SpreadshirtDocker is nice, but *Number ofRunningContainers151050100

* without container orchestration or additional tooling6

SpreadshirtDocker is nice, but *Number ofRunningContainers151050100

* without container orchestration or additional tooling7

SpreadshirtDocker is nice, but *Number ofRunningContainers151050100

* without container orchestration or additional tooling8

SpreadshirtDocker is nice, but *Number ofRunningContainers151050100

* without container orchestration or additional tooling9

SpreadshirtDocker is nice, but *Number ofRunningContainers151050100

* without container orchestration or additional tooling10

SpreadshirtDocker is nice, but *11Number ofRunningContainers151050100

* without container orchestration or additional tooling

Spreadshirt12Kubernetes

SpreadshirtKubernetes for Container OrchestrationThe promise ...Easily bring up new components and servicesEasily manage hundreds or thousands of containersEasily add capacityBetter resource utilization(Auto-)scale

13

SpreadshirtPreparationThink about MonitoringLoggingMetricsConfiguration managementBuild & Deployment pipelinesYour application stack

14

SpreadshirtTool Ecosystem at Spreadshirt

15

SpreadshirtTool Ecosystem at Spreadshirt (contd)16

VxLAN

(and even more )

Spreadshirt17

SpreadshirtBuild

git commitgit push

.gitlab-ci.yml

* io.fabric8/docker-maven-plugin*18

SpreadshirtDeploy

Manifest fileskubectl

Service IP19

SpreadshirtKuh (Kubernetes hiera)Homegrown preprocessor for k8s manifest filesWhy? Avoid yet another big project (change configuration management)Bridge between Puppet/hiera (our old world) and Kubernetes (the new world) peaceful coexistence

20

SpreadshirtPuppet/hiera

21

SpreadshirtKuh input structure deployment data common.yaml ops.yaml qa.yaml .yaml ... src config application-config.yaml infra k8s.yamlhiera data files like with Puppetadd to your git project22k8s manifest templates

SpreadshirtKubernetes manifest templates with KuhapiVersion: v1kind: Servicemetadata: name: my-service labels: app: my-servicespec: type: NodePort clusterIP: 192.168.X.Y ports: - port: name: http...Retrieve the value from hiera*23* yeah, we know this looks ugly

SpreadshirtKuh output deployment data src target config application-config.yaml k8s configmap application-config.yaml infra k8s.yaml24Final k8s manifest files

SpreadshirtKubernetes ManifestsDeploymentConfigMapSecretService(more to come)25

SpreadshirtDocker registry & imagesNexus 3Java / Maven repositoryOwn Docker registryNice WebUITraffic*Docker imageslatest tag, overrideOther tags:${git.commit.time}.${git.commit.id}e.g. 2017-03-29.a5344e3501d591e4c7908d97a044d3d0f38ddb43 to be able to clean up old images and better readability

26* pushing and pulling Docker images can generate significant network traffic

SpreadshirtStateful ApplicationsNot at the moment!Databases, Elasticsearch, are externalAvoid local storageUse Web-APIs (e.g. S3)27

SpreadshirtOpen issuesWe are still in learning mode!

Improve high availability for Kubernetes2 separate Kubernetes clustersSingle master: if it fails restartClustered etcdPuppetized => spin up a new cluster within minutesHow to manage storage / stateful services?E.g. DB, Elasticsearch28

SpreadshirtOpen issues (contd) Security patches / lifecycle of Docker images / containers within k8sWhats running inside my container?Manage re-build / re-deploy after a certain time?Trust 3rd party base images?Reduce complexityRevisit custom HAProxy vs. built-in Ingress & Co.

29

SpreadshirtNice toolssysdig / csysdig30

[email protected]

Thank You

SpreadshirtLinkshttps://sysdig.com/blog/digging-into-kubernetes-with-sysdig/

Spreadshirt

Search related