Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install software-properties-common -y
sudo apt-get install ansible -y
sudo apt-get install git -y
ansible --version

Das Thema sind Microservices.
Konkret möchte ich gewisse Techniken die bei der Implementation von Microservices hilfreich sein können vorzeigen. Für die Demonstration werde ich Kubernetes/Docker und Java verwenden.
Diese Liste wird vorzu erweitert.

Kubernetes

  • blue-green deployment
  • canary releases
  • rolling updates
  • horizontal scaling
apiVersion: v1
kind: ReplicationController
metadata:
name: reservation-controller
labels:
name: reservation
version: v2
visualize: "true"
spec:
replicas: 3
apiVersion: v1
kind: Service
metadata:
name: reservation-v1
labels:
name: reservation-v1
visualize: "true"
spec:
ports:
- port: 80
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: devoxx-adesso
spec:
replicas: 1
template:
metadata:
labels:
visualize: "true"
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gogs
spec:
replicas: 1
template:
metadata:
labels:
name: gogs
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
template:
metadata:
labels:
name: jenkins
withEnv(["KUBERNETES_HOST_NAME=hero-command-test"]) {
stage "checkout, build, test and publish"
node {
git poll: true, url: "http://adesso.disruptor.ninja:30130/rob/hero-command.git"
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn clean install"
sh "USER_NAME=robertbrem VERSION=1.0.${currentBuild.number} ./build.js"
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
}
}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: registry
spec:
replicas: 1
template:
metadata:
labels:
name: registry
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: registry-ui
spec:
replicas: 1
template:
metadata:
labels:
name: registry-ui