SlideShare a Scribd company logo
How Kubernetes Operators can Rescue
DevSecOps in midst of a Pandemic?
Shikha Srivastava
Distinguished Engineer, Master Inventor, IBM
Twitter: @shikhasthoughts
LinkedIn : https://www.linkedin.com/in/shikhasriva/
Swati Shridhar Nair
Software Engineer, IBM
Twitter: @swatn73
LinkedIn: https://www.linkedin.com/in/swatishr/
Cloud adoption brings a dramatic shift in speed
and scale
• Speed to Market
• Modular and Decoupled
• Scalable
• Performance and Stability
• Secure
Automated
deployment
Why Containers
Organizations are adopting containers to improve developer
productivity, efficiency in DevOps, and application portability
• Lightweight packaging that includes the software and all its
dependencies
• Easily portable across on-premises and public cloud environments
• More efficient use of infrastructure than traditional VM deployments
• Improved Security, containers help isolate each part of your system
and provides better control of each component of your system
• No more : ‘it works on my laptop’
Containers services the basis of enabling
decomposed microservices architecture of
cloud native application
Everyone’s container journey starts with one container….
At first the growth is easy to handle….
But soon it is overwhelming… chaos reigns
As adoption grows, organizations need orchestration and
management for their containerized workloads:
• Automated deployment, scaling, and management of
containerized applications
• Self-healing
• Automated rollouts and rollbacks of applications
Regain control with Kubernetes
Kubernetes
• Orchestrates, runs and manages containers
• Continuously monitors and manages your containers
• Will scale your application to handle changes in load
• Helps reduce infrastructure requirements by gracefully
scaling up and down your entire platform
• Coordinates what containers run where and when across
your system
• Supports multiple cloud and bare-metal environments
• 100% Open source, written in Go
• Manage applications, not machines
• Rich ecosystem of plug-ins for scheduling, storage, networking
Kubernetes is an open-source system
for automating deployment, scaling,
and management of containerized
applications.
https://kubernetes.io/docs/concepts/ov
erview/what-is-kubernetes/
KubernetesArchitecture
API
UI
CLI
Kubernetes
Master
Worker Node 1
Worker Node 2
Worker Node 3
Worker Node n
Image Registry
• Etcd
• API Server
• Controller Manager
• Scheduler
Flexible, loosely-coupled architecture with at least one
master and multiple compute nodes
- Nodes: the workhorses, hosts that run Kubernetes
applications. Set of nodes makes up cluster
- Master nodes: Controls and manages the cluster
- API server Front end for the Kubernetes
- Etcd: distributed and reliable key value store
- Scheduler: for distributing containers across nodes
- Controller: brain behind orchestration
- Kubelet: agents on the nodes
- Pods: Smallest deployment unit in K8s
- Collection of containers that run on a worker node
- Each has its own IP
- Pod shares a PID namespace, network, and
hostname
- Service: Collections of pods exposed as an endpoint
- Information stored in the K8s cluster state and
networking info propagated to all worker nodes
Great for Stateless applications
• Kubernetes provides powerful primitives for deploying and managing
stateless applications like web apps, api server etc
• Deployment resources provides a mechanism to declare the desired
state, and to roll out changes in a controlled way
• Kubernetes Example increasing the replicaset can be via kubectl
command
• Service resources provides a mechanism to expose the deployment
externally or internally within
Deployment Pod
Desired
count=3
Current
count=1
Kubectl
Scale up
Deployment Pod
Desired
count=3
Current
count=3
Kubectl
start
$ Kubectl scale deployments/my-app – replicas=3
Real world has stateful apps
• Backups
• Requires coordination among instances
• Upscaling / Downscaling / upgrade with no data loss
• Requires coordination for availability
• Re-Configurations
• Requires template generations
• Healing
• Restore backups, join/ rejoin database clusters
What is an Operator
• A design pattern made public in 2016 by CoreOS (now RedHat)
• Application-specific controllers that extend the Kubernetes API
to create, configure, and manage instances of complex stateful
applications on behalf of a Kubernetes user
• Extend the Kubernetes API through the Custom Resources
(CRD) mechanism Reconciling desired state for your
application
Observe
Analyze
Act
Current state
Compare state to
desired state
Perform all necessary
action to make
current state meet
the desired state
Why Operators
• Automates common Day 1(Installation, Configuration, etc.) and
Day-2 (re-configuration, update, backup, failover, restore, etc.)
• Extends the power of Kubernetes, especially to stateful apps
• Include domain specific knowledge to automate the application
lifecycle in a scalable, repeatable standardized style
• Operator improves resiliency
• Operators makes hybrid and multi cloud easy
Domain
knowledge
Kubernetes
Application
Kubernetes Operators:
take all the knowledge
about an application’s
lifecycle that a
DevSecOps team
practices manually and
systematize it.
Operator Framework
• A set of tools and APIs to build, manage, and monitor Kubernetes Operators
• Includes:
Assists developers to
build Kubernetes operators
Oversees installation, updates, and
lifecycle management of all the operators
running across the Kubernetes cluster
Enables usage reporting for
operators
Source: https://coreos.com/operators/
Operator Phases
• Writing an operator from scratch is difficult and time-
consuming
• An open source toolkit to manage Kubernetes operators
• Operator-SDK provides:
o Command line tools for generating boilerplate code
o High level APIs and abstractions to write the operator
logic
o Extensions to cover common operator use cases
Operator SDK
Enough Talking, Lets see in Action
• Golang Operator Demo
Prerequisites
Know your application
Create a new golang operator project
Add Custom Resource Definition
Add Controller
Explore multiple Operator run options
Run operator locally
Prerequisites
• You know Golang, Kubernetes
• You know your application
• You have access to a Kubernetes v1.11.3+ cluster
• Operator-SDK is installed (We will be working with v0.18.2)
https://sdk.operatorframework.io/docs/installation/install-operator-sdk/
Know Your Application
• Memcached Application
• Controlled using a k8s deployment
• Will have multiple replicas.
• Operator will make replicas to be
configurable
• It uses default port of 11211
• Uses public docker image
Memcached:1.4.36-alpine
How to Build An Operator?
• Create a new project
operator-sdk new memcached-operator --repo=github.com/swatishr/memcached-operator
• Add Memcached API using operator-sdk add api
• Add the configurable fields you need the DevOps to control
• numOfReplicas (desired state)
• overallStatus (shows current state)
• Add controller (brain of the operator)
• Add watch for Memcached CR and Memcached Deployment
• Add reconciliation logic for current state  desired state
Memcached
CRD
cache.demo.com/v1alpha1
CR
kind: Memcached
spec:
size: 3
status:
overallStatus:
Create New Operator Project
Add MemcachedAPI
Edit _types.go
GenerateCRD
Add Controller
Fetch
Memcached
instance
Matches
desired
state?
Deployment
Exists?
Not
Found
?
Create new
deployment
Exist
?
Return
Update deployment
to match desired
state
Requeue the
request with
error
Return & don't
requeue
Update
Memcached
Status
Yes No
No
No
No
YesYes
Yes
Reconcile logic
Run Operator
• Run as a deployment in Kubernetes Cluster
• Build operator image and push in a registry
• Replace fields in operator.yaml deployment spec
• Deploy CRDs, RBAC resources, operator deployment
• Apply CR
• Run locally (Used during development)
• Create CRD
• Run operator locally using operator-sdk run local
• Apply CR
You can achieve even more!
https://github.com/ianlewis/memcached-operatorRef:
Useful Links
• Kubernetes: https://kubernetes.io/
• Containers and Kubernetes :https://medium.com/ibm-cloud/7-missing-factors-from-12-factor-
application-2a3e1169bd9d
• Operator SDK: https://sdk.operatorframework.io/
• Operator framework: https://github.com/operator-framework
• Operator Hub for existing operators: https://operatorhub.io/
• OLM : https://docs.openshift.com/container-platform/4.1/applications/operators/olm-understandi
olm.html
ThankYou
Backup
Operator Constructs
Memcached CRD
cache.demo.com/v1alpha1
CR
kind: Memcached
spec:
size: 3
status:
memcachedStatus:
DesiredState
Operator Controller
- Watches memcached CR
instance and resultant
memcached deployment
- Reconcilation logic
Current State  Desired State
- Operator itself is deployed as a
Deployment and runs in a Pod
Memcached deployment
Pod#1 Pod#2 Pod#3
Current State
Install options: Helm, Ansible, Operators
• Helm
o Package management system for Kubernetes.
o Kubernetes equivalent of yum or apt
o Provides commands/tools to support Day 1 activities (install, upgrade, rollback, delete)
• Ansible
o Application automation tool; supports Day 1 operations
o Supports container build, cluster management with external integrations, application lifecycle
• Operators
o Complete automation of Day 1 and Day2 operations using Go-based operators, along with advanced support
for k8s use cases
o Steep learning curve for Go operators
o But, Operator-SDK provides support to build helm and ansible operators as well

