Skip to content

Instantly share code, notes, and snippets.

@mofelee
Last active August 10, 2017 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mofelee/63ee490c5e3d268466378eb92ccce506 to your computer and use it in GitHub Desktop.
Save mofelee/63ee490c5e3d268466378eb92ccce506 to your computer and use it in GitHub Desktop.

映射scope服务到本地

kubectl port-forward -n kube-system "$(kubectl get -n kube-system pod --selector=weave-scope-component=app -o jsonpath='{.items..metadata.name}')" 4040

部署

kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080

进入Pod 中执行命令

kubectl exec -ti $POD_NAME bash

暴露服务

kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080

扩容服务

kubectl scale deployments/kubernetes-bootcamp --replicas=4

升级

kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=jocatalin/kubernetes-bootcamp:v2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment