SlideShare a Scribd company logo
Ko – fast kubernetes
microservice development
in Go
# Ask Sangam
Biradar Podcast
◎ Author - engineITops.com
◎ Golang | Docker | Kubernetes –Trainer
◎ Published Author : lightweight Kubernetes with k3s with
packt Publication
◎ Gopherlabs.collabnix.com
◎ Core Contributor – Dockerlabs
◎ startup accelerator and incubator
◎ Razorops – Container Native CI/CD
Bangalore Meetup Organizer
◎okteto – Kubernetes Developer Tool Bangalore
Meetup Organizer
◎Docker Community – india | Rancher | Influxdb
◎Google Scholar –(published 2 international research
paper)
2
Lot of hype about
containers.
Docker, Kubernetes and related technology have taken the public cloud storm
At same time , it seems as software projects grow increasingly more complex ,
so too does the development process .
3
4
docker build docker push kubectl apply
users run
maybe multi-stage dockerfile
go build
Starts as :
5
go buildgo build
go build
docker
build
docker
builddocker build
docker push
docker push
docker push
kubectl
apply
users run
onepermicroservice
Quickly Becomes:
6
go buildgo build
go build
docker
build
docker
builddocker build
docker push
docker push
docker push
kubectl apply
dockerfile
Skaffold.yaml or makerfile or yamls
yamls
ko takes a different approach that leans into Go idioms to
eliminate configuration.
◎ installing ko itself
go get github.com/google/go-containerregistry/cmd/ko
7
# https://github.com/google/ko/blob/master/cmd/ko/test/test.yaml
apiVersion: v1
kind: Pod
metadata:
name: kodata
spec:
containers:
- name: test
# ko builds and publishes this Go binary, and replaces this
# with an image name.
image: github.com/google/go-containerregistry/cmd/ko/test
restartPolicy: Never
!
“
One of the goals of ko is to make containers invisible
infrastructure.
Simply replace image references in your Kubernetes yaml with
the import path for your Go binary, and ko will handle
containerizing and publishing that container image as needed.
8
How do I consume this with ko ?
◎ edit .bashrc file:
◎ export KO_DOCKER_REPO= image/go binary
◎ NOTE: for DockerHub users this should be: docker.io/username
9
Infinity loop of pain and suffer
◎ Change code
◎ Run Docker Build
◎ Run Docker Push
◎ Patch yaml
◎ Run Kubectl apply
◎ Verify
10
“
You only write Kubernetes yamls and code. No Dockerfiles, no
Makefiles. You run one command and your latest code is running.
11
12
go buildgo build
go build
docker pushusers run publishpublish
Kubectl apply
Ko apply
ko runs
no config
With Minikube
◎ ko exposes --local or -L options to instead publish the images to the local
machine's Docker daemon.
# Use the minikube docker daemon.
◎ eval $(minikube docker-env)
# Make sure minikube is the current kubectl context.
◎ kubectl config use-context minikube
# Deploy to minikube w/o registry.
◎ ko apply -L -f config/
# This is the same as above.
◎ KO_DOCKER_REPO=ko.local ko apply -f config/
13
Ko CLI
14
Ko publish publish simply builds and publishes images for each import path passed as an
argument. It prints the images' published digests after each image is published.
($ ko publish github.com/sangam14/warm-image/cmd/sleeper)
ko resolve ko resolve takes Kubernetes yaml files in the style of kubectl apply and
determines the set of Go import paths to build, containerize, and publish.
ko apply ko apply is intended to parallel kubectl apply, but acts on the same resolved output
as ko resolve emits. It is expected that ko apply will act as the vehicle for rapid
iteration during development. As changes are made to a particular application, you
can run: ko apply -f unit.yaml to rapidly rebuild, repush, and redeploy their
changes.
ko apply will invoke kubectl apply under the hood, and therefore apply to
whatever kubectl context is active
ko delete ko delete simply passes through to kubectl delete. It is exposed purely out of
convenience for cleaning up resources created through ko apply.
Thanks!
Any questions?
15
@sangambiradar@BiradarSangamSangam Biradar