More Related Content

What's hot

Keeping your Kubernetes Cluster Secure
Keeping your Kubernetes Cluster SecureKeeping your Kubernetes Cluster Secure
Keeping your Kubernetes Cluster Secure
Gene Gotimer
 
Moving Applications into Azure Kubernetes
Moving Applications into Azure KubernetesMoving Applications into Azure Kubernetes
Moving Applications into Azure Kubernetes
Hussein Salman
 
Ricardo Fiel - Microsoft - OSL19
Ricardo Fiel - Microsoft - OSL19Ricardo Fiel - Microsoft - OSL19
Ricardo Fiel - Microsoft - OSL19
marketingsyone
 
Going Serverless with Kubeless In Google Container Engine (GKE)
Going Serverless with Kubeless In Google Container Engine (GKE)Going Serverless with Kubeless In Google Container Engine (GKE)
Going Serverless with Kubeless In Google Container Engine (GKE)
Bitnami
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
Julio Aziz Flores Casab
 
Getting Started with Infrastructure as Code (IaC)
Getting Started with Infrastructure as Code (IaC)Getting Started with Infrastructure as Code (IaC)
Getting Started with Infrastructure as Code (IaC)
Noor Basha
 
Continuous Delivery on Kubernetes Using Spinnaker
Continuous Delivery on Kubernetes Using SpinnakerContinuous Delivery on Kubernetes Using Spinnaker
Continuous Delivery on Kubernetes Using Spinnaker
WSO2
 
