Merge pull request #86376 from xieyanker/kubemark_deployment

change kubemark from ReplicationController to Deployment
This commit is contained in:
Kubernetes Prow Robot 2019-12-18 21:49:56 -08:00 committed by GitHub
commit 661a08daf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 16 deletions

View File

@ -21,8 +21,8 @@ KUBEMARK_DIRECTORY="${KUBE_ROOT}/test/kubemark"
RESOURCE_DIRECTORY="${KUBEMARK_DIRECTORY}/resources" RESOURCE_DIRECTORY="${KUBEMARK_DIRECTORY}/resources"
# Generate secret and configMap for the hollow-node pods to work, prepare # Generate secret and configMap for the hollow-node pods to work, prepare
# manifests of the hollow-node and heapster replication controllers from # manifests of the hollow-node and heapster deployments from templates,
# templates, and finally create these resources through kubectl. # and finally create these resources through kubectl.
function create-kube-hollow-node-resources { function create-kube-hollow-node-resources {
# Create kubeconfig for Kubelet. # Create kubeconfig for Kubelet.
KUBELET_KUBECONFIG_CONTENTS="$(cat <<EOF KUBELET_KUBECONFIG_CONTENTS="$(cat <<EOF
@ -225,7 +225,7 @@ EOF
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/addons" --namespace="kubemark" "${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/addons" --namespace="kubemark"
set-registry-secrets set-registry-secrets
# Create the replication controller for hollow-nodes. # Create the deployment for hollow-nodes.
# We allow to override the NUM_REPLICAS when running Cluster Autoscaler. # We allow to override the NUM_REPLICAS when running Cluster Autoscaler.
NUM_REPLICAS=${NUM_REPLICAS:-${KUBEMARK_NUM_NODES}} NUM_REPLICAS=${NUM_REPLICAS:-${KUBEMARK_NUM_NODES}}
sed "s/{{numreplicas}}/${NUM_REPLICAS}/g" "${RESOURCE_DIRECTORY}/hollow-node_template.yaml" > "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed "s/{{numreplicas}}/${NUM_REPLICAS}/g" "${RESOURCE_DIRECTORY}/hollow-node_template.yaml" > "${RESOURCE_DIRECTORY}/hollow-node.yaml"
@ -250,7 +250,7 @@ EOF
sed -i'' -e "s'{{kubemark_mig_config}}'${KUBEMARK_MIG_CONFIG:-}'g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s'{{kubemark_mig_config}}'${KUBEMARK_MIG_CONFIG:-}'g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/hollow-node.yaml" --namespace="kubemark" "${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/hollow-node.yaml" --namespace="kubemark"
echo "Created secrets, configMaps, replication-controllers required for hollow-nodes." echo "Created secrets, configMaps, deployments required for hollow-nodes."
} }
# Wait until all hollow-nodes are running or there is a timeout. # Wait until all hollow-nodes are running or there is a timeout.
@ -318,4 +318,4 @@ echo ""
# shellcheck disable=SC2154 # Color defined in sourced script # shellcheck disable=SC2154 # Color defined in sourced script
echo -e "${color_blue}SUCCESS${color_norm}" echo -e "${color_blue}SUCCESS${color_norm}"
clean-repo clean-repo
exit 0 exit 0

View File

@ -1,6 +1,6 @@
{ {
"kind": "ReplicationController", "kind": "Deployment",
"apiVersion": "v1", "apiVersion": "apps/v1",
"metadata": { "metadata": {
"name": "heapster-v1.3.0", "name": "heapster-v1.3.0",
"labels": { "labels": {
@ -11,8 +11,9 @@
"spec": { "spec": {
"replicas": 1, "replicas": 1,
"selector": { "selector": {
"k8s-app": "heapster", "matchLabels":
"version": "v1.3.0" "k8s-app": "heapster",
"version": "v1.3.0"
}, },
"template": { "template": {
"metadata": { "metadata": {

View File

@ -1,5 +1,5 @@
apiVersion: v1 apiVersion: apps/v1
kind: ReplicationController kind: Deployment
metadata: metadata:
name: hollow-node name: hollow-node
labels: labels:
@ -8,7 +8,8 @@ metadata:
spec: spec:
replicas: {{numreplicas}} replicas: {{numreplicas}}
selector: selector:
name: hollow-node matchLabels:
name: hollow-node
template: template:
metadata: metadata:
labels: labels:

View File

@ -82,8 +82,8 @@ function delete-kubemark-image {
} }
# Generate secret and configMap for the hollow-node pods to work, prepare # Generate secret and configMap for the hollow-node pods to work, prepare
# manifests of the hollow-node and heapster replication controllers from # manifests of the hollow-node and heapster deployments from templates,
# templates, and finally create these resources through kubectl. # and finally create these resources through kubectl.
function create-kube-hollow-node-resources { function create-kube-hollow-node-resources {
# Create kubemark namespace. # Create kubemark namespace.
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/kubemark-ns.json" "${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/kubemark-ns.json"
@ -142,7 +142,7 @@ function create-kube-hollow-node-resources {
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/addons" --namespace="kubemark" "${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/addons" --namespace="kubemark"
# Create the replication controller for hollow-nodes. # Create the deployment for hollow-nodes.
# We allow to override the NUM_REPLICAS when running Cluster Autoscaler. # We allow to override the NUM_REPLICAS when running Cluster Autoscaler.
NUM_REPLICAS=${NUM_REPLICAS:-${NUM_NODES}} NUM_REPLICAS=${NUM_REPLICAS:-${NUM_NODES}}
sed "s@{{numreplicas}}@${NUM_REPLICAS}@g" "${RESOURCE_DIRECTORY}/hollow-node_template.yaml" > "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed "s@{{numreplicas}}@${NUM_REPLICAS}@g" "${RESOURCE_DIRECTORY}/hollow-node_template.yaml" > "${RESOURCE_DIRECTORY}/hollow-node.yaml"
@ -174,7 +174,7 @@ function create-kube-hollow-node-resources {
sed -i'' -e "s@{{kubemark_mig_config}}@${KUBEMARK_MIG_CONFIG:-}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml" sed -i'' -e "s@{{kubemark_mig_config}}@${KUBEMARK_MIG_CONFIG:-}@g" "${RESOURCE_DIRECTORY}/hollow-node.yaml"
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/hollow-node.yaml" --namespace="kubemark" "${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/hollow-node.yaml" --namespace="kubemark"
echo "Created secrets, configMaps, replication-controllers required for hollow-nodes." echo "Created secrets, configMaps, deployments required for hollow-nodes."
} }
# Wait until all hollow-nodes are running or there is a timeout. # Wait until all hollow-nodes are running or there is a timeout.