More Related Content

What's hot (20)

PDF
Dockerize Spago Self Contained ML & NLP Library & Deploy on Okteto Cloud Usin...
sangam biradar
 
PDF
Docker based-Pipelines with Codefresh
Codefresh
 
PDF
Happy Helming With Okteto
sangam biradar
 
PDF
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
sangam biradar
 
PPTX
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
PPTX
From java monolith to kubernetes microservices - an open source journey with ...
Ryan Dawson
 
PDF
Behind the scenes with Docker volume plugins
ClusterHQ
 
PPTX
Multi-stage Docker builds to make building easy!
Milindu Sanoj Kumarage
 
PDF
Criando pipelines de entrega contínua multilinguagem com Docker e Jenkins
Camilo Ribeiro
 
PDF
K8s
Sam Zheng
 
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
PPTX
Kubernetes service with ha
Sam Zheng
 
PDF
Continuous Deployment with Kubernetes, Docker and GitLab CI
alexanderkiel
 
PDF
ConcourseCi Dockerimage
Gwenn Etourneau
 
PDF
Workshop - Golang language
Vincent Composieux
 
PDF
Breaking Bad Habits with GitLab CI
Ivan Nemytchenko
 
PDF
5 Habits of High-Velocity Teams Using Kubernetes
Codefresh
 
PDF
Breaking bad habits with GitLab CI
Ivan Nemytchenko
 
PDF
Git 101: Git and GitHub for Beginners
HubSpot
 
PDF
Using GitLab CI
ColCh
 
Dockerize Spago Self Contained ML & NLP Library & Deploy on Okteto Cloud Usin...
sangam biradar
 
Docker based-Pipelines with Codefresh
Codefresh
 
Happy Helming With Okteto
sangam biradar
 
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
sangam biradar
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
From java monolith to kubernetes microservices - an open source journey with ...
Ryan Dawson
 
Behind the scenes with Docker volume plugins
ClusterHQ
 
Multi-stage Docker builds to make building easy!
Milindu Sanoj Kumarage
 
Criando pipelines de entrega contínua multilinguagem com Docker e Jenkins
Camilo Ribeiro
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
Kubernetes service with ha
Sam Zheng
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
alexanderkiel
 
ConcourseCi Dockerimage
Gwenn Etourneau
 
Workshop - Golang language
Vincent Composieux
 
Breaking Bad Habits with GitLab CI
Ivan Nemytchenko
 
5 Habits of High-Velocity Teams Using Kubernetes
Codefresh
 
Breaking bad habits with GitLab CI
Ivan Nemytchenko
 
Git 101: Git and GitHub for Beginners
HubSpot
 
Using GitLab CI
ColCh
 

Similar to Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, EngineITops (20)

PPTX
Kubernetes Introduction
Eric Gustafson
 
PDF
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
PDF
Craig Box (Google) - The road to Kubernetes 1.0
Outlyer
 
PDF
Kubernetes - Starting with 1.2
William Stewart
 
PDF
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
PDF
Kubernetes for the PHP developer
Paul Czarkowski
 
PPTX
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
PPTX
Kubernetes by Jai
DignitasDigital1
 
PPTX
Introduction kubernetes 2017_12_24
Sam Zheng
 
PDF
Kubernetes
Meng-Ze Lee
 
PDF
Kubernetes for Java Developers
Anthony Dahanne
 
PDF
Introduction to Kubernetes.pdf
EonMorgan2
 
PDF
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Anthony Dahanne
 
PDF
Devops with Docker and K8S + django example
AminBhd
 
PDF
Building APIs with kubernetes
Jon Gear
 
PDF
Kubernetes: Learning from Zero to Production
Rosemary Wang
 
PDF
1. CNCF kubernetes meetup - Ondrej Sika
Juraj Hantak
 