Francisco Javier Ramirez Urea - Hopla - OSL19
Francisco Javier Ramirez Urea - Hopla - OSL19Francisco Javier Ramirez Urea - Hopla - OSL19
Francisco Javier Ramirez Urea - Hopla - OSL19
marketingsyone
 
Serverless Summit India 2017: Fission
Serverless Summit India 2017: FissionServerless Summit India 2017: Fission
Serverless Summit India 2017: Fission
Vishal Biyani
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
RightScale
 
Using Rancher and Docker with RightScale at Industrie IT
Using Rancher and Docker with RightScale at Industrie IT Using Rancher and Docker with RightScale at Industrie IT
Using Rancher and Docker with RightScale at Industrie IT
RightScale
 
How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)
Krishna-Kumar
 
DockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise Edition
DockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise EditionDockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise Edition
DockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise Edition
Docker, Inc.
 
Technical Capabilities of the kitsune framework
Technical Capabilities of the kitsune frameworkTechnical Capabilities of the kitsune framework
Technical Capabilities of the kitsune framework
Ronak Samantray
 
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
WSO2
 
Monitoring Containerized Application in Alibaba Cloud
Monitoring Containerized Application in Alibaba CloudMonitoring Containerized Application in Alibaba Cloud
Monitoring Containerized Application in Alibaba Cloud
gavaskar s
 
Setup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes FederationSetup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes Federation
inwin stack
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
Carlos Cavero Barca
 
Docker for the Enterprise with Containers as a Service by Banjot Chanana
Docker for the Enterprise with Containers as a Service by Banjot ChananaDocker for the Enterprise with Containers as a Service by Banjot Chanana
Docker for the Enterprise with Containers as a Service by Banjot Chanana
Docker, Inc.
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
Aakash Singhal
 

What's hot (20)

Keeping your Kubernetes Cluster Secure
Keeping your Kubernetes Cluster SecureKeeping your Kubernetes Cluster Secure
Keeping your Kubernetes Cluster Secure
 
Moving Applications into Azure Kubernetes
Moving Applications into Azure KubernetesMoving Applications into Azure Kubernetes
Moving Applications into Azure Kubernetes
 
