SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Automating
Kubernetes
Environments with
Ansible
●
●
●
●
apiVersion: v1
kind: ConfigMap
metadata:
name: foo
namespace: default
data:
color: red
- name: create foo configmap
k8s:
definition:
apiVersion: v1
kind: ConfigMap
metadata:
name: foo
namespace: default
data:
color: “{{ color }}”
---
- name: create foo configmap
k8s:
definition: "{{ lookup('template', '/foo.yml') | from_yaml
}}"
$ kubectl create -f
deploy/crds/cache.example.com_memcacheds_crd.yaml
$ kubectl create -f deploy/service_account.yaml
$ kubectl create -f deploy/role.yaml
$ kubectl create -f deploy/role_binding.yaml
$ kubectl create -f deploy/operator.yaml
# we are skipping over the instructions to run sed commands or make
# manual edits to these files here.
[k8s-us-east4-test:vars]
cache_service_name: cache-service-test
cache_service_namespace: myapp
cache_service_memcached_pool_size: 3
cache_service_pool_setup: sharded
k8s_cluster_config: /path/to/gke-beta-config
[k8s-us-west1-prod:vars]
cache_service_name: cache-service-prod
cache_service_namespace: myapp
cache_service_memcached_pool_size: 9
cache_service_pool_setup: sharded
k8s_cluster_config: /path/to/gke-prod-config
apiVersion: mcrouter.example.com/v1alpha3
kind: Mcrouter
metadata:
name: {{ cache_service_name }}
namespace: {{ cache_service_namespace }}
spec:
memcached_pool_size: >
{{ cache_service_memcached_pool_size }}
- name: define cache service resource
k8s:
kubeconfig: "{{ k8s_cluster_config | default(omit) }}"
definition: "{{ lookup('template', >
'k8s-cache-service-def.yaml.j2') | from_yaml }}"
● Encode human operational knowledge
● Automatically patch, upgrade, recover, and tune
container-based apps and services
● Kubernetes-native
● Purpose-built for a specific application or service
● Enable “day 2” management
Operators simplify management of complex applications
on Kubernetes
Phase I Phase II Phase III Phase IV Phase V
Basic Install
Automated application
provisioning and
configuration management
Seamless Upgrades
Patch and minor version
upgrades supported
Full Lifecycle
App lifecycle, storage
lifecycle (backup, failure
recovery)
Deep Insights
Metrics, alerts, log
processing and workload
analysis
Auto Pilot
Horizontal/vertical scaling,
auto config tuning, abnormal
detection, scheduling tuning
K8s Operator with Ansible
your Operator image
Ansible Role
Ansible Role
watches.yaml
base Ansible Operator SDK image
Operator SDK Binary
ansible-runner
Ansible
Python + Libraries
● Initialize Your Operator With Ansible
○ $ operator-sdk new foo-operator
--api-version=cache.example.com/v1alpha1 --kind=Foo --type=ansible
● Automate With Ansible
○ Create new roles and playbooks or reuse an existing one
● Define a watches file
○ Map a Kubernetes object to your Ansible content
● Build Your Operator
○ $ operator-sdk build foo-operator:v0.0.1
● Deploy Your Operator to a Kubernetes Cluster
mcroutermcrouter-operator
21
GitOps Workflow
CI REGISTRY
DEV
CODE
REPO
CONFIG
REPO
RW
RWRO
“OPS”
RW
GitOps the Ansible Way
23
CI REGISTRY
DEV
CODE
REPO
CONFIG
REPO
R
W
R
W
R
O
“OPS”
R
W
Advantages of using Ansible
24
GitOps Beyond Cloud-Native
▸ Supports cloud-native and traditional IT
automation
▸ Integrations beyond Kubernetes such as
cloud & networking
Advantages of using Ansible
25
Flexibility To Do More
▸ Flexibility and freedom to choose what you
need
▸ Deploy, manage and automate multiple
environments thru one control plane.
▸ No dedicated GitOps “agent” required
●
●
●
●
Resources & More
27
▸ Ansible K8s Modules
・ https://docs.ansible.com/ansible/latest/modules/list_of_clustering_modules.html#k8s
▸ How Useful Is Ansible In A Cloud-Native Kubernetes Environment?
・ https://www.ansible.com/blog/how-useful-is-ansible-in-a-cloud-native-kubernetes-environment
▸ Building Kubernetes Operators in an Ansible-native way (Webinar)
・ https://www.cncf.io/webinars/building-kubernetes-operators-in-an-ansible-native-way/
▸ Creating Ansible-based Operators
・ https://docs.openshift.com/container-platform/4.5/operators/operator_sdk/osdk-ansible.html
▸ Using Ansible Automation Webhooks for GitOps
・ https://www.redhat.com/sysadmin/ansible-webhooks-gitops
▸ Guide to GitOps
・ https://www.weave.works/technologies/gitops/
Thank you

Contenu connexe

Tendances