PPTX
Kubernetes 101
Huy Vo
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PDF
The App Developer's Kubernetes Toolbox
Nebulaworks
 
Kubernetes Introduction
Eric Gustafson
 
Get you Java application ready for Kubernetes !
Anthony Dahanne
 
Craig Box (Google) - The road to Kubernetes 1.0
Outlyer
 
Kubernetes - Starting with 1.2
William Stewart
 
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
Kubernetes for the PHP developer
Paul Czarkowski
 
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
Kubernetes by Jai
DignitasDigital1
 
Introduction kubernetes 2017_12_24
Sam Zheng
 
Kubernetes
Meng-Ze Lee
 
Kubernetes for Java Developers
Anthony Dahanne
 
Introduction to Kubernetes.pdf
EonMorgan2
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Anthony Dahanne
 
Devops with Docker and K8S + django example
AminBhd
 
Building APIs with kubernetes
Jon Gear
 
Kubernetes: Learning from Zero to Production
Rosemary Wang
 
1. CNCF kubernetes meetup - Ondrej Sika
Juraj Hantak
 
Kubernetes 101
Huy Vo
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
The App Developer's Kubernetes Toolbox
Nebulaworks
 
Ad

More from sangam biradar (14)

PDF
Terrascan - Cloud Native Security Tool
sangam biradar
 
PDF
XCloudLabs- AWS Overview
sangam biradar
 
PDF
Rustlabs Quick Start
sangam biradar
 
PDF
Okteto For Kubernetes Developer :- Container Camp 2020
sangam biradar
 
PDF
5 cool ways to get started with Cloud Native Development ( with Okteto)
sangam biradar
 
PDF
kikstart journey of Golang with Hello world - Gopherlabs
sangam biradar
 
PDF
Decision making - for loop , nested loop ,if-else statements , switch in goph...
sangam biradar
 
PDF
Types - slice, map, new, make, struct - Gopherlabs
sangam biradar
 
PDF
welcome to gopherlabs - why go (golang)?
sangam biradar
 
PDF
Rabncher Meetup India , Lightweight Kubernetes Development with K3s, k3os and...
sangam biradar
 
PDF
Introducing Pico - A Deep Learning Platform using Docker & IoT - Sangam Biradar
sangam biradar
 
