Urgent.News

What's breaking now, across thousands of outlets.

Tech

JumpToTech — Weekend Kubernetes Production Lab

Restaurant Company: Deploy, Configure, Scale & Troubleshoot Goal You are the DevOps Engineer responsible for deploying the Restaurant Company application into Kubernetes. By the end of this lab, you should be able to explain and demonstrate: EKS Cluster ↓ Worker Node ↓ Deployment ↓ ReplicaSet ↓ Pods ↓ Service ↓ Application ConfigMap + Secret ↓ Pods Resources CPU + Memory ↓ Pods Metrics Server ↓…

In this weekend Kubernetes production lab, DevOps Engineers are tasked with deploying the Restaurant Company application into Kubernetes. By the end of the lab, they should be able to explain and demonstrate various Kubernetes components and concepts.

First, verify the Kubernetes environment by running `kubectl get nodes` to check the status of worker nodes. The worker node should appear as "Ready." Use `kubectl get nodes -o wide` and `kubectl describe node` to gather more information about the node's capacity and allocated resources. Capacity refers to the total resources available on the node (CPU, memory, and pods), while Allocatable represents the resources that can be used by the pods running on the node.

Allocatable can be smaller than Capacity due to system overhead and other constraints. If Allocatable is smaller than Capacity, the node can still run fewer pods than its total capacity.

Next, create a working directory named `~/weekend-k8s-lab` and navigate into it. In this directory, create four essential files: `configmap.yaml`, `secret.yaml`, `deployment.yaml`, and `service.yaml`. These files will define the ConfigMap, Secret, Deployment, and Service for the Restaurant Company application.

A ConfigMap is used to store non-sensitive configuration data separately from the application image. In this lab, we create a ConfigMap named `restaurant-config` with two key-value pairs: `APP_ENV` set to "production" and `APP_NAME` set to "restaurant-company." By using a ConfigMap, configuration details can be easily modified without changing the Docker image.

Similarly, a Secret is used to store sensitive information, such as passwords, in a secure manner. In this lab, we create a Secret named `restaurant-secret` containing the `DB_PASSWORD` for the MySQL database. Remember, Kubernetes Secrets are not automatically safe, and real production passwords should never be committed to GitHub. Also, base64 encoding is not encryption.

Finally, create a Deployment named `nginx-deployment` that runs two replicas of the Nginx container. The Deployment specifies the required environment variables and resource requests and limits for the Nginx container. The resource requests are set to 100m CPU and 128Mi memory, while the limits are set to 500m CPU and 256Mi memory.

This ensures the Nginx container receives sufficient resources while preventing it from consuming too much of the node's resources. Additionally, the Deployment includes readiness and liveness probes to monitor the container's health.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Managing Agent Worktrees in Git

Running parallel AI coding agents across shared repositories via Git worktrees prevents duplicate cloning, but it exposes critical operational edge cases.

  • Agents working in shared Git repositories risk corrupting history with destructive commands.
  • Git worktrees share object database and reflogs, causing hidden state changes during rollbacks.
  • Orchestrator should generate deterministic branch names and treat worktrees as disposable cattle.

A git tag is not a release: requests v2.16.1 declares 2.16.0

In psf/requests, the tag v2.16.1 points at code whose __version__.py says 2.16.0 . The tag v2.16.0 says the same, and the code differs between them.

  • Git tag v2.16.1 points to code version 2.16.0
  • Tag v2.16.0 also points to same code version
  • Discrepancy raises question of tags being different things

More from Saturday 10 October →