Ricardo Fiel - Microsoft - OSL19
Ricardo Fiel - Microsoft - OSL19Ricardo Fiel - Microsoft - OSL19
Ricardo Fiel - Microsoft - OSL19
 
Going Serverless with Kubeless In Google Container Engine (GKE)
Going Serverless with Kubeless In Google Container Engine (GKE)Going Serverless with Kubeless In Google Container Engine (GKE)
Going Serverless with Kubeless In Google Container Engine (GKE)
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
 
Getting Started with Infrastructure as Code (IaC)
Getting Started with Infrastructure as Code (IaC)Getting Started with Infrastructure as Code (IaC)
Getting Started with Infrastructure as Code (IaC)
 
Continuous Delivery on Kubernetes Using Spinnaker
Continuous Delivery on Kubernetes Using SpinnakerContinuous Delivery on Kubernetes Using Spinnaker
Continuous Delivery on Kubernetes Using Spinnaker
 
Francisco Javier Ramirez Urea - Hopla - OSL19
Francisco Javier Ramirez Urea - Hopla - OSL19Francisco Javier Ramirez Urea - Hopla - OSL19
Francisco Javier Ramirez Urea - Hopla - OSL19
 
Serverless Summit India 2017: Fission
Serverless Summit India 2017: FissionServerless Summit India 2017: Fission
Serverless Summit India 2017: Fission
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
 
Using Rancher and Docker with RightScale at Industrie IT
Using Rancher and Docker with RightScale at Industrie IT Using Rancher and Docker with RightScale at Industrie IT
Using Rancher and Docker with RightScale at Industrie IT
 
How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)
 
DockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise Edition
DockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise EditionDockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise Edition
DockerCon 18 Cool Hacks: Cloud Native ML with Docker Enterprise Edition
 
Technical Capabilities of the kitsune framework
Technical Capabilities of the kitsune frameworkTechnical Capabilities of the kitsune framework
Technical Capabilities of the kitsune framework
 
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
Achieve business agility with Cloud APIs, Cloud-aware Apps, and Cloud DevOps ...
 
Monitoring Containerized Application in Alibaba Cloud
Monitoring Containerized Application in Alibaba CloudMonitoring Containerized Application in Alibaba Cloud
Monitoring Containerized Application in Alibaba Cloud
 
Setup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes FederationSetup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes Federation
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
 
Docker for the Enterprise with Containers as a Service by Banjot Chanana
Docker for the Enterprise with Containers as a Service by Banjot ChananaDocker for the Enterprise with Containers as a Service by Banjot Chanana
Docker for the Enterprise with Containers as a Service by Banjot Chanana
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 

Similar to How kubernetes operators can rescue dev secops in midst of a pandemic updated

Kubernetes: від знайомства до використання у CI/CD
Kubernetes: від знайомства до використання у CI/CDKubernetes: від знайомства до використання у CI/CD
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups
 
Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23
msohn
 
Simplify Your Way To Expert Kubernetes Management
Simplify Your Way To Expert Kubernetes ManagementSimplify Your Way To Expert Kubernetes Management
Simplify Your Way To Expert Kubernetes Management
DevOps.com
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Develop and deploy Kubernetes  applications with Docker - IBM Index 2018Develop and deploy Kubernetes  applications with Docker - IBM Index 2018
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Patrick Chanezon
 
Evolving for Kubernetes
Evolving for KubernetesEvolving for Kubernetes
Evolving for Kubernetes
Chris McEniry
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on KubernetesDeploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
All Things Open
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
ObjectRocket
 
Kubernetes Clusters as a Service with Gardener
Kubernetes Clusters as a Service with GardenerKubernetes Clusters as a Service with Gardener
Kubernetes Clusters as a Service with Gardener
QAware GmbH
 
From Containerized Application to Secure and Scaling With Kubernetes
From Containerized Application to Secure and Scaling With KubernetesFrom Containerized Application to Secure and Scaling With Kubernetes
From Containerized Application to Secure and Scaling With Kubernetes
Shikha Srivastava
 
Migrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKS
Migrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKSMigrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKS
Migrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKS
Weaveworks
 
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
VMware Tanzu
 
