docker-kubectl-deploy

Docker Kubectl Deploy

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "docker-kubectl-deploy" with this command: npx skills add oldwinter/skills/oldwinter-skills-docker-kubectl-deploy

Docker Kubectl Deploy

使用 docker build → docker push → kubectl set image 的固定流程,把新镜像发布到 Kubernetes 环境,并等待滚动更新完成。

Quick Start

  • 确认本机已配置:docker 、已 docker login 对应镜像仓库;kubectl 、已配置目标集群 kubeconfig

  • 需要的信息:镜像仓库(不带 tag)、K8s 的 context/namespace/deployment/container 、tag(可选)

  • 优先使用脚本:bash scripts/build_push_kubectl.sh --help

Workflow (推荐)

  • 选择镜像引用:<image-repo>:<tag> (tag 默认自动生成)

  • Build:docker build -t <image-repo>:<tag> ...

  • Push:docker push <image-repo>:<tag>

  • Deploy:kubectl set image deployment/<deployment> <container>=<image-repo>:<tag> -n <namespace>

  • 验证:kubectl rollout status deployment/<deployment> -n <namespace>

常用命令(不使用脚本时)

docker build -t IMAGE_REPO:TAG -f Dockerfile . docker push IMAGE_REPO:TAG

kubectl -n NAMESPACE set image deployment/DEPLOYMENT CONTAINER=IMAGE_REPO:TAG kubectl -n NAMESPACE rollout status deployment/DEPLOYMENT --timeout=120s

Safety Checks

  • 部署前先核对目标环境:kubectl config current-context 、kubectl -n <ns> get deploy <name>

  • 生产环境变更:先向用户确认 kube-context/namespace/image/tag ,再执行

Scripts

scripts/build_push_kubectl.sh

Build 镜像、push 到仓库、然后用 kubectl set image 更新 Deployment 并等待 rollout 完成。

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

personal-productivity

No summary provided by upstream source.

Repository SourceNeeds Review
General

kubectl

No summary provided by upstream source.

Repository SourceNeeds Review
General

obsidian-dashboard

No summary provided by upstream source.

Repository SourceNeeds Review