Infrastructure 2.0
Deepak Sood - https://www.linkedin.com/in/deepaksood619
Values
• Infrastructure as Code (IaC)
• Test then deploy
• Deploy once, run anywhere (don’t depend on proprietary
services/cloud)
• Everything should be documented
• Everything opensource and free to use
• Hiring, KT, Onboarding of new developers should be seamless and
easy
• Distributed, Highly scalable, Fault Tolerant, Resilient
Microservices Architecture
• Cloud native is a term used to describe container-based environments. Cloud-
native technologies are used to develop applications built with services packaged
in containers, deployed as microservices and managed on elastic infrastructure
through agile DevOps processes and continuous delivery workflows.
• 10 Commandments of Microservices Architecture
• Clean separation of stateless and stateful services
• Do not share libraries or SDKs
• Avoid host affinity
• Focus on services with one task in mind
• Use lightweight messaging protocol for communication
• Design a well-defined entry point and exit point
• Implement a self-registration and discovery mechanism
• Explicitly check for rules and constraints
• Prefer polyglot over single stack
• Maintain independent revisions and build environments
Technologies
Current Tools New Tools
Infrastructure Provisioning Terraform / Ansible
CI / CD Pipeline AWS Code Pipeline / Jenkins Jenkins
Server / Container
Orchestration
EC2 instances Kubernetes
Service Mesh Istio
Monitoring New relic / AWS Cloudwatch Prometheus, Alertmanager, Grafana
Logging Elasticsearch, Fluentd, Kibana
Job Orchestrator CronJobs / GCP Cron Scheduler Airflow
Environment Native Deployments Docker
Data Pipeline (ETL) Python scripts / cronjobs
Databases MySQL / Redshift
Terraform / Ansible
• Declarative Programming tool for automating infrastructure resource
creation
• Key Features
• Infrastructure as Code
• Execution Plans
• Resource Graph
• Change Automation
• Creating new infrastructure is a code change (commit, PR, merge)
• Ansible – Tool for managing fleet of servers
Jenkins (CI / CD Tool)
• Jenkins is a continuous integration tool which enables software teams
to build the integration pipelines for their projects.
Kubernetes
• Software tools to manage and coordinate containers
• Key Features
• Automatic Binpacking
• Horizontal Scaling
• Automated rollouts and rollbacks
• Storage Orchestration
• Self-healing
• Service discovery and load balancing
• Secret and Configuration Management
• Batch Execution
Other Features
• Blue/green deployment, canary deployment
• Long running services, but also batch (one-off) jobs
• Overcommit our cluster and evict low-priority jobs
• Run services with stateful data (databases etc.)
• Fine-grained access control defining what can be done
by whom on which resources
• Integrating third party services (service catalog)
• Automating complex tasks (operators)
• CronJobs
Istio
• Istio is an open platform for providing a uniform way to integrate microservices,
manage traffic flow across microservices, enforce policies and aggregate telemetry
data. Istio's control plane provides an abstraction layer over the underlying cluster
management platform, such as Kubernetes, Mesos, etc.
• Key Features
• Code Independent (Polyglot)
• Intelligent Routing and Load-Balancing
• A/B Tests
• Smarter Canary Releases
• Chaos: Fault Injection
• Resilience
• Circuit Breakers
• Retries, Failovers
• Single Authentication and Authorization service, User Management (keycloak)
• Fleet wide policy enforcement
• A pluggable policy layer and configuration API supporting access controls, rate limits and quotas.
• Automatic load balancing for HTTP, gRPC, WebSocket, and TCP traffic.
• Automatic metrics, logs, and traces for all traffic within a cluster, including cluster ingress and
egress.
Istio (Service Mesh)
Monitoring (Prometheus, Alertmanager, Grafana)
• A CNCF (Cloud Native Computing Foundation) project, is a systems and service
monitoring system. It collects metrics from configured targets at given intervals,
evaluates rule expressions, displays the results, and can trigger alerts if some
condition is observed to be true.
• The Alertmanager handles alerts sent by client applications such as the
Prometheus server. It takes care of deduplicating, grouping, and routing them to
the correct receiver integration such as email, Slack, PagerDuty, or OpsGenie. It
also takes care of silencing and inhibition of alerts.
• Key Features
• Grouping
• Inhibition
• Silences
• The open platform for beautiful analytics and monitoring (open source software
for time series analytics)
Logging (Elasticsearch, Fluentd, Kibana)
• Elasticsearch is a distributed, scalable, real-time search and analytics engine. It
enables you to search, analyze, and explore your data. It exists because raw data
sitting on a hard drive is just not useful.
• Fluentd is an open source data collector for unified logging layer.
• Kibana is a visualization layer that works on top of Elasticsearch.
• Other features
• Heartbeats
• Metrics / APM (Application Performance Monitoring)
• Elastalert (Alerting over logs)
• spike
• frequency
• flatline
• new_term
• change
Job Orchestrator (Airflow)
• Airflow is a platform to programmatically author, schedule and
monitor workflows.
• Use airflow to author workflows as directed acyclic graphs (DAGs) of
tasks. The airflow scheduler executes your tasks on an array of
workers while following the specified dependencies. Rich command
line utilities make performing complex surgeries on DAGs a snap. The
rich user interface makes it easy to visualize pipelines running in
production, monitor progress, and troubleshoot issues when needed.
• When workflows are defined as code, they become more
maintainable, versionable, testable, and collaborative.
Docker
• Docker is a tool for deploying isolated, or containerized, applications.
Docker containers are similar to virtual machines in a sense, but
much more lightweight both in size and resource consumption.
• Code once, run everywhere
• Doesn’t depend on environment
• Every dependency is packed inside an image
• Easy to scale horizontally
Data Pipeline
• Kafka
• Kafka Streams
• Spark
• Pig / Hive
• OLTP vs OLAP Workloads
• File formats
• Parquets
• ORC
Onboarding Applications
• Steps
1. Dockerizing Application
2. Creating a Jenkins pipeline
3. Deploying in staging environment
4. Deploying in production after Q&A
Summary
• Terraform
• Jenkins
• Kubernetes
• Istio
• Monitoring stack (Prometheus, Alertmanager, Grafana)
• Logging stack (Elasticsearch, Fluentd, Kibana)
• Job Orchestrator (Airflow)
• Docker
• Data Pipeline
• Onboarding Applications
Questions
Deepak Sood
Linkedin - https://www.linkedin.com/in/deepaksood619
Website - http://deepaksood619.github.io/
Twitter - https://twitter.com/@deepaksood619
Github - https://github.com/deepaksood619
Email - deepaksood619@gmail.com