Accelerate Application Innovation Journey with Azure Kubernetes Service
Accelerate Application Innovation Journey with Azure Kubernetes Service Accelerate Application Innovation Journey with Azure Kubernetes Service
Accelerate Application Innovation Journey with Azure Kubernetes Service
WinWire Technologies Inc
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
Kumton Suttiraksiri
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Huy Vo
 
Kubernetes intro
Kubernetes introKubernetes intro
Kubernetes intro
Pravin Magdum
 
Container Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher KubernetesContainer Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher Kubernetes
Vishal Biyani
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
Ryuzaki360
 
DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...
DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...
DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...
Docker, Inc.
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanKubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-Hassan
Syed Murtaza Hassan
 

Similar to How kubernetes operators can rescue dev secops in midst of a pandemic updated (20)

Kubernetes: від знайомства до використання у CI/CD
Kubernetes: від знайомства до використання у CI/CDKubernetes: від знайомства до використання у CI/CD
Kubernetes: від знайомства до використання у CI/CD
 
Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23
 
Simplify Your Way To Expert Kubernetes Management
Simplify Your Way To Expert Kubernetes ManagementSimplify Your Way To Expert Kubernetes Management
Simplify Your Way To Expert Kubernetes Management
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Develop and deploy Kubernetes  applications with Docker - IBM Index 2018Develop and deploy Kubernetes  applications with Docker - IBM Index 2018
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
 
Evolving for Kubernetes
Evolving for KubernetesEvolving for Kubernetes
Evolving for Kubernetes
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on KubernetesDeploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
 
Kubernetes Clusters as a Service with Gardener
Kubernetes Clusters as a Service with GardenerKubernetes Clusters as a Service with Gardener
Kubernetes Clusters as a Service with Gardener
 
From Containerized Application to Secure and Scaling With Kubernetes
From Containerized Application to Secure and Scaling With KubernetesFrom Containerized Application to Secure and Scaling With Kubernetes
From Containerized Application to Secure and Scaling With Kubernetes
 
Migrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKS
Migrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKSMigrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKS
Migrating from Self-Managed Kubernetes on EC2 to a GitOps Enabled EKS
 
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
 
Accelerate Application Innovation Journey with Azure Kubernetes Service
Accelerate Application Innovation Journey with Azure Kubernetes Service Accelerate Application Innovation Journey with Azure Kubernetes Service
Accelerate Application Innovation Journey with Azure Kubernetes Service
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes intro
Kubernetes introKubernetes intro
Kubernetes intro
 
Container Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher KubernetesContainer Conf 2017: Rancher Kubernetes
Container Conf 2017: Rancher Kubernetes
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
 
DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...
DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...
DockerCon SF 2015 : Reliably shipping containers in a resource rich world usi...
 
Kubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-HassanKubernetes-Presentation-Syed-Murtaza-Hassan
Kubernetes-Presentation-Syed-Murtaza-Hassan
 

More from Shikha Srivastava

ADDO_2022_SRE Architectural Patterns_Nov10.pptx
ADDO_2022_SRE Architectural Patterns_Nov10.pptxADDO_2022_SRE Architectural Patterns_Nov10.pptx
ADDO_2022_SRE Architectural Patterns_Nov10.pptx
Shikha Srivastava
 
DevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptx
DevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptxDevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptx
DevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptx
Shikha Srivastava
 
WITS 2022_ModernizationAndInfrastructureAsCode.pptx
WITS 2022_ModernizationAndInfrastructureAsCode.pptxWITS 2022_ModernizationAndInfrastructureAsCode.pptx
WITS 2022_ModernizationAndInfrastructureAsCode.pptx
Shikha Srivastava
 
Using Cloud-Native and SRE Principles to Achieve Speed and Resiliency
Using Cloud-Native and SRE Principles to Achieve Speed and ResiliencyUsing Cloud-Native and SRE Principles to Achieve Speed and Resiliency
Using Cloud-Native and SRE Principles to Achieve Speed and Resiliency
Shikha Srivastava
 
Managing integration in a multi cluster world
Managing integration in a multi cluster worldManaging integration in a multi cluster world
Managing integration in a multi cluster world
Shikha Srivastava
 
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor appsKube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
Shikha Srivastava
 
