Go for Operations

QAware GmbH
QAware GmbHQAware GmbH
Go for Operations
Code Days 2021 Digital, February 10th 2021


@LeanderReimer #cloudnativenerd #qaware #CodeDays
Mario-Leander Reimer


Principal Software Architect


@LeanderReimer


#cloudnativenerd #qaware
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
3
Code & Demos
https://github.com/qaware/go-for-operations


// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
How do you organise and enable
DevOps teams for


fast
fl
ow and high productivity?
4
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Too much cognitive load will become a bottleneck
for fast
fl
ow and high productivity.
• Instrinsic Cognitive Load - relates to fundamental aspects
and knowledge in the problem space (e.g. used languages,
APIs, frameworks)


• Extraneous Cognitive Load - relates to the environment


(e.g. deployment, con
fi
guration, console commands)


• Germane Cognitive Load - relates to speci
fi
c aspects of the
business domain (aka. „value added“ thinking)
5
https://teamtopologies.com
https://web.devopstopologies.com
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Eliminate


extraneous cognitive load




Minimize


intrinsic cognitive load
6
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
7
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Use the right tools for the job!
8
Getty Images Liliboas
Ansible Shell Scripts
Golang
Ruby Python
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Why Go?
• Go is Open Source and maintained by Google


• Go is an e
ffi
cient distributed, parallel language for systems
programming at Google to solve problems of C++ code


• Single, self contained binary. Runs almost on any platform and OS.


• Vivid community. Good documentation. Good Tooling.


• Go is the major language behind the Cloud Native Stack, many
important components are written in Go
9
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
The outline for today
1. Getting to Know Go: Basics and Tooling


2. Building CLI applications with Cobra


3. Implementing custom kubectl plugins


4. Building a Sidecar container


5. Building a Kubernetes Operator in Go
10
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
11
https:/
/gobyexample.com
https:/
/learnxinyminutes.com/docs/go/
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
The renaissance of the plain old Make
fi
le
12
VERSION = v1.0.0


.PHONY: build


build:


# omit the symbol table, debug information and the DWARF table


@go build -o go-example -ldflags="-s -w -X main.version=$(VERSION)"


clean:


@go clean


test: build


@go test -v


all: clean build test


release: all


@goreleaser --snapshot --skip-publish --rm-dist
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Use GoReleaser to publish multi OS binaries
• Cross-compile your Go project


• Release to GitHub, GitLab and Gitea


• Create Docker images and manifests


• Create Linux packages and Homebrew
taps


• Upload to Bintray, Artifactory to Public
Cloud Blob Stores


• ... and much more!
13
project_name: go-example


before:


hooks:


- go mod download


builds:


- env:


- CGO_ENABLED=0


goos:


- linux


- windows


- darwin


goarch:


- 386


- amd64


ldflags: -s -w -X main.version={{.Version}}


archives:


- name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{


format_overrides:


- goos: windows


format: zip


replacements:


darwin: Darwin


linux: Linux


windows: Windows


386: i386


amd64: x86_64
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
The Swiss Army Knife of Operations.
14
CLIs - The Swiss Army Knife of Operations
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
The basics of 12-factor CLI apps
• Great help is essential. What version am I on?


• Prefer
fl
ags to positional arguments.


• Mind the streams. stdout is for output, stderr is for messaging.


• Handle things going wrong: error code, title, how to
fi
x, URL, …


• Be fancy: use colours, have shell completion.


• Prompt if you can.


• Be speedy. CLIs need to start fast.


• Be clear about subcommands.
15
For complete list and info, read https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Introducing
• https://github.com/spf13/cobra


• Cobra is a library providing a simple interface to create powerful
modern CLI interfaces similar to git & go tools.


• Cobra is also an application that will generate your application
scaffolding to rapidly develop a Cobra-based application.


• Cobra is used in many Go projects such as Kubernetes, Docker,
Skaffold, Helm and Istio just to name a few.
16
Kubectl Plugins
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Container Orchestration Patterns
18
Sidecar Container


Extended Container Behaviour


• Log Extraction / Reformatting


(
fl
uentd,
fi
le beat)


• Scheduling (cron, quartz)
Ambassador Container


Proxy Communication


• TLS Tunnel (ghostunnel, Istio)


• Circuit Breaking (linked, Istio)


• Request Monitoring (linked, Istio)
Adapter Container


Standardized Ops Interfaces


• Monitoring (Prometheus)


• Con
fi
guration (Con
fi
gMaps, Secrets, …)
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Use a multi-stage Docker
fi
le to build Linux binary
19
FROM golang:1.15.2 as builder


WORKDIR /build


COPY . /build


RUN go build -o logship-sidecar -ldflags="-s -w"


FROM gcr.io/distroless/static-debian10


COPY --from=builder /build/logship-sidecar /


ENV LOG_DIRECTORY=/logs


ENV LOG_FILE_PATTERN=.+.gz


ENV LOG_SCAN_INTERVAL=10


ENTRYPOINT ["/logship-sidecar"]


CMD [""]
Stage 1: Building
Stage 2: Running
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
20
Operator.
- Do stuff to my Kubernetes.
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
What are operators?
• Operators are codi
fi
ed Ops procedures!


• Operators are the path towards Zero-Ops. They enable auto-updating,
self-monitoring and self-healing infrastructure and applications.


• The concept was coined in the Kubernetes world. It’s now been
adopted and used widespread in the cloud native world.


• Examples: OKD, Sealed Secrets, Kube Monkey, Weave Flux
21
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Kubernetes API Extensions via Custom Resources
• User de
fi
ned extensions of the Kubernetes APIs


• Allow the abstraction of complex application constructs and concepts


• De
fi
nition solely via CustomResourceDefinitions


• Structure de
fi
nition via OpenAPI v3.0 Validation Schema


• Default Support for several API Features: CRUD, Watch, Discovery,
json-patch, merge-patch, Admission Webhooks, Metadata, RBAC, …


• Versioning und Conversion supported via Webhooks
22
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
23
apiVersion: v1


kind: Service


metadata:


name: nginx-service


spec:


type: LoadBalancer


ports:


- port: 80


protocol: TCP


selector:


app: nginx
apiVersion: apps/v1


kind: Deployment


metadata:


name: nginx-deployment


spec:


selector:


matchLabels:


app: nginx


replicas: 2


template:


metadata:


labels:


app: nginx


environment: integration


spec:


containers:


- name: nginx


image: nginx:1.19.4-alpine


ports:


- containerPort: 80


# probe definitions


# resource constraints


# volumes and mounts
apiVersion: k8s.qaware.de/v1alpha1


kind: Microservice


metadata:


name: microservice-example


labels:


app: nginx


spec:


image: nginx:1.19.4-alpine


replicas: 2


serviceType: LoadBalancer


ports:


- 80
+ =
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Kubernetes Operators Explained
24
https://github.com/qaware/graal-operators
https://github.com/qaware/go-for-operations
// Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc
Introducing the Operator SDK
25
Mario-Leander Reimer


Principal Software Architect, QAware GmbH


mario-leander.reimer@qaware.de


https://www.qaware.de


https://speakerdeck.com/lreimer/


https://github.com/lreimer/
&
1 of 26

Recommended

Continuous (Non)-Functional Testing of Microservices on k8s by
Continuous (Non)-Functional Testing of Microservices on k8s Continuous (Non)-Functional Testing of Microservices on k8s
Continuous (Non)-Functional Testing of Microservices on k8s QAware GmbH
463 views26 slides
Continuous (Non-)Functional Testing of Microservices on K8s by
Continuous (Non-)Functional Testing of Microservices on K8sContinuous (Non-)Functional Testing of Microservices on K8s
Continuous (Non-)Functional Testing of Microservices on K8sQAware GmbH
162 views22 slides
betterCode Workshop: Effizientes DevOps-Tooling mit Go by
betterCode Workshop:  Effizientes DevOps-Tooling mit GobetterCode Workshop:  Effizientes DevOps-Tooling mit Go
betterCode Workshop: Effizientes DevOps-Tooling mit GoQAware GmbH
692 views29 slides
Clean Infrastructure as Code by
Clean Infrastructure as CodeClean Infrastructure as Code
Clean Infrastructure as CodeQAware GmbH
311 views19 slides
Kubernetes für Workstations Edge und IoT Devices by
Kubernetes für Workstations Edge und IoT DevicesKubernetes für Workstations Edge und IoT Devices
Kubernetes für Workstations Edge und IoT DevicesQAware GmbH
297 views14 slides
Ich brauche einen Abstraktions-Layer für meine Cloud by
Ich brauche einen Abstraktions-Layer für meine CloudIch brauche einen Abstraktions-Layer für meine Cloud
Ich brauche einen Abstraktions-Layer für meine CloudQAware GmbH
583 views17 slides

More Related Content

What's hot

4K–Kubernetes with Knative, Kafka and Kamel by
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel Red Hat Developers
5.7K views70 slides
You Want to Kubernetes? You MUST Know Containers! by
You Want to Kubernetes? You MUST Know Containers!You Want to Kubernetes? You MUST Know Containers!
You Want to Kubernetes? You MUST Know Containers!VMware Tanzu
264 views48 slides
Canary deployment with Traefik and K3S by
Canary deployment with Traefik and K3SCanary deployment with Traefik and K3S
Canary deployment with Traefik and K3SJakub Hajek
188 views27 slides
Serverless architectures with Fn Project by
Serverless architectures with Fn ProjectServerless architectures with Fn Project
Serverless architectures with Fn ProjectSven Bernhardt
714 views40 slides
K8s from Zero to ~Hero~ Seasoned Beginner by
K8s from Zero to ~Hero~ Seasoned BeginnerK8s from Zero to ~Hero~ Seasoned Beginner
K8s from Zero to ~Hero~ Seasoned BeginnerKristof Jozsa
3.7K views18 slides
DCSF19 Kubernetes Security with OPA by
DCSF19 Kubernetes Security with OPA DCSF19 Kubernetes Security with OPA
DCSF19 Kubernetes Security with OPA Docker, Inc.
815 views13 slides

What's hot(20)

4K–Kubernetes with Knative, Kafka and Kamel by Red Hat Developers
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
Red Hat Developers5.7K views
You Want to Kubernetes? You MUST Know Containers! by VMware Tanzu
You Want to Kubernetes? You MUST Know Containers!You Want to Kubernetes? You MUST Know Containers!
You Want to Kubernetes? You MUST Know Containers!
VMware Tanzu264 views
Canary deployment with Traefik and K3S by Jakub Hajek
Canary deployment with Traefik and K3SCanary deployment with Traefik and K3S
Canary deployment with Traefik and K3S
Jakub Hajek188 views
Serverless architectures with Fn Project by Sven Bernhardt
Serverless architectures with Fn ProjectServerless architectures with Fn Project
Serverless architectures with Fn Project
Sven Bernhardt714 views
K8s from Zero to ~Hero~ Seasoned Beginner by Kristof Jozsa
K8s from Zero to ~Hero~ Seasoned BeginnerK8s from Zero to ~Hero~ Seasoned Beginner
K8s from Zero to ~Hero~ Seasoned Beginner
Kristof Jozsa3.7K views
DCSF19 Kubernetes Security with OPA by Docker, Inc.
DCSF19 Kubernetes Security with OPA DCSF19 Kubernetes Security with OPA
DCSF19 Kubernetes Security with OPA
Docker, Inc.815 views
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T... by DevOps.com
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
DevOps.com74 views
Continuous Delivery With Containers by All Things Open
Continuous Delivery With ContainersContinuous Delivery With Containers
Continuous Delivery With Containers
All Things Open150 views
Efficient DevOps Tooling with Java and GraalVM by QAware GmbH
Efficient DevOps Tooling with Java and GraalVMEfficient DevOps Tooling with Java and GraalVM
Efficient DevOps Tooling with Java and GraalVM
QAware GmbH312 views
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers by Daniel Oh
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers[DevConf.US 2019]Quarkus Brings Serverless to Java Developers
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers
Daniel Oh678 views
Is your kubernetes negative or positive by LibbySchulze
Is your kubernetes negative or positive Is your kubernetes negative or positive
Is your kubernetes negative or positive
LibbySchulze135 views
Building streaming applications using a managed Kafka service | DevNation Tec... by Red Hat Developers
Building streaming applications using a managed Kafka service | DevNation Tec...Building streaming applications using a managed Kafka service | DevNation Tec...
Building streaming applications using a managed Kafka service | DevNation Tec...
Red Hat Developers3.8K views
Declarative Import with Magento 2 Import Framework (M2IF) by Tim Wagner
Declarative Import with Magento 2 Import Framework (M2IF)Declarative Import with Magento 2 Import Framework (M2IF)
Declarative Import with Magento 2 Import Framework (M2IF)
Tim Wagner215 views
Real World CI/CD with Kubernetes by Opsta
Real World CI/CD with KubernetesReal World CI/CD with Kubernetes
Real World CI/CD with Kubernetes
Opsta1.6K views
Troubleshooting tips from docker support engineers by Docker, Inc.
Troubleshooting tips from docker support engineersTroubleshooting tips from docker support engineers
Troubleshooting tips from docker support engineers
Docker, Inc.1.2K views
Lightweight Virtualization with Linux Containers and Docker | YaC 2013 by dotCloud
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
dotCloud14.2K views
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk by Red Hat Developers
Operatorhub.io and your Kubernetes cluster | DevNation Tech TalkOperatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Operatorhub.io and your Kubernetes cluster | DevNation Tech Talk
Red Hat Developers2.7K views

Similar to Go for Operations

Docker Bday #5, SF Edition: Introduction to Docker by
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker, Inc.
2.5K views33 slides
Docker Birthday #5 Meetup Cluj - Presentation by
Docker Birthday #5 Meetup Cluj - PresentationDocker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - PresentationAlex Vranceanu
73 views34 slides
Tampere Docker meetup - Happy 5th Birthday Docker by
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerSakari Hoisko
410 views39 slides
Enterprise Cloud Native is the New Normal by
Enterprise Cloud Native is the New NormalEnterprise Cloud Native is the New Normal
Enterprise Cloud Native is the New NormalQAware GmbH
557 views52 slides
Let's Program The Cloud by
Let's Program The CloudLet's Program The Cloud
Let's Program The CloudStephane Woillez
211 views12 slides
Bahrain ch9 introduction to docker 5th birthday by
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Walid Shaari
347 views59 slides

Similar to Go for Operations(20)

Docker Bday #5, SF Edition: Introduction to Docker by Docker, Inc.
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to Docker
Docker, Inc.2.5K views
Docker Birthday #5 Meetup Cluj - Presentation by Alex Vranceanu
Docker Birthday #5 Meetup Cluj - PresentationDocker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - Presentation
Alex Vranceanu73 views
Tampere Docker meetup - Happy 5th Birthday Docker by Sakari Hoisko
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
Sakari Hoisko410 views
Enterprise Cloud Native is the New Normal by QAware GmbH
Enterprise Cloud Native is the New NormalEnterprise Cloud Native is the New Normal
Enterprise Cloud Native is the New Normal
QAware GmbH557 views
Bahrain ch9 introduction to docker 5th birthday by Walid Shaari
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday
Walid Shaari347 views
[20200720]cloud native develoment - Nelson Lin by HanLing Shen
[20200720]cloud native develoment - Nelson Lin[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin
HanLing Shen132 views
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL by Mario-Leander Reimer
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPLA Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
A Hitchhiker’s Guide to the Cloud Native Stack. #DevoxxPL
A Hitchhiker's Guide to the Cloud Native Stack by QAware GmbH
A Hitchhiker's Guide to the Cloud Native StackA Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native Stack
QAware GmbH970 views
Meetup Devops-Geneva-19.10.2019 by Hidora
Meetup Devops-Geneva-19.10.2019Meetup Devops-Geneva-19.10.2019
Meetup Devops-Geneva-19.10.2019
Hidora822 views
Efficient platform engineering with Microk8s & gopaddle.pdf by Vinothini Raju
Efficient platform engineering  with  Microk8s & gopaddle.pdfEfficient platform engineering  with  Microk8s & gopaddle.pdf
Efficient platform engineering with Microk8s & gopaddle.pdf
Vinothini Raju57 views
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo... by Henning Jacobs
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Henning Jacobs1.4K views
Docker & aPaaS: Enterprise Innovation and Trends for 2015 by WaveMaker, Inc.
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015
WaveMaker, Inc.6K views
Cloud-native .NET Microservices mit Kubernetes by QAware GmbH
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
QAware GmbH1.1K views
Software development in the modern age by Roy Wasse
Software development in the modern ageSoftware development in the modern age
Software development in the modern age
Roy Wasse287 views
DockerCon 15 Keynote - Day 2 by Docker, Inc.
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.20.2K views
Development workflow guide for building docker apps by Abdul Khan
Development workflow guide for building docker appsDevelopment workflow guide for building docker apps
Development workflow guide for building docker apps
Abdul Khan9 views
Development workflow guide for building docker apps by Abdul Khan
Development workflow guide for building docker appsDevelopment workflow guide for building docker apps
Development workflow guide for building docker apps
Abdul Khan12 views
GCP Meetup #3 - Approaches to Cloud Native Architectures by nine
GCP Meetup #3 - Approaches to Cloud Native ArchitecturesGCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native Architectures
nine879 views

More from QAware GmbH

Der Tod der Testpyramide? – Frontend-Testing mit Playwright by
Der Tod der Testpyramide? – Frontend-Testing mit PlaywrightDer Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit PlaywrightQAware GmbH
7 views34 slides
Was kommt nach den SPAs by
Was kommt nach den SPAsWas kommt nach den SPAs
Was kommt nach den SPAsQAware GmbH
5 views47 slides
Cloud Migration mit KI: der Turbo by
Cloud Migration mit KI: der Turbo Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo QAware GmbH
18 views23 slides
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... by
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...QAware GmbH
16 views13 slides
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster by
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster QAware GmbH
16 views31 slides
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before. by
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.QAware GmbH
20 views57 slides

More from QAware GmbH(20)

Der Tod der Testpyramide? – Frontend-Testing mit Playwright by QAware GmbH
Der Tod der Testpyramide? – Frontend-Testing mit PlaywrightDer Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
QAware GmbH7 views
Was kommt nach den SPAs by QAware GmbH
Was kommt nach den SPAsWas kommt nach den SPAs
Was kommt nach den SPAs
QAware GmbH5 views
Cloud Migration mit KI: der Turbo by QAware GmbH
Cloud Migration mit KI: der Turbo Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo
QAware GmbH18 views
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... by QAware GmbH
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
QAware GmbH16 views
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster by QAware GmbH
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
QAware GmbH16 views
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before. by QAware GmbH
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
QAware GmbH20 views
Kubernetes with Cilium in AWS - Experience Report! by QAware GmbH
Kubernetes with Cilium in AWS - Experience Report!Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!
QAware GmbH45 views
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP by QAware GmbH
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAPKontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
QAware GmbH20 views
Blue turns green! Approaches and technologies for sustainable K8s clusters. by QAware GmbH
Blue turns green! Approaches and technologies for sustainable K8s clusters.Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.
QAware GmbH32 views
Per Anhalter zu Cloud Nativen API Gateways by QAware GmbH
Per Anhalter zu Cloud Nativen API GatewaysPer Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API Gateways
QAware GmbH30 views
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster by QAware GmbH
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
QAware GmbH22 views
How to speed up Spring Integration Tests by QAware GmbH
How to speed up Spring Integration TestsHow to speed up Spring Integration Tests
How to speed up Spring Integration Tests
QAware GmbH21 views
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster by QAware GmbH
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-ClusterAus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
QAware GmbH42 views
Cloud Migration – Eine Strategie die funktioniert by QAware GmbH
Cloud Migration – Eine Strategie die funktioniertCloud Migration – Eine Strategie die funktioniert
Cloud Migration – Eine Strategie die funktioniert
QAware GmbH27 views
Policy Driven Microservices mit Open Policy Agent by QAware GmbH
Policy Driven Microservices mit Open Policy AgentPolicy Driven Microservices mit Open Policy Agent
Policy Driven Microservices mit Open Policy Agent
QAware GmbH15 views
Make Developers Fly: Principles for Platform Engineering by QAware GmbH
Make Developers Fly: Principles for Platform EngineeringMake Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform Engineering
QAware GmbH58 views
Security Lab: OIDC in der Praxis by QAware GmbH
Security Lab: OIDC in der PraxisSecurity Lab: OIDC in der Praxis
Security Lab: OIDC in der Praxis
QAware GmbH19 views
Die nächsten 100 Microservices by QAware GmbH
Die nächsten 100 MicroservicesDie nächsten 100 Microservices
Die nächsten 100 Microservices
QAware GmbH14 views
Enterprise-level Kubernetes Security mit Open Source Tools - geht das? by QAware GmbH
Enterprise-level Kubernetes Security mit Open Source Tools - geht das?Enterprise-level Kubernetes Security mit Open Source Tools - geht das?
Enterprise-level Kubernetes Security mit Open Source Tools - geht das?
QAware GmbH33 views
Put the ‘Auto’ in Autoscaling – Make Kubernetes VPA and HPA work together for... by QAware GmbH
Put the ‘Auto’ in Autoscaling – Make Kubernetes VPA and HPA work together for...Put the ‘Auto’ in Autoscaling – Make Kubernetes VPA and HPA work together for...
Put the ‘Auto’ in Autoscaling – Make Kubernetes VPA and HPA work together for...
QAware GmbH19 views

Recently uploaded

Applying Platform Engineering Thinking to Observability.pdf by
Applying Platform Engineering Thinking to Observability.pdfApplying Platform Engineering Thinking to Observability.pdf
Applying Platform Engineering Thinking to Observability.pdfNatan Yellin
12 views16 slides
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Donato Onofri
643 views34 slides
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
31 views83 slides
ict act 1.pptx by
ict act 1.pptxict act 1.pptx
ict act 1.pptxsanjaniarun08
12 views17 slides
Tridens DevOps by
Tridens DevOpsTridens DevOps
Tridens DevOpsTridens
9 views28 slides
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... by
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...Deltares
10 views23 slides

Recently uploaded(20)

Applying Platform Engineering Thinking to Observability.pdf by Natan Yellin
Applying Platform Engineering Thinking to Observability.pdfApplying Platform Engineering Thinking to Observability.pdf
Applying Platform Engineering Thinking to Observability.pdf
Natan Yellin12 views
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri643 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller31 views
Tridens DevOps by Tridens
Tridens DevOpsTridens DevOps
Tridens DevOps
Tridens9 views
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... by Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares10 views
What Can Employee Monitoring Software Do?​ by wAnywhere
What Can Employee Monitoring Software Do?​What Can Employee Monitoring Software Do?​
What Can Employee Monitoring Software Do?​
wAnywhere18 views
Software evolution understanding: Automatic extraction of software identifier... by Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan... by Deltares
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...
Deltares10 views
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge... by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
Deltares16 views
Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... by Deltares
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
Deltares15 views
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM... by Deltares
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
Deltares7 views
Les nouveautés produit Neo4j by Neo4j
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4j
Neo4j27 views
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... by Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares9 views
MariaDB stored procedures and why they should be improved by Federico Razzoli
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improved
Neo4j y GenAI by Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j35 views
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... by Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 views

Go for Operations

  • 1. Go for Operations Code Days 2021 Digital, February 10th 2021 @LeanderReimer #cloudnativenerd #qaware #CodeDays
  • 2. Mario-Leander Reimer Principal Software Architect @LeanderReimer #cloudnativenerd #qaware
  • 3. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc 3 Code & Demos https://github.com/qaware/go-for-operations 

  • 4. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc How do you organise and enable DevOps teams for fast fl ow and high productivity? 4
  • 5. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Too much cognitive load will become a bottleneck for fast fl ow and high productivity. • Instrinsic Cognitive Load - relates to fundamental aspects and knowledge in the problem space (e.g. used languages, APIs, frameworks) • Extraneous Cognitive Load - relates to the environment 
 (e.g. deployment, con fi guration, console commands) • Germane Cognitive Load - relates to speci fi c aspects of the business domain (aka. „value added“ thinking) 5 https://teamtopologies.com https://web.devopstopologies.com
  • 6. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Eliminate extraneous cognitive load 
 Minimize intrinsic cognitive load 6
  • 7. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc 7
  • 8. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Use the right tools for the job! 8 Getty Images Liliboas Ansible Shell Scripts Golang Ruby Python
  • 9. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Why Go? • Go is Open Source and maintained by Google • Go is an e ffi cient distributed, parallel language for systems programming at Google to solve problems of C++ code • Single, self contained binary. Runs almost on any platform and OS. • Vivid community. Good documentation. Good Tooling. • Go is the major language behind the Cloud Native Stack, many important components are written in Go 9
  • 10. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc The outline for today 1. Getting to Know Go: Basics and Tooling 2. Building CLI applications with Cobra 3. Implementing custom kubectl plugins 4. Building a Sidecar container 5. Building a Kubernetes Operator in Go 10
  • 11. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc 11 https:/ /gobyexample.com https:/ /learnxinyminutes.com/docs/go/
  • 12. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc The renaissance of the plain old Make fi le 12 VERSION = v1.0.0 .PHONY: build build: # omit the symbol table, debug information and the DWARF table @go build -o go-example -ldflags="-s -w -X main.version=$(VERSION)" clean: @go clean test: build @go test -v all: clean build test release: all @goreleaser --snapshot --skip-publish --rm-dist
  • 13. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Use GoReleaser to publish multi OS binaries • Cross-compile your Go project • Release to GitHub, GitLab and Gitea • Create Docker images and manifests • Create Linux packages and Homebrew taps • Upload to Bintray, Artifactory to Public Cloud Blob Stores • ... and much more! 13 project_name: go-example before: hooks: - go mod download builds: - env: - CGO_ENABLED=0 goos: - linux - windows - darwin goarch: - 386 - amd64 ldflags: -s -w -X main.version={{.Version}} archives: - name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ format_overrides: - goos: windows format: zip replacements: darwin: Darwin linux: Linux windows: Windows 386: i386 amd64: x86_64
  • 14. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc The Swiss Army Knife of Operations. 14 CLIs - The Swiss Army Knife of Operations
  • 15. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc The basics of 12-factor CLI apps • Great help is essential. What version am I on? • Prefer fl ags to positional arguments. • Mind the streams. stdout is for output, stderr is for messaging. • Handle things going wrong: error code, title, how to fi x, URL, … • Be fancy: use colours, have shell completion. • Prompt if you can. • Be speedy. CLIs need to start fast. • Be clear about subcommands. 15 For complete list and info, read https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46
  • 16. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Introducing • https://github.com/spf13/cobra • Cobra is a library providing a simple interface to create powerful modern CLI interfaces similar to git & go tools. • Cobra is also an application that will generate your application scaffolding to rapidly develop a Cobra-based application. • Cobra is used in many Go projects such as Kubernetes, Docker, Skaffold, Helm and Istio just to name a few. 16
  • 18. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Container Orchestration Patterns 18 Sidecar Container 
 Extended Container Behaviour • Log Extraction / Reformatting 
 ( fl uentd, fi le beat) • Scheduling (cron, quartz) Ambassador Container 
 Proxy Communication • TLS Tunnel (ghostunnel, Istio) • Circuit Breaking (linked, Istio) • Request Monitoring (linked, Istio) Adapter Container 
 Standardized Ops Interfaces • Monitoring (Prometheus) • Con fi guration (Con fi gMaps, Secrets, …)
  • 19. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Use a multi-stage Docker fi le to build Linux binary 19 FROM golang:1.15.2 as builder WORKDIR /build COPY . /build RUN go build -o logship-sidecar -ldflags="-s -w" FROM gcr.io/distroless/static-debian10 COPY --from=builder /build/logship-sidecar / ENV LOG_DIRECTORY=/logs ENV LOG_FILE_PATTERN=.+.gz ENV LOG_SCAN_INTERVAL=10 ENTRYPOINT ["/logship-sidecar"] CMD [""] Stage 1: Building Stage 2: Running
  • 20. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc 20 Operator. - Do stuff to my Kubernetes.
  • 21. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc What are operators? • Operators are codi fi ed Ops procedures! • Operators are the path towards Zero-Ops. They enable auto-updating, self-monitoring and self-healing infrastructure and applications. • The concept was coined in the Kubernetes world. It’s now been adopted and used widespread in the cloud native world. • Examples: OKD, Sealed Secrets, Kube Monkey, Weave Flux 21
  • 22. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Kubernetes API Extensions via Custom Resources • User de fi ned extensions of the Kubernetes APIs • Allow the abstraction of complex application constructs and concepts • De fi nition solely via CustomResourceDefinitions • Structure de fi nition via OpenAPI v3.0 Validation Schema • Default Support for several API Features: CRUD, Watch, Discovery, json-patch, merge-patch, Admission Webhooks, Metadata, RBAC, … • Versioning und Conversion supported via Webhooks 22
  • 23. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc 23 apiVersion: v1 kind: Service metadata: name: nginx-service spec: type: LoadBalancer ports: - port: 80 protocol: TCP selector: app: nginx apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels: app: nginx replicas: 2 template: metadata: labels: app: nginx environment: integration spec: containers: - name: nginx image: nginx:1.19.4-alpine ports: - containerPort: 80 # probe definitions # resource constraints # volumes and mounts apiVersion: k8s.qaware.de/v1alpha1 kind: Microservice metadata: name: microservice-example labels: app: nginx spec: image: nginx:1.19.4-alpine replicas: 2 serviceType: LoadBalancer ports: - 80 + =
  • 24. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Kubernetes Operators Explained 24 https://github.com/qaware/graal-operators https://github.com/qaware/go-for-operations
  • 25. // Code Days 2021 Digital —> Go for Operations // @LeanderReimer #cloudnativenerd #qaware #CodeDays #OOPmuc Introducing the Operator SDK 25
  • 26. Mario-Leander Reimer Principal Software Architect, QAware GmbH mario-leander.reimer@qaware.de https://www.qaware.de https://speakerdeck.com/lreimer/ https://github.com/lreimer/ &