Lenovo Rack and Tower Server Portfolio
Lenovo Rack and Tower Server PortfolioLenovo Rack and Tower Server Portfolio
Lenovo Rack and Tower Server PortfolioLenovo Data Center
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security OverviewSreenivas Makam
 
Cloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and TipsCloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and TipsFibonalabs
 
Samba server configuration
Samba server configurationSamba server configuration
Samba server configurationRohit Phulsunge
 
Rancher Simple User Guide
Rancher Simple User GuideRancher Simple User Guide
Rancher Simple User GuideSANG WON PARK
 
Multi Tenancy In The Cloud
Multi Tenancy In The CloudMulti Tenancy In The Cloud
Multi Tenancy In The Cloudrohit_ainapure
 
Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
Samba power point presentation
Samba power point presentationSamba power point presentation
Samba power point presentationMd Maksudur Rahman
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Edureka!
 
Implementation & Comparison Of Rdma Over Ethernet
Implementation & Comparison Of Rdma Over EthernetImplementation & Comparison Of Rdma Over Ethernet
Implementation & Comparison Of Rdma Over EthernetJames Wernicke
 
Fedora history 3441-3408-3437-3423
Fedora history 3441-3408-3437-3423Fedora history 3441-3408-3437-3423
Fedora history 3441-3408-3437-3423Muhammad Saad Hassan
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 

Tendances (20)

Lenovo Rack and Tower Server Portfolio
Lenovo Rack and Tower Server PortfolioLenovo Rack and Tower Server Portfolio
Lenovo Rack and Tower Server Portfolio
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security Overview
 
Cloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and TipsCloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and Tips
 
Terraform
TerraformTerraform
Terraform
 
Samba server configuration
Samba server configurationSamba server configuration
Samba server configuration
 
Rancher Simple User Guide
Rancher Simple User GuideRancher Simple User Guide
Rancher Simple User Guide
 
Create a spectrum analysis ap group
Create a spectrum analysis ap groupCreate a spectrum analysis ap group
Create a spectrum analysis ap group
 
NETCONF YANG tutorial
NETCONF YANG tutorialNETCONF YANG tutorial
NETCONF YANG tutorial
 
Multi Tenancy In The Cloud
Multi Tenancy In The CloudMulti Tenancy In The Cloud
Multi Tenancy In The Cloud
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Samba power point presentation
Samba power point presentationSamba power point presentation
Samba power point presentation
 
Samba server
Samba serverSamba server
Samba server
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
 
Implementation & Comparison Of Rdma Over Ethernet
Implementation & Comparison Of Rdma Over EthernetImplementation & Comparison Of Rdma Over Ethernet
Implementation & Comparison Of Rdma Over Ethernet
 
Cloud computing What Why How
Cloud computing What Why HowCloud computing What Why How
Cloud computing What Why How
 
Cloud Service Models
Cloud Service ModelsCloud Service Models
Cloud Service Models
 
Fedora history 3441-3408-3437-3423
Fedora history 3441-3408-3437-3423Fedora history 3441-3408-3437-3423
Fedora history 3441-3408-3437-3423
 
Terraform
TerraformTerraform
Terraform
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 

Similaire à Automating Kubernetes Environments with Ansible

Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!Rafał Leszko
 
From Kubernetes to OpenStack in Sydney
From Kubernetes to OpenStack in SydneyFrom Kubernetes to OpenStack in Sydney
From Kubernetes to OpenStack in SydneySK Telecom
 