Why Ibm cloud private
Why Ibm cloud private Why Ibm cloud private
Why Ibm cloud private
Shikha Srivastava
 
Bluemix application monitoring
Bluemix application monitoring Bluemix application monitoring
Bluemix application monitoring
Shikha Srivastava
 
Modernization: Moving workloads to cloud
Modernization: Moving workloads to cloud Modernization: Moving workloads to cloud
Modernization: Moving workloads to cloud
Shikha Srivastava
 
Kibana globalization at the RTP meetup
Kibana globalization at the RTP meetupKibana globalization at the RTP meetup
Kibana globalization at the RTP meetup
Shikha Srivastava
 
Localizing kibana for the global language landscape
Localizing kibana for the global language landscapeLocalizing kibana for the global language landscape
Localizing kibana for the global language landscape
Shikha Srivastava
 
Developing and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud PrivateDeveloping and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud Private
Shikha Srivastava
 
4789 creating production-ready, secure and scalable applications in ibm cloud...
4789 creating production-ready, secure and scalable applications in ibm cloud...4789 creating production-ready, secure and scalable applications in ibm cloud...
4789 creating production-ready, secure and scalable applications in ibm cloud...
Shikha Srivastava
 
Panelist at women breakfast discussing latest technology trends at Elasticon
Panelist at women breakfast discussing latest technology trends at Elasticon Panelist at women breakfast discussing latest technology trends at Elasticon
Panelist at women breakfast discussing latest technology trends at Elasticon
Shikha Srivastava
 

More from Shikha Srivastava (14)

ADDO_2022_SRE Architectural Patterns_Nov10.pptx
ADDO_2022_SRE Architectural Patterns_Nov10.pptxADDO_2022_SRE Architectural Patterns_Nov10.pptx
ADDO_2022_SRE Architectural Patterns_Nov10.pptx
 
DevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptx
DevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptxDevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptx
DevOpsEnterpriseSummit_SaaSAnd DisasterRecovery.pptx
 
WITS 2022_ModernizationAndInfrastructureAsCode.pptx
WITS 2022_ModernizationAndInfrastructureAsCode.pptxWITS 2022_ModernizationAndInfrastructureAsCode.pptx
WITS 2022_ModernizationAndInfrastructureAsCode.pptx
 
Using Cloud-Native and SRE Principles to Achieve Speed and Resiliency
Using Cloud-Native and SRE Principles to Achieve Speed and ResiliencyUsing Cloud-Native and SRE Principles to Achieve Speed and Resiliency
Using Cloud-Native and SRE Principles to Achieve Speed and Resiliency
 
Managing integration in a multi cluster world
Managing integration in a multi cluster worldManaging integration in a multi cluster world
Managing integration in a multi cluster world
 
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor appsKube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
 
Why Ibm cloud private
Why Ibm cloud private Why Ibm cloud private
Why Ibm cloud private
 
Bluemix application monitoring
Bluemix application monitoring Bluemix application monitoring
Bluemix application monitoring
 
Modernization: Moving workloads to cloud
Modernization: Moving workloads to cloud Modernization: Moving workloads to cloud
Modernization: Moving workloads to cloud
 
Kibana globalization at the RTP meetup
Kibana globalization at the RTP meetupKibana globalization at the RTP meetup
Kibana globalization at the RTP meetup
 
Localizing kibana for the global language landscape
Localizing kibana for the global language landscapeLocalizing kibana for the global language landscape
Localizing kibana for the global language landscape
 
Developing and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud PrivateDeveloping and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud Private
 
4789 creating production-ready, secure and scalable applications in ibm cloud...
4789 creating production-ready, secure and scalable applications in ibm cloud...4789 creating production-ready, secure and scalable applications in ibm cloud...
4789 creating production-ready, secure and scalable applications in ibm cloud...
 
Panelist at women breakfast discussing latest technology trends at Elasticon
Panelist at women breakfast discussing latest technology trends at Elasticon Panelist at women breakfast discussing latest technology trends at Elasticon
Panelist at women breakfast discussing latest technology trends at Elasticon
 

Recently uploaded

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 

Recently uploaded (20)

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 

