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"
# Generate secret and configMap for the hollow-node pods to work, prepare
# manifests of the hollow-node and heapster replication controllers from
# templates, and finally create these resources through kubectl.
# manifests of the hollow-node and heapster deployments from templates,
# and finally create these resources through kubectl.
function create-kube-hollow-node-resources {
# Create kubeconfig for Kubelet.
KUBELET_KUBECONFIG_CONTENTS="$(cat <<EOF
@ -225,7 +225,7 @@ EOF
"${KUBECTL}" create -f "${RESOURCE_DIRECTORY}/addons" --namespace="kubemark"
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.
NUM_REPLICAS=${NUM_REPLICAS:-${KUBEMARK_NUM_NODES}}
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"
"${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.
@ -318,4 +318,4 @@ echo ""
# shellcheck disable=SC2154 # Color defined in sourced script
echo -e "${color_blue}SUCCESS${color_norm}"
clean-repo
exit 0
exit 0

View File

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

View File

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

View File

@ -82,8 +82,8 @@ function delete-kubemark-image {
}
# Generate secret and configMap for the hollow-node pods to work, prepare
# manifests of the hollow-node and heapster replication controllers from
# templates, and finally create these resources through kubectl.
# manifests of the hollow-node and heapster deployments from templates,
# and finally create these resources through kubectl.
function create-kube-hollow-node-resources {
# Create kubemark namespace.
"${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"
# Create the replication controller for hollow-nodes.
# Create the deployment for hollow-nodes.
# We allow to override the NUM_REPLICAS when running Cluster Autoscaler.
NUM_REPLICAS=${NUM_REPLICAS:-${NUM_NODES}}
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"
"${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.