PDF
September 7, 2019 Cloud Native and Containerisation (Joint Meetup with Docke...
sangam biradar
 
PPTX
Implementing Lightweight Kubernetes(K3s) on Raspberry Pi Stack - Sangam Biradar
sangam biradar
 
PDF
Docker on IOT - Dockercon19 SFO Recap & Announcements, Bangalore
sangam biradar
 
Terrascan - Cloud Native Security Tool
sangam biradar
 
XCloudLabs- AWS Overview
sangam biradar
 
Rustlabs Quick Start
sangam biradar
 
Okteto For Kubernetes Developer :- Container Camp 2020
sangam biradar
 
5 cool ways to get started with Cloud Native Development ( with Okteto)
sangam biradar
 
kikstart journey of Golang with Hello world - Gopherlabs
sangam biradar
 
Decision making - for loop , nested loop ,if-else statements , switch in goph...
sangam biradar
 
Types - slice, map, new, make, struct - Gopherlabs
sangam biradar
 
welcome to gopherlabs - why go (golang)?
sangam biradar
 
Rabncher Meetup India , Lightweight Kubernetes Development with K3s, k3os and...
sangam biradar
 
Introducing Pico - A Deep Learning Platform using Docker & IoT - Sangam Biradar
sangam biradar
 
September 7, 2019 Cloud Native and Containerisation (Joint Meetup with Docke...
sangam biradar
 
Implementing Lightweight Kubernetes(K3s) on Raspberry Pi Stack - Sangam Biradar
sangam biradar
 
Docker on IOT - Dockercon19 SFO Recap & Announcements, Bangalore
sangam biradar
 
Ad

Recently uploaded (20)

PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
July Patch Tuesday
Ivanti
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 

Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, EngineITops

  • 1. Ko – fast kubernetes microservice development in Go
  • 2. # Ask Sangam Biradar Podcast ◎ Author - engineITops.com ◎ Golang | Docker | Kubernetes –Trainer ◎ Published Author : lightweight Kubernetes with k3s with packt Publication ◎ Gopherlabs.collabnix.com ◎ Core Contributor – Dockerlabs ◎ startup accelerator and incubator ◎ Razorops – Container Native CI/CD Bangalore Meetup Organizer ◎okteto – Kubernetes Developer Tool Bangalore Meetup Organizer ◎Docker Community – india | Rancher | Influxdb ◎Google Scholar –(published 2 international research paper) 2
  • 3. Lot of hype about containers. Docker, Kubernetes and related technology have taken the public cloud storm At same time , it seems as software projects grow increasingly more complex , so too does the development process . 3
  • 4. 4 docker build docker push kubectl apply users run maybe multi-stage dockerfile go build Starts as :
  • 5. 5 go buildgo build go build docker build docker builddocker build docker push docker push docker push kubectl apply users run onepermicroservice Quickly Becomes:
  • 6. 6 go buildgo build go build docker build docker builddocker build docker push docker push docker push kubectl apply dockerfile Skaffold.yaml or makerfile or yamls yamls
  • 7. ko takes a different approach that leans into Go idioms to eliminate configuration. ◎ installing ko itself go get github.com/google/go-containerregistry/cmd/ko 7 # https://github.com/google/ko/blob/master/cmd/ko/test/test.yaml apiVersion: v1 kind: Pod metadata: name: kodata spec: containers: - name: test # ko builds and publishes this Go binary, and replaces this # with an image name. image: github.com/google/go-containerregistry/cmd/ko/test restartPolicy: Never !
  • 8. “ One of the goals of ko is to make containers invisible infrastructure. Simply replace image references in your Kubernetes yaml with the import path for your Go binary, and ko will handle containerizing and publishing that container image as needed. 8
  • 9. How do I consume this with ko ? ◎ edit .bashrc file: ◎ export KO_DOCKER_REPO= image/go binary ◎ NOTE: for DockerHub users this should be: docker.io/username 9
  • 10. Infinity loop of pain and suffer ◎ Change code ◎ Run Docker Build ◎ Run Docker Push ◎ Patch yaml ◎ Run Kubectl apply ◎ Verify 10
  • 11. “ You only write Kubernetes yamls and code. No Dockerfiles, no Makefiles. You run one command and your latest code is running. 11
  • 12. 12 go buildgo build go build docker pushusers run publishpublish Kubectl apply Ko apply ko runs no config
  • 13. With Minikube ◎ ko exposes --local or -L options to instead publish the images to the local machine's Docker daemon. # Use the minikube docker daemon. ◎ eval $(minikube docker-env) # Make sure minikube is the current kubectl context. ◎ kubectl config use-context minikube # Deploy to minikube w/o registry. ◎ ko apply -L -f config/ # This is the same as above. ◎ KO_DOCKER_REPO=ko.local ko apply -f config/ 13
  • 14. Ko CLI 14 Ko publish publish simply builds and publishes images for each import path passed as an argument. It prints the images' published digests after each image is published. ($ ko publish github.com/sangam14/warm-image/cmd/sleeper) ko resolve ko resolve takes Kubernetes yaml files in the style of kubectl apply and determines the set of Go import paths to build, containerize, and publish. ko apply ko apply is intended to parallel kubectl apply, but acts on the same resolved output as ko resolve emits. It is expected that ko apply will act as the vehicle for rapid iteration during development. As changes are made to a particular application, you can run: ko apply -f unit.yaml to rapidly rebuild, repush, and redeploy their changes. ko apply will invoke kubectl apply under the hood, and therefore apply to whatever kubectl context is active ko delete ko delete simply passes through to kubectl delete. It is exposed purely out of convenience for cleaning up resources created through ko apply.