内容目录
cat <<EOF | kubectl apply -f -
apiVersion: game.kruise.io/v1alpha1
kind: GameServerSet
metadata:
name: chelunzhan
namespace: default
spec:
replicas: 1
network:
networkType: Kubernetes-HostPort
networkConf:
- name: ContainerPorts
value: chenlunzhan:20400/tcp
updateStrategy:
rollingUpdate:
podUpdatePolicy: InPlaceIfPossible
gameServerTemplate:
spec:
containers:
- image: 镜像仓库地址/chelunzhan:0.1_8
name: chelunzhan
env:
- name: SERVER_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
EOF
自定义名称递增变量 SERVER_ID 方便容器根据ID变量初始化数据库 节点编号什么的
控制副本数量
0 全部删除 2 部署两个
kubectl scale gss chelunzhan --replicas=0
删除部署集合
kubectl delete gss chelunzhan
近期评论