How kubernetes operators can rescue dev secops in midst of a pandemic updated

  • 1.
  • 2.
  • 3. How Kubernetes Operators can Rescue DevSecOps in midst of a Pandemic? Shikha Srivastava Distinguished Engineer, Master Inventor, IBM Twitter: @shikhasthoughts LinkedIn : https://www.linkedin.com/in/shikhasriva/ Swati Shridhar Nair Software Engineer, IBM Twitter: @swatn73 LinkedIn: https://www.linkedin.com/in/swatishr/
  • 4. Cloud adoption brings a dramatic shift in speed and scale • Speed to Market • Modular and Decoupled • Scalable • Performance and Stability • Secure Automated deployment
  • 5. Why Containers Organizations are adopting containers to improve developer productivity, efficiency in DevOps, and application portability • Lightweight packaging that includes the software and all its dependencies • Easily portable across on-premises and public cloud environments • More efficient use of infrastructure than traditional VM deployments • Improved Security, containers help isolate each part of your system and provides better control of each component of your system • No more : ‘it works on my laptop’ Containers services the basis of enabling decomposed microservices architecture of cloud native application
  • 6. Everyone’s container journey starts with one container….
  • 7. At first the growth is easy to handle….
  • 8. But soon it is overwhelming… chaos reigns
  • 9. As adoption grows, organizations need orchestration and management for their containerized workloads: • Automated deployment, scaling, and management of containerized applications • Self-healing • Automated rollouts and rollbacks of applications Regain control with Kubernetes
  • 10. Kubernetes • Orchestrates, runs and manages containers • Continuously monitors and manages your containers • Will scale your application to handle changes in load • Helps reduce infrastructure requirements by gracefully scaling up and down your entire platform • Coordinates what containers run where and when across your system • Supports multiple cloud and bare-metal environments • 100% Open source, written in Go • Manage applications, not machines • Rich ecosystem of plug-ins for scheduling, storage, networking Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. https://kubernetes.io/docs/concepts/ov erview/what-is-kubernetes/
  • 11. KubernetesArchitecture API UI CLI Kubernetes Master Worker Node 1 Worker Node 2 Worker Node 3 Worker Node n Image Registry • Etcd • API Server • Controller Manager • Scheduler Flexible, loosely-coupled architecture with at least one master and multiple compute nodes - Nodes: the workhorses, hosts that run Kubernetes applications. Set of nodes makes up cluster - Master nodes: Controls and manages the cluster - API server Front end for the Kubernetes - Etcd: distributed and reliable key value store - Scheduler: for distributing containers across nodes - Controller: brain behind orchestration - Kubelet: agents on the nodes - Pods: Smallest deployment unit in K8s - Collection of containers that run on a worker node - Each has its own IP - Pod shares a PID namespace, network, and hostname - Service: Collections of pods exposed as an endpoint - Information stored in the K8s cluster state and networking info propagated to all worker nodes
  • 12. Great for Stateless applications • Kubernetes provides powerful primitives for deploying and managing stateless applications like web apps, api server etc • Deployment resources provides a mechanism to declare the desired state, and to roll out changes in a controlled way • Kubernetes Example increasing the replicaset can be via kubectl command • Service resources provides a mechanism to expose the deployment externally or internally within Deployment Pod Desired count=3 Current count=1 Kubectl Scale up Deployment Pod Desired count=3 Current count=3 Kubectl start $ Kubectl scale deployments/my-app – replicas=3
  • 13. Real world has stateful apps • Backups • Requires coordination among instances • Upscaling / Downscaling / upgrade with no data loss • Requires coordination for availability • Re-Configurations • Requires template generations • Healing • Restore backups, join/ rejoin database clusters
  • 14. What is an Operator • A design pattern made public in 2016 by CoreOS (now RedHat) • Application-specific controllers that extend the Kubernetes API to create, configure, and manage instances of complex stateful applications on behalf of a Kubernetes user • Extend the Kubernetes API through the Custom Resources (CRD) mechanism Reconciling desired state for your application Observe Analyze Act Current state Compare state to desired state Perform all necessary action to make current state meet the desired state
  • 15. Why Operators • Automates common Day 1(Installation, Configuration, etc.) and Day-2 (re-configuration, update, backup, failover, restore, etc.) • Extends the power of Kubernetes, especially to stateful apps • Include domain specific knowledge to automate the application lifecycle in a scalable, repeatable standardized style • Operator improves resiliency • Operators makes hybrid and multi cloud easy Domain knowledge Kubernetes Application Kubernetes Operators: take all the knowledge about an application’s lifecycle that a DevSecOps team practices manually and systematize it.
  • 16. Operator Framework • A set of tools and APIs to build, manage, and monitor Kubernetes Operators • Includes: Assists developers to build Kubernetes operators Oversees installation, updates, and lifecycle management of all the operators running across the Kubernetes cluster Enables usage reporting for operators Source: https://coreos.com/operators/
  • 18. • Writing an operator from scratch is difficult and time- consuming • An open source toolkit to manage Kubernetes operators • Operator-SDK provides: o Command line tools for generating boilerplate code o High level APIs and abstractions to write the operator logic o Extensions to cover common operator use cases Operator SDK
  • 19. Enough Talking, Lets see in Action • Golang Operator Demo Prerequisites Know your application Create a new golang operator project Add Custom Resource Definition Add Controller Explore multiple Operator run options Run operator locally
  • 20. Prerequisites • You know Golang, Kubernetes • You know your application • You have access to a Kubernetes v1.11.3+ cluster • Operator-SDK is installed (We will be working with v0.18.2) https://sdk.operatorframework.io/docs/installation/install-operator-sdk/
  • 21. Know Your Application • Memcached Application • Controlled using a k8s deployment • Will have multiple replicas. • Operator will make replicas to be configurable • It uses default port of 11211 • Uses public docker image Memcached:1.4.36-alpine
  • 22. How to Build An Operator? • Create a new project operator-sdk new memcached-operator --repo=github.com/swatishr/memcached-operator • Add Memcached API using operator-sdk add api • Add the configurable fields you need the DevOps to control • numOfReplicas (desired state) • overallStatus (shows current state) • Add controller (brain of the operator) • Add watch for Memcached CR and Memcached Deployment • Add reconciliation logic for current state  desired state Memcached CRD cache.demo.com/v1alpha1 CR kind: Memcached spec: size: 3 status: overallStatus:
  • 25.
  • 29. Fetch Memcached instance Matches desired state? Deployment Exists? Not Found ? Create new deployment Exist ? Return Update deployment to match desired state Requeue the request with error Return & don't requeue Update Memcached Status Yes No No No No YesYes Yes Reconcile logic
  • 30.
  • 31. Run Operator • Run as a deployment in Kubernetes Cluster • Build operator image and push in a registry • Replace fields in operator.yaml deployment spec • Deploy CRDs, RBAC resources, operator deployment • Apply CR • Run locally (Used during development) • Create CRD • Run operator locally using operator-sdk run local • Apply CR
  • 32.
  • 33. You can achieve even more! https://github.com/ianlewis/memcached-operatorRef:
  • 34. Useful Links • Kubernetes: https://kubernetes.io/ • Containers and Kubernetes :https://medium.com/ibm-cloud/7-missing-factors-from-12-factor- application-2a3e1169bd9d • Operator SDK: https://sdk.operatorframework.io/ • Operator framework: https://github.com/operator-framework • Operator Hub for existing operators: https://operatorhub.io/ • OLM : https://docs.openshift.com/container-platform/4.1/applications/operators/olm-understandi olm.html
  • 37. Operator Constructs Memcached CRD cache.demo.com/v1alpha1 CR kind: Memcached spec: size: 3 status: memcachedStatus: DesiredState Operator Controller - Watches memcached CR instance and resultant memcached deployment - Reconcilation logic Current State  Desired State - Operator itself is deployed as a Deployment and runs in a Pod Memcached deployment Pod#1 Pod#2 Pod#3 Current State
  • 38. Install options: Helm, Ansible, Operators • Helm o Package management system for Kubernetes. o Kubernetes equivalent of yum or apt o Provides commands/tools to support Day 1 activities (install, upgrade, rollback, delete) • Ansible o Application automation tool; supports Day 1 operations o Supports container build, cluster management with external integrations, application lifecycle • Operators o Complete automation of Day 1 and Day2 operations using Go-based operators, along with advanced support for k8s use cases o Steep learning curve for Go operators o But, Operator-SDK provides support to build helm and ansible operators as well