# Kubernetes for Business Owners
> **Kubernetes (k8s) is like a smart manager for your business applications.**
k8s is developed by Google managed by the Cloud-Native Computing Foundation (CNCF)
---
## k8s Values and Benefits:
1. **Efficiency**: Kubernetes optimizes your resources, ensuring that your applications are running efficiently. Just like a good manager assigns tasks to employees based on their skills and availability, Kubernetes allocates resources to applications as needed, preventing waste and improving performance.
2. **Reliability**: In business, downtime can be costly. Kubernetes ensures that your applications are highly available. It automatically detects and recovers from failures, making sure your customers can access your services 24/7.
3. **Scalability**: When your business grows, you need to handle more demand. Kubernetes can scale your applications up or down automatically, like hiring more employees during a busy season and letting some go during slow times. This helps you maintain a consistent customer experience without overpaying for resources.
4. **Consistency**: Kubernetes ensures that your applications run consistently across different environments, whether it's your local development environment, testing, or production. This reduces the risk of errors and makes it easier to deploy updates.
5. **Cost Savings**: By efficiently managing resources and automating processes, Kubernetes can help reduce your operational costs. It also enables you to leverage cloud resources more effectively, only paying for what you use.
6. **Flexibility**: Business needs change, and so do your applications. Kubernetes allows you to easily adapt and deploy new features or updates without disrupting your existing services. It's like reconfiguring your factory floor layout without stopping production.
7. **Security**: Kubernetes has built-in security features, ensuring that your applications and data are protected. It's like having a security team that constantly monitors your factory to prevent unauthorized access.
1. **Isolation and Resource Allocation:** containers with resource limits/requests
8. **Ecosystem**: Kubernetes has a thriving ecosystem of tools and services that can enhance your business operations. It's like having access to a marketplace of specialized suppliers for your factory.
---
## Architecture - diagram

---
## Architecture
- Mater node(s)
- API server (the central dispatcher). Stateless rest api: http,json
- ETCD the database of the k8s
- Scheduler: decides which node runs a new pod
- Controller Manager: Manages all the Controllers (like ReplicaSetController)
- Worker Nodes
- Kubelet (agent runninig on each node, connects to API Server)
- Container Runtime (implements CRI) (aka Docker/Containerd)
- Pods: 1 or more containers (side-car pattern)
---
## I heard k8s dropped docker support???


---
## Progress towards k8s
- Must not be all-in
- Start with moving stateless workload to k8s
- maybe:
- devs use docker desktop with a single docker-compose.yaml (you might have to pay)
- ops maintain a helm chart
- importance of a platform team
---
## Kubernetes Distributions
What it is, how to choose?
Vanilla kubernetes doesn’t specifies:
- ingress (http proxy)
- network implementation (CNI) (do you need network policy)
- storage implementation (CSI)
- GUI (k8s dashboard, rancher, portainer)
- Certificates: (free https via LetsEncrypt)
- Secret handling: default is base64**encoding** with RBAC (SealedSecrets/vault/…)
- Observability: monitoring, logging (Prometheus/Grafana/Ellasticsearch)
---
## CNCF Landscape
[https://landscape.cncf.io/](https://landscape.cncf.io/)

---
## Essential Resources
Each resource/object is described as json/yaml (a lot of lines!)




---
## k8s vocabulary - Pod, side-car

---
## k8s vocabulary - Node/Pod/ReplicaSet/Deployment
Workload types
- Deployment
- StatefullSet
- Job/CronJob
- Daemonset

---
## k8s vocabulary - Service

---
## k8s vocabulary - Ingress

---
## Challenges
1. **Learning Curve**: Embracing Kubernetes requires your team to learn new concepts and tools. It's like introducing a new, advanced machinery in your factory – your employees need time to understand how it works and how to operate it effectively. This can lead to a temporary slowdown in productivity as your team adapts.
2. **Application Refactoring**: Many existing applications may need to be modified or "refactored" to work smoothly in a Kubernetes environment. This can be compared to upgrading your manufacturing equipment to meet new industry standards. It's an investment, but it may require time and resources.
3. **Complexity**: Kubernetes is a highly flexible and powerful tool, but this flexibility comes with complexity. Think of it as transitioning from a simple assembly line to a more sophisticated manufacturing process. It may take some effort to configure and manage Kubernetes properly.
4. **Infrastructure Costs**: While Kubernetes can optimize resource usage, setting up and maintaining a Kubernetes cluster can initially incur costs, similar to upgrading your factory infrastructure. It's important to plan for these expenses.
5. **Security and Compliance**: Managing security and compliance in a Kubernetes environment is crucial. It's like implementing rigorous quality control standards in your manufacturing process. Ensuring that your applications and data remain secure can be challenging and may require additional investments.
6. **Monitoring and Troubleshooting**: Kubernetes environments generate a vast amount of data and logs. Just as you would need specialized tools to monitor and troubleshoot complex machinery in your factory, you'll need effective monitoring and alerting systems for Kubernetes to ensure smooth operations.
7. **Team Alignment**: Achieving a successful Kubernetes transformation requires alignment and collaboration across different teams, including development, operations, and security. It's like ensuring that all departments in your company work together seamlessly towards a common goal.
8. **Vendor Lock-In**: Depending on your choices, there's a risk of vendor lock-in when using Kubernetes in the cloud. It's similar to relying on a single supplier for raw materials in your factory. This can limit your flexibility in the future.
9. **Change Management**: Transitioning to Kubernetes is not just a technical shift; it's a cultural change within your organization. Preparing your team for this change is as important as upgrading your production processes.
---
## K8S is complicated
There different [certificates](https://kubernetes.io/training/)
- **KCNA**: Kubernetes and Cloud Native Associate: [curriculum](https://github.com/cncf/curriculum/blob/master/KCNA_Curriculum.pdf)
- **CKAD**: Certified Kubernetes Application Developer
- **CKA**: Certified Kubernetes Administrator
- **CKS**: Certified Kubernetes Security Specialist
If you can, avoid managing your own k8s cluster.
---
## CI/CD
- **Continuous Integration:** Frequently merging into the main codebase
- **Continuous Delivery:** Code **can** be pushed to production at any time
- **Continuous Deployment:** Code **is p**ushed to production automatically
---
## Helm
- Helm: cli tool (and go lib) run on laptop or by ci/cd pipeline
- Chart Repo: [https://hub.helm.sh/](https://hub.helm.sh/)
- Chart: a bunch of **template** (deployment/svc/ing/cm/secret) + default **values** in a tar.gz
- Release: chart + actual values

---
## GITOPS - **A Formal Definition**
- GitOps is a way to do Kubernetes cluster management and application delivery
- It works by using Git as a single source of truth for declarative infrastructure and applications
- With Git at the center of your delivery pipelines, developers use familiar tools to make pull requests to accelerate and simplify both application deployments and operations tasks

{"title":"Kubernetes for Business Owners","description":"Kubernetes is like a smart manager for your business applications.","contributors":"[{\"id\":\"e365c3ac-a07e-4eea-8d94-571fb896469d\",\"add\":9386,\"del\":0}]"}