[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdfFrederik Wouters
 
Build your operator with the right tool
Build your operator with the right toolBuild your operator with the right tool
Build your operator with the right toolRafał Leszko
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetesLiran Cohen
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...Tobias Schneck
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operatorsJ On The Beach
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonMyNOG
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle ManagementDoKC
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle ManagementDoKC
 
Spark with kubernates
Spark with kubernatesSpark with kubernates
Spark with kubernatesDavid Tung
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingPiotr Perzyna
 
Shakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformShakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformMinku Lee
 
Openshift operator insight
Openshift operator insightOpenshift operator insight
Openshift operator insightRyan ZhangCheng
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAmazon Web Services
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonIvan Ma
 
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner CloudCreating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner CloudTobias Schneck
 

Similaire à Automating Kubernetes Environments with Ansible (20)

Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!
 
Running kubernetes
Running kubernetesRunning kubernetes
Running kubernetes
 
CKA_1st.pptx
CKA_1st.pptxCKA_1st.pptx
CKA_1st.pptx
 
From Kubernetes to OpenStack in Sydney
From Kubernetes to OpenStack in SydneyFrom Kubernetes to OpenStack in Sydney
From Kubernetes to OpenStack in Sydney
 
[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf
 
Build your operator with the right tool
Build your operator with the right toolBuild your operator with the right tool
Build your operator with the right tool
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Spark with kubernates
Spark with kubernatesSpark with kubernates
Spark with kubernates
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Shakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud PlatformShakr - Container CI/CD with Google Cloud Platform
Shakr - Container CI/CD with Google Cloud Platform
 
Openshift operator insight
Openshift operator insightOpenshift operator insight
Openshift operator insight
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner CloudCreating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
 

Dernier

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Dernier (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Automating Kubernetes Environments with Ansible

  • 2.
  • 4. apiVersion: v1 kind: ConfigMap metadata: name: foo namespace: default data: color: red - name: create foo configmap k8s: definition: apiVersion: v1 kind: ConfigMap metadata: name: foo namespace: default data: color: “{{ color }}”
  • 5. --- - name: create foo configmap k8s: definition: "{{ lookup('template', '/foo.yml') | from_yaml }}"
  • 6.
  • 7.
  • 8. $ kubectl create -f deploy/crds/cache.example.com_memcacheds_crd.yaml $ kubectl create -f deploy/service_account.yaml $ kubectl create -f deploy/role.yaml $ kubectl create -f deploy/role_binding.yaml $ kubectl create -f deploy/operator.yaml # we are skipping over the instructions to run sed commands or make # manual edits to these files here.
  • 9.
  • 10.
  • 11. [k8s-us-east4-test:vars] cache_service_name: cache-service-test cache_service_namespace: myapp cache_service_memcached_pool_size: 3 cache_service_pool_setup: sharded k8s_cluster_config: /path/to/gke-beta-config [k8s-us-west1-prod:vars] cache_service_name: cache-service-prod cache_service_namespace: myapp cache_service_memcached_pool_size: 9 cache_service_pool_setup: sharded k8s_cluster_config: /path/to/gke-prod-config apiVersion: mcrouter.example.com/v1alpha3 kind: Mcrouter metadata: name: {{ cache_service_name }} namespace: {{ cache_service_namespace }} spec: memcached_pool_size: > {{ cache_service_memcached_pool_size }} - name: define cache service resource k8s: kubeconfig: "{{ k8s_cluster_config | default(omit) }}" definition: "{{ lookup('template', > 'k8s-cache-service-def.yaml.j2') | from_yaml }}"
  • 12.
  • 13. ● Encode human operational knowledge ● Automatically patch, upgrade, recover, and tune container-based apps and services ● Kubernetes-native ● Purpose-built for a specific application or service ● Enable “day 2” management Operators simplify management of complex applications on Kubernetes
  • 14. Phase I Phase II Phase III Phase IV Phase V Basic Install Automated application provisioning and configuration management Seamless Upgrades Patch and minor version upgrades supported Full Lifecycle App lifecycle, storage lifecycle (backup, failure recovery) Deep Insights Metrics, alerts, log processing and workload analysis Auto Pilot Horizontal/vertical scaling, auto config tuning, abnormal detection, scheduling tuning
  • 15.
  • 16. K8s Operator with Ansible
  • 17. your Operator image Ansible Role Ansible Role watches.yaml base Ansible Operator SDK image Operator SDK Binary ansible-runner Ansible Python + Libraries
  • 18. ● Initialize Your Operator With Ansible ○ $ operator-sdk new foo-operator --api-version=cache.example.com/v1alpha1 --kind=Foo --type=ansible ● Automate With Ansible ○ Create new roles and playbooks or reuse an existing one ● Define a watches file ○ Map a Kubernetes object to your Ansible content ● Build Your Operator ○ $ operator-sdk build foo-operator:v0.0.1 ● Deploy Your Operator to a Kubernetes Cluster
  • 20.
  • 22. GitOps the Ansible Way 23 CI REGISTRY DEV CODE REPO CONFIG REPO R W R W R O “OPS” R W
  • 23. Advantages of using Ansible 24 GitOps Beyond Cloud-Native ▸ Supports cloud-native and traditional IT automation ▸ Integrations beyond Kubernetes such as cloud & networking
  • 24. Advantages of using Ansible 25 Flexibility To Do More ▸ Flexibility and freedom to choose what you need ▸ Deploy, manage and automate multiple environments thru one control plane. ▸ No dedicated GitOps “agent” required
  • 26. Resources & More 27 ▸ Ansible K8s Modules ・ https://docs.ansible.com/ansible/latest/modules/list_of_clustering_modules.html#k8s ▸ How Useful Is Ansible In A Cloud-Native Kubernetes Environment? ・ https://www.ansible.com/blog/how-useful-is-ansible-in-a-cloud-native-kubernetes-environment ▸ Building Kubernetes Operators in an Ansible-native way (Webinar) ・ https://www.cncf.io/webinars/building-kubernetes-operators-in-an-ansible-native-way/ ▸ Creating Ansible-based Operators ・ https://docs.openshift.com/container-platform/4.5/operators/operator_sdk/osdk-ansible.html ▸ Using Ansible Automation Webhooks for GitOps ・ https://www.redhat.com/sysadmin/ansible-webhooks-gitops ▸ Guide to GitOps ・ https://www.weave.works/technologies/gitops/