Skip to content

Instantly share code, notes, and snippets.

View service template
apiVersion: v1
kind: Service
metadata:
name: reservation-v1
labels:
name: reservation-v1
visualize: "true"
spec:
ports:
- port: 80
View rc template
apiVersion: v1
kind: ReplicationController
metadata:
name: reservation-controller
labels:
name: reservation
version: v2
visualize: "true"
spec:
replicas: 3
View BrownBag_26.04.2016.md

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
View devoxx-deployment.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: devoxx-adesso
spec:
replicas: 1
template:
metadata:
labels:
visualize: "true"
View nodeSelectorDeployment.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gogs
spec:
replicas: 1
template:
metadata:
labels:
name: gogs
View jenkins.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
template:
metadata:
labels:
name: jenkins
View pipeline.groovy
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'])
}
}
View registry.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: registry
spec:
replicas: 1
template:
metadata:
labels:
name: registry
View registry-ui.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: registry-ui
spec:
replicas: 1
template:
metadata:
labels:
name: registry-ui
View initial setup
#!/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