M4RKYU.SYSEdition 2027
Skip to content
LOCZH/安大略 · 加拿大/▸logs · mastering kubernetes a guide to container orchestration 37fe待机OK/--:--:--EST
M4M4RK_YUportfolio
  • 创作创作
    创作Overview
    • 作品精选案例与项目记录
    • 游戏可玩原型与游戏开发日志
  • 影像影像
    影像Overview
    • 照片影像合集与视觉实验
    • 商店印刷品、海报和限量物件
  • 写作写作
    写作Overview
    • 博客长篇开发日志与现场笔记
    • 笔记短观察、链接与代码片段
  • 资源资源
    资源Overview
    • 工具38 款浏览器内开发工具
    • 链接每日使用的开发与设计书签
  • 关于关于
  • 联系联系
EN

同步 · dev.to / @markyu

Kubernetes Is Useful, but Only After These Basics Hurt

A practical Kubernetes guide for developers: pods, deployments, services, config, scaling, and when not to introduce Kubernetes too early.

发布日期
May 4 '24
·
阅读时长
2 min read
·
点赞
6
kubernetesdevopscontainerscloud
在 dev.to 查看

本页目录

  • What Kubernetes Actually Gives You
  • The Smallest Useful Deployment
  • Add a Service
  • The Debug Commands I Use First
  • Config and Secrets
  • When Kubernetes Is Worth It
  • Final Thought

Kubernetes is not the first tool I reach for.

That may sound strange in 2026, but I still think many teams adopt Kubernetes before their deployment pain is real enough.

Kubernetes helps when you need orchestration. It hurts when you just wanted a place to run one container.

What Kubernetes Actually Gives You

Kubernetes helps manage:

  • container scheduling
  • restarts
  • scaling
  • service discovery
  • rollout strategy
  • configuration
  • workload isolation

The basic shape:

Deployment
   |
   v
ReplicaSet
   |
   v
Pods
   |
   v
Containers

Most beginner confusion comes from mixing up those layers.

The Smallest Useful Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  replicas: 2
  selector:
    matchLabels:
      app: api
  template:
    metadata:
      labels:
        app: api
    spec:
      containers:
        - name: api
          image: nginx:1.27
          ports:
            - containerPort: 80

Apply it:

kubectl apply -f deployment.yaml
kubectl get pods

This does not expose the app yet. It only runs pods.

Add a Service

apiVersion: v1
kind: Service
metadata:
  name: api-service
spec:
  selector:
    app: api
  ports:
    - port: 80
      targetPort: 80
  type: ClusterIP

The service gives stable networking inside the cluster.

client -> service -> matching pods

Pods can die and come back with different IPs. The service keeps the route stable.

The Debug Commands I Use First

kubectl get pods
kubectl describe pod <pod-name>
kubectl logs <pod-name>
kubectl get events --sort-by=.lastTimestamp
kubectl rollout status deployment/api

If a pod is stuck in CrashLoopBackOff, I look at logs first.

If it is stuck in Pending, I look at describe/events because it may be scheduling, resources, or image pulling.

Config and Secrets

Do not bake environment-specific config into images.

Use ConfigMaps for normal config:

apiVersion: v1
kind: ConfigMap
metadata:
  name: api-config
data:
  LOG_LEVEL: "info"

Use Secrets for sensitive values, but remember: Kubernetes Secrets are not magic encryption by default. Treat cluster access seriously.

When Kubernetes Is Worth It

I would consider Kubernetes when:

  • you run many services
  • rollouts need control
  • autoscaling matters
  • workloads need scheduling
  • multiple teams share a platform
  • you already have observability

I would avoid it when:

  • one app can run fine on managed PaaS
  • nobody owns cluster operations
  • logs and metrics are weak
  • the team has no deployment discipline yet

Cloud-native 3.0 is making Kubernetes more platform-like, especially with internal developer portals and AI-assisted operations. Still, the fundamentals have not changed: a confusing cluster is not a platform.

Final Thought

Kubernetes is powerful because it standardizes operational patterns. It is painful because it exposes every weak operational habit your team already had.

What was your first Kubernetes failure: image pull, config, networking, or resources?

相关阅读

Cloud Architecture Choices I Would Not Overcomplicate

A practical 2026 cloud architecture guide for developers choosing between client-server, distributed systems, microservices, serverless, and cloud-native platforms.

cloud

Sustainable Cloud Design Starts With Boring Cost Signals

A practical cloud sustainability guide for developers: right-sizing, autoscaling, regions, storage lifecycle, carbon-aware thinking, and cost visibility.

cloud

Docker Containers: The Commands That Prove Isolation

A practical Docker container guide focused on the commands that show image layers, process isolation, networking, volumes, and debugging.

docker

原文发布

本文首发于 dev.to,评论与点赞保留在原站。

在 dev.to 继续阅读
上一篇AES-CBC vs AES-GCM: The Crypto Choice I’d Make TodayA practical block cipher guide for developers explaining AES modes, CBC pitfalls, GCM authentication, IV rules, and what to avoid in production.
返回全部文章
下一篇VS Code Themes I Can Actually Code In for 8 HoursA practical 2026 refresh of VS Code themes, focused on readability, contrast, fatigue, and real daily developer use.
返回档案
M4RKYUM4RKYUM4RKYUM4RKYUM4RKYUM4RKYUM4RKYUM4RKYU
始于 2024
ZhenXiao Mark YuZhenXiao Mark Yu
联系

看到什么有意思的?和我聊聊。

这是一个作品集,不是服务 · 但每一条留言我都会看 — 如果哪里让你有所触动,或者只想打个招呼,欢迎写信过来。

开启对话
频道开放

随时打个招呼 · 2026

--:--:--EST加拿大 安大略
  • 邮件
  • GitHub
  • dev.to
  • 领英
  • 推特 / X
  • Instagram
  • Facebook
  • YouTube
  • CodePen
  • Spotify
  • Snapchat

订阅

偶尔收到一封简讯

来自 m4rkyu.com 的笔记与日志——简短、标注日期、没有杂音。随时可退订。

作品

线上发布、游戏作品与视觉档案。

  • 项目
  • 游戏
  • 档案
  • 日志

资源

每日好用的工具与个人收藏的链接库。

  • 搜索
  • 最新
  • 工具
  • 链接
  • 笔记
  • 主题
  • 商店
RSSJSON Feed

工作室

背景、联系方式以及合作渠道。

  • 关于
  • 联系
  • 更新日志
  • 技术说明
  • 简历筹备中

社交

在常去的平台上找到我。

  • GitHub
  • dev.to
  • 领英
  • 推特 / X
  • Instagram
  • Facebook
  • YouTube
  • CodePen
  • Spotify
  • Snapchat
  • 邮件
© 2026 ZhenXiao Mark Yumarkyu0615@gmail.com
  • 邮件
  • GitHub
  • dev.to
  • 领英
  • 推特 / X
  • Instagram
  • Facebook
  • YouTube
  • CodePen
  • Spotify
  • Snapchat
隐私条款由 Next.js 16 · React 19 · Tailwind 4 构建