openshift @ sbb - jug · openshift clusters master nodes 2 2 storage nodes 2 > 6 2 > 6...

25
OpenShift @ SBB Java User Group – 27.9 & 25.10.17 Tobias Denzler, Philipp Oser

Upload: others

Post on 22-Sep-2019

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

OpenShift @ SBB

Java User Group – 27.9 & 25.10.17

Tobias Denzler, Philipp Oser

Page 2: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Who we are

SBB • IT • SWE • 27.9 & 25.10.17 2

Tobias Denzler

� Software Engineer at SBB IT

� Java & OpenShift enthusiast

� @tobiasdenzler

Philipp Oser� Architect at ELCA

� Interest in «good abstractions» for devs

� @silsfan

Page 3: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Agenda

SBB • IT • SWE • 27.9 & 25.10.17 3

1. Intro

2. Demo

3. More advanced topics

4. Conclusion

5. Q&A

Page 4: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Mobile app backend

30k requests per minute

Page 5: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

www.sbb.ch – our main website25k requests per minute

Page 6: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Monitors at all stations

Page 7: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Numbers

Page 8: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

OpenShift Clusters

Master nodes 2 2

Storage nodes 2 > 6 2 > 6

Working nodes 26 7

Compute 1250 Cores 56 Cores

Memory 13 TB 400 GB

Persistent Storage 40 TB 200 GB

Datacenter 2 sites 2 availability zones

8SBB • IT • SWE • 27.9 & 25.10.17

Page 9: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

11%

89%

2700 Containers

Numbers

9

16%

84%

970 Projects

16%

84%

10%

90%

25%

75%

900 Applications 6500 Images 50 Mio Requests/ Day

Page 10: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

PaaS

Page 11: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Context

SBB • IT • SWE • 27.9 & 25.10.17 11

IaaS

OpenShift

ContainerContainer Container

Docker Kubernetes

Traditional SBB IT Infrastructure

Logging Monitoring

Dev Tools

Bitbucket

Jenkins

Nexus

ESTA Cloud

ESTA Cloud Stack

Infrastructure Templates

Page 12: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Layering

SBB • IT • SWE • 27.9 & 25.10.17 12

Page 13: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Demo

Page 14: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

SBB • IT • SWE • 27.9 & 25.10.17 14

Git Repo Nexus Repo

OpenshiftRegistry

JAR, WAR, ...

Docker Image

mvn … mvn deploy

Openshiftbuild

Openshift Runtime EnvDev/Test/Int/Prod

Pod

Configuration:• Self-running Jar or

Dockerfile• What Project?• [Port]• [Name & Version]• [Tags]

Configuration(optional):• Env-Variables• # Instances• What triggers a

redeploy?• …Docker

Image

Projekt

Openshift

Dev Tools

Plattform

Where do my artefacts live? And how do they get there?

Deploy

Propagation

Pod

Pod

Pod

Promote

Pod

Page 15: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Demo-Steps

SBB • IT • SWE • 27.9 & 25.10.17 15

<<pod>>

customer

<<pod>>postgresql

REST Monitoring

<<pod>>

customer

� Initializr

� Jenkins Pipeline

� Openshift UI

� Rolling Deployment

� Monitoring

� Reliability

Page 16: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

More advanced topics

Page 17: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Testing

SBB • IT • SWE • 27.9 & 25.10.17 17

� Good practices remain:

▪ Unit-, Integration Tests, …

▪ Propagation through Stages (dev, test, …, prod)

� Resilience Testing

▪ Chaos Monkey

▪ Toxi-proxy Injection via script

▪ Remote Test Runner

Page 18: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Other topics (selection)

SBB • IT • SWE • 27.9 & 25.10.17 18

� Templates & Images: Postgresql, Elasticsearch, Cassandra, Hazelcast, RabbitMQ, NGINX, Java Base Image …

� Configuration of «desired state» in Openshift – over N stages, automatic, reproducible, management of changes

▪ Desired state in Git

� Graceful Shutdown for Spring and Openshift

� Checklist for productive deployments

▪ naming, > 2 pods, limit resources, monitoring, crash resilient

� Migration to the Cloud: e.g. Only expose HTTP protocols, Sessions

� Open source components for Openshift: https://github.com/oscp

Page 19: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Conclusion

Page 20: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Traditional Infrastructure vs PaaS

SBB • IT • SWE • 27.9 & 25.10.17 20

Traditionell PaaS

Technology Shared WebspherePlatform

Openshift Cluster

What deployablescan run?

Websphere Java EE Deployables (2 fixedVersions & Patch-Levels)

Docker Container

Deployment toProd

Description in Word Document (!)

Self-serviceAutomatic (or via UI)

Cost Lower (about - 30%)

System Know-How

Specialized Team for technology

DevOps-Team(Cloud Team 2nd Level)

Scalability/ New Environment

Static (weeks) Dynamic (seconds)

Governance Technology limited Architecture review

Governance via «what is easy»

Page 21: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Cool

SBB • IT • SWE • 27.9 & 25.10.17 21

� Surprised by huge success at SBB!

� Self-service IT, very flexible & relatively simple «close to ideal infrastructure»

� Templates: Predefined components, can be instantiated via self-service mode, automatically supervised

Page 22: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Challenges

SBB • IT • SWE • 27.9 & 25.10.17 22

� Templates: Large Effort for Design, Maintenance & Know-How

� Know-How in DevOps Teams: Huge technology stack (including e.g. details of Linux distros, Docker, JVM, monitoring, …)

� Full Self-Service ability: Tools supporting multi-tenancy, own mini-Uis, Security, vs flexibility

Page 23: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Questions?

Page 24: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Test runs on Openshift,driven from Jenkins

SBB • IT • SWE • 27.9 & 25.10.17 24

� Convenient pgm model

� Internal Ports accessible

@RunWith(RemoteTestRunner.class)

public class SimpleJUnitTest {

@Test

public void testRunInOpenshift() {

x = codeToRunInOpenshift();

assertEquals(x, "foo");

}

}

Page 25: OpenShift @ SBB - JUG · OpenShift Clusters Master nodes 2 2 Storage nodes 2 > 6 2 > 6 Working nodes 26 7 Compute 1250 Cores 56 Cores Memory 13 TB 400 GB Persistent Storage 40 TB

Build & Deployment

SBB • IT • SWE • 27.9 & 25.10.17 25

� how to manage "desired state" of openshift project

▪ 2 philosophies

− syncher pod (desired state in git)

− script to update desired state (e.g. launched in jenkins)

▪ uses templating (for different envs)

▪ Promotion to next env is then via script/ git update