Closed zhang-zhenqing closed 4 years ago
怎么添加worker node 和改worker node instance type?
make edit-cluster 的输出里面没有work node数量和instance type [ec2-user@ip-10-0-210-247 ~]$ make edit-cluster apiVersion: kops/v1alpha2 kind: Cluster metadata: creationTimestamp: 2019-12-12T03:31:51Z generation: 2 name: jonathanupgrade.k8s.local spec: apiVersion: kops/v1alpha2 kind: Cluster metadata: creationTimestamp: 2019-12-12T03:31:51Z generation: 2 name: jonathanupgrade.k8s.local spec: api: loadBalancer: type: Public assets: containerRegistry: 937788672844.dkr.ecr.cn-north-1.amazonaws.com.cn fileRepository: https://s3.cn-north-1.amazonaws.com.cn/kops-bjs/fileRepository/ authorization: rbac: {} channel: stable cloudProvider: aws configBase: s3://xylemkops/jonathanupgrade.k8s.local docker: logDriver: "" registryMirrors:
Makefile =============================
TARGET_REGION ?= cn-northwest-1 AWS_PROFILE ?= default KOPS_STATE_STORE ?= s3://xylemkops VPCID ?= vpc-0517599d21348b130 MASTER_COUNT ?= 1 MASTER_SIZE ?= m4.large NODE_SIZE ?= c5.large NODE_COUNT ?= 1 SSH_PUBLIC_KEY ?= ~/.ssh/id_rsa.pub KUBERNETES_VERSION ?= v1.14.6 KOPS_VERSION ?= 1.14.0
AWS_DEFAULT_REGION ?= $(TARGET_REGION) AWS_REGION ?= $(AWS_DEFAULT_REGION) ifeq ($(TARGET_REGION) ,cn-north-1) CLUSTER_NAME ?= jonathan.k8s.local AMI ?= ami-02dd4d384eb0e0b3a ZONES ?= cn-north-1a,cn-north-1b endif
ifeq ($(TARGET_REGION) ,cn-northwest-1) CLUSTER_NAME ?= jonathan.k8s.local AMI ?= ami-068b32c3754324d44 ZONES ?= cn-northwest-1a endif
ifdef CUSTOM_CLUSTER_NAME CLUSTER_NAME = $(CUSTOM_CLUSTER_NAME) endif
KUBERNETES_VERSION_URI ?= "https://s3.cn-north-1.amazonaws.com.cn/kubernetes-release/release/$(KUBERNETES_VERSION)"
.PHONY: create-cluster create-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops create cluster \ --cloud=aws \ --name=$(CLUSTER_NAME) \ --image=$(AMI) \ --zones=$(ZONES) \ --master-count=$(MASTER_COUNT) \ --master-size=$(MASTER_SIZE) \ --node-count=$(NODE_COUNT) \ --node-size=$(NODE_SIZE) \ --vpc=$(VPCID) \ --kubernetes-version=$(KUBERNETES_VERSION_URI) \ --networking=amazon-vpc-routed-eni \ --topology=private \ --ssh-public-key=$(SSH_PUBLIC_KEY)
.PHONY: edit-ig-nodes edit-ig-nodes: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops edit ig --name=$(CLUSTER_NAME) nodes
.PHONY: edit-cluster edit-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops edit cluster $(CLUSTER_NAME)
.PHONY: update-cluster update-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops update cluster $(CLUSTER_NAME) --yes
.PHONY: validate-cluster validate-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops validate cluster
.PHONY: delete-cluster delete-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops delete cluster --name $(CLUSTER_NAME) --yes
.PHONY: rolling-update-cluster rolling-update-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops rolling-update cluster --name $(CLUSTER_NAME) --yes --cloudonly
.PHONY: get-cluster get-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops get cluster --name $(CLUSTER_NAME)
should use edit-ig-nodes
怎么添加worker node 和改worker node instance type?
make edit-cluster 的输出里面没有work node数量和instance type [ec2-user@ip-10-0-210-247 ~]$ make edit-cluster apiVersion: kops/v1alpha2 kind: Cluster metadata: creationTimestamp: 2019-12-12T03:31:51Z generation: 2 name: jonathanupgrade.k8s.local spec: apiVersion: kops/v1alpha2 kind: Cluster metadata: creationTimestamp: 2019-12-12T03:31:51Z generation: 2 name: jonathanupgrade.k8s.local spec: api: loadBalancer: type: Public assets: containerRegistry: 937788672844.dkr.ecr.cn-north-1.amazonaws.com.cn fileRepository: https://s3.cn-north-1.amazonaws.com.cn/kops-bjs/fileRepository/ authorization: rbac: {} channel: stable cloudProvider: aws configBase: s3://xylemkops/jonathanupgrade.k8s.local docker: logDriver: "" registryMirrors:
Makefile =============================
customize the values below
TARGET_REGION ?= cn-northwest-1 AWS_PROFILE ?= default KOPS_STATE_STORE ?= s3://xylemkops VPCID ?= vpc-0517599d21348b130 MASTER_COUNT ?= 1 MASTER_SIZE ?= m4.large NODE_SIZE ?= c5.large NODE_COUNT ?= 1 SSH_PUBLIC_KEY ?= ~/.ssh/id_rsa.pub KUBERNETES_VERSION ?= v1.14.6 KOPS_VERSION ?= 1.14.0
AWS_DEFAULT_REGION ?= $(TARGET_REGION) AWS_REGION ?= $(AWS_DEFAULT_REGION) ifeq ($(TARGET_REGION) ,cn-north-1) CLUSTER_NAME ?= jonathan.k8s.local AMI ?= ami-02dd4d384eb0e0b3a ZONES ?= cn-north-1a,cn-north-1b endif
ifeq ($(TARGET_REGION) ,cn-northwest-1) CLUSTER_NAME ?= jonathan.k8s.local AMI ?= ami-068b32c3754324d44 ZONES ?= cn-northwest-1a endif
ifdef CUSTOM_CLUSTER_NAME CLUSTER_NAME = $(CUSTOM_CLUSTER_NAME) endif
KUBERNETES_VERSION_URI ?= "https://s3.cn-north-1.amazonaws.com.cn/kubernetes-release/release/$(KUBERNETES_VERSION)"
.PHONY: create-cluster create-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops create cluster \ --cloud=aws \ --name=$(CLUSTER_NAME) \ --image=$(AMI) \ --zones=$(ZONES) \ --master-count=$(MASTER_COUNT) \ --master-size=$(MASTER_SIZE) \ --node-count=$(NODE_COUNT) \ --node-size=$(NODE_SIZE) \ --vpc=$(VPCID) \ --kubernetes-version=$(KUBERNETES_VERSION_URI) \ --networking=amazon-vpc-routed-eni \ --topology=private \ --ssh-public-key=$(SSH_PUBLIC_KEY)
.PHONY: edit-ig-nodes edit-ig-nodes: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops edit ig --name=$(CLUSTER_NAME) nodes
.PHONY: edit-cluster edit-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops edit cluster $(CLUSTER_NAME)
.PHONY: update-cluster update-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops update cluster $(CLUSTER_NAME) --yes
.PHONY: validate-cluster validate-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops validate cluster
.PHONY: delete-cluster delete-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops delete cluster --name $(CLUSTER_NAME) --yes
.PHONY: rolling-update-cluster rolling-update-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops rolling-update cluster --name $(CLUSTER_NAME) --yes --cloudonly
.PHONY: get-cluster get-cluster: @KOPS_STATE_STORE=$(KOPS_STATE_STORE) \ AWS_PROFILE=$(AWS_PROFILE) \ AWS_REGION=$(AWS_REGION) \ AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) \ kops get cluster --name $(CLUSTER_NAME)