Kubernetes Infra 2.0

  • 1.
    Infrastructure 2.0 Deepak Sood- https://www.linkedin.com/in/deepaksood619
  • 2.
    Values • Infrastructure asCode (IaC) • Test then deploy • Deploy once, run anywhere (don’t depend on proprietary services/cloud) • Everything should be documented • Everything opensource and free to use • Hiring, KT, Onboarding of new developers should be seamless and easy • Distributed, Highly scalable, Fault Tolerant, Resilient
  • 3.
    Microservices Architecture • Cloudnative is a term used to describe container-based environments. Cloud- native technologies are used to develop applications built with services packaged in containers, deployed as microservices and managed on elastic infrastructure through agile DevOps processes and continuous delivery workflows. • 10 Commandments of Microservices Architecture • Clean separation of stateless and stateful services • Do not share libraries or SDKs • Avoid host affinity • Focus on services with one task in mind • Use lightweight messaging protocol for communication • Design a well-defined entry point and exit point • Implement a self-registration and discovery mechanism • Explicitly check for rules and constraints • Prefer polyglot over single stack • Maintain independent revisions and build environments
  • 4.
    Technologies Current Tools NewTools Infrastructure Provisioning Terraform / Ansible CI / CD Pipeline AWS Code Pipeline / Jenkins Jenkins Server / Container Orchestration EC2 instances Kubernetes Service Mesh Istio Monitoring New relic / AWS Cloudwatch Prometheus, Alertmanager, Grafana Logging Elasticsearch, Fluentd, Kibana Job Orchestrator CronJobs / GCP Cron Scheduler Airflow Environment Native Deployments Docker Data Pipeline (ETL) Python scripts / cronjobs Databases MySQL / Redshift
  • 5.
    Terraform / Ansible •Declarative Programming tool for automating infrastructure resource creation • Key Features • Infrastructure as Code • Execution Plans • Resource Graph • Change Automation • Creating new infrastructure is a code change (commit, PR, merge) • Ansible – Tool for managing fleet of servers
  • 6.
    Jenkins (CI /CD Tool) • Jenkins is a continuous integration tool which enables software teams to build the integration pipelines for their projects.
  • 8.
    Kubernetes • Software toolsto manage and coordinate containers • Key Features • Automatic Binpacking • Horizontal Scaling • Automated rollouts and rollbacks • Storage Orchestration • Self-healing • Service discovery and load balancing • Secret and Configuration Management • Batch Execution
  • 9.
    Other Features • Blue/greendeployment, canary deployment • Long running services, but also batch (one-off) jobs • Overcommit our cluster and evict low-priority jobs • Run services with stateful data (databases etc.) • Fine-grained access control defining what can be done by whom on which resources • Integrating third party services (service catalog) • Automating complex tasks (operators) • CronJobs
  • 11.
    Istio • Istio isan open platform for providing a uniform way to integrate microservices, manage traffic flow across microservices, enforce policies and aggregate telemetry data. Istio's control plane provides an abstraction layer over the underlying cluster management platform, such as Kubernetes, Mesos, etc. • Key Features • Code Independent (Polyglot) • Intelligent Routing and Load-Balancing • A/B Tests • Smarter Canary Releases • Chaos: Fault Injection • Resilience • Circuit Breakers • Retries, Failovers • Single Authentication and Authorization service, User Management (keycloak) • Fleet wide policy enforcement • A pluggable policy layer and configuration API supporting access controls, rate limits and quotas. • Automatic load balancing for HTTP, gRPC, WebSocket, and TCP traffic. • Automatic metrics, logs, and traces for all traffic within a cluster, including cluster ingress and egress.
  • 12.
  • 14.
    Monitoring (Prometheus, Alertmanager,Grafana) • A CNCF (Cloud Native Computing Foundation) project, is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true. • The Alertmanager handles alerts sent by client applications such as the Prometheus server. It takes care of deduplicating, grouping, and routing them to the correct receiver integration such as email, Slack, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts. • Key Features • Grouping • Inhibition • Silences • The open platform for beautiful analytics and monitoring (open source software for time series analytics)
  • 19.
    Logging (Elasticsearch, Fluentd,Kibana) • Elasticsearch is a distributed, scalable, real-time search and analytics engine. It enables you to search, analyze, and explore your data. It exists because raw data sitting on a hard drive is just not useful. • Fluentd is an open source data collector for unified logging layer. • Kibana is a visualization layer that works on top of Elasticsearch. • Other features • Heartbeats • Metrics / APM (Application Performance Monitoring) • Elastalert (Alerting over logs) • spike • frequency • flatline • new_term • change
  • 21.
    Job Orchestrator (Airflow) •Airflow is a platform to programmatically author, schedule and monitor workflows. • Use airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The airflow scheduler executes your tasks on an array of workers while following the specified dependencies. Rich command line utilities make performing complex surgeries on DAGs a snap. The rich user interface makes it easy to visualize pipelines running in production, monitor progress, and troubleshoot issues when needed. • When workflows are defined as code, they become more maintainable, versionable, testable, and collaborative.
  • 24.
    Docker • Docker isa tool for deploying isolated, or containerized, applications. Docker containers are similar to virtual machines in a sense, but much more lightweight both in size and resource consumption. • Code once, run everywhere • Doesn’t depend on environment • Every dependency is packed inside an image • Easy to scale horizontally
  • 25.
    Data Pipeline • Kafka •Kafka Streams • Spark • Pig / Hive • OLTP vs OLAP Workloads • File formats • Parquets • ORC
  • 26.
    Onboarding Applications • Steps 1.Dockerizing Application 2. Creating a Jenkins pipeline 3. Deploying in staging environment 4. Deploying in production after Q&A
  • 27.
    Summary • Terraform • Jenkins •Kubernetes • Istio • Monitoring stack (Prometheus, Alertmanager, Grafana) • Logging stack (Elasticsearch, Fluentd, Kibana) • Job Orchestrator (Airflow) • Docker • Data Pipeline • Onboarding Applications
  • 28.
    Questions Deepak Sood Linkedin -https://www.linkedin.com/in/deepaksood619 Website - http://deepaksood619.github.io/ Twitter - https://twitter.com/@deepaksood619 Github - https://github.com/deepaksood619 Email - deepaksood619@gmail.com