mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #28467 from gmarek/addon-manager
Automatic merge from submit-queue Fix the way addon-manager handles non-namespaced objects Fixes #28451 cc @wojtek-t
This commit is contained in:
commit
9fb45943b5
@ -15,7 +15,7 @@
|
|||||||
IMAGE=gcr.io/google-containers/kube-addon-manager
|
IMAGE=gcr.io/google-containers/kube-addon-manager
|
||||||
ARCH?=amd64
|
ARCH?=amd64
|
||||||
TEMP_DIR:=$(shell mktemp -d)
|
TEMP_DIR:=$(shell mktemp -d)
|
||||||
VERSION=v5
|
VERSION=v5.1
|
||||||
|
|
||||||
# amd64 and arm has "stable" binaries pushed for v1.2, arm64 and ppc64le hasn't so they have to fetch the latest alpha
|
# amd64 and arm has "stable" binaries pushed for v1.2, arm64 and ppc64le hasn't so they have to fetch the latest alpha
|
||||||
# however, arm64 and ppc64le are very experimental right now, so it's okay
|
# however, arm64 and ppc64le are very experimental right now, so it's okay
|
||||||
|
@ -41,8 +41,6 @@
|
|||||||
# 3. kubectl prints the output to stderr (the output should be captured and then
|
# 3. kubectl prints the output to stderr (the output should be captured and then
|
||||||
# logged)
|
# logged)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# global config
|
# global config
|
||||||
KUBECTL=${TEST_KUBECTL:-} # substitute for tests
|
KUBECTL=${TEST_KUBECTL:-} # substitute for tests
|
||||||
KUBECTL=${KUBECTL:-${KUBECTL_BIN:-}}
|
KUBECTL=${KUBECTL:-${KUBECTL_BIN:-}}
|
||||||
@ -133,7 +131,7 @@ try:
|
|||||||
try:
|
try:
|
||||||
print "%s/%s" % (y["metadata"]["namespace"], y["metadata"]["name"])
|
print "%s/%s" % (y["metadata"]["namespace"], y["metadata"]["name"])
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
print "default/%s" % y["metadata"]["name"]
|
print "/%s" % y["metadata"]["name"]
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
print "ERROR"
|
print "ERROR"
|
||||||
'''
|
'''
|
||||||
@ -198,7 +196,7 @@ function run-until-success() {
|
|||||||
# returns a list of <namespace>/<name> pairs (nsnames)
|
# returns a list of <namespace>/<name> pairs (nsnames)
|
||||||
function get-addon-nsnames-from-server() {
|
function get-addon-nsnames-from-server() {
|
||||||
local -r obj_type=$1
|
local -r obj_type=$1
|
||||||
"${KUBECTL}" get "${obj_type}" --all-namespaces -o go-template="{{range.items}}{{.metadata.namespace}}/{{.metadata.name}} {{end}}" -l kubernetes.io/cluster-service=true
|
"${KUBECTL}" get "${obj_type}" --all-namespaces -o go-template="{{range.items}}{{.metadata.namespace}}/{{.metadata.name}} {{end}}" -l kubernetes.io/cluster-service=true | sed 's/<no value>//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
# returns the characters after the last separator (including)
|
# returns the characters after the last separator (including)
|
||||||
@ -262,7 +260,11 @@ function create-object() {
|
|||||||
log INFO "Creating new ${obj_type} from file ${file_path} in namespace ${namespace}, name: ${obj_name}"
|
log INFO "Creating new ${obj_type} from file ${file_path} in namespace ${namespace}, name: ${obj_name}"
|
||||||
# this will keep on failing if the ${file_path} disappeared in the meantime.
|
# this will keep on failing if the ${file_path} disappeared in the meantime.
|
||||||
# Do not use too many retries.
|
# Do not use too many retries.
|
||||||
|
if [[ -n "${namespace}" ]]; then
|
||||||
run-until-success "${KUBECTL} create --namespace=${namespace} -f ${file_path}" ${NUM_TRIES} ${DELAY_AFTER_ERROR_SEC}
|
run-until-success "${KUBECTL} create --namespace=${namespace} -f ${file_path}" ${NUM_TRIES} ${DELAY_AFTER_ERROR_SEC}
|
||||||
|
else
|
||||||
|
run-until-success "${KUBECTL} create -f ${file_path}" ${NUM_TRIES} ${DELAY_AFTER_ERROR_SEC}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function update-object() {
|
function update-object() {
|
||||||
|
@ -5,7 +5,6 @@ kind: PersistentVolume
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: influxdb-pv
|
name: influxdb-pv
|
||||||
namespace: kube-system
|
|
||||||
labels:
|
labels:
|
||||||
kubernetes.io/cluster-service: "true"
|
kubernetes.io/cluster-service: "true"
|
||||||
spec:
|
spec:
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"name": "kube-addon-manager",
|
"name": "kube-addon-manager",
|
||||||
"image": "gcr.io/google-containers/kube-addon-manager-ARCH:v4",
|
"image": "gcr.io/google-containers/kube-addon-manager-ARCH:v5.1",
|
||||||
"resources": {
|
"resources": {
|
||||||
"requests": {
|
"requests": {
|
||||||
"cpu": "5m",
|
"cpu": "5m",
|
||||||
|
@ -10,7 +10,8 @@ spec:
|
|||||||
hostNetwork: true
|
hostNetwork: true
|
||||||
containers:
|
containers:
|
||||||
- name: kube-addon-manager
|
- name: kube-addon-manager
|
||||||
image: gcr.io/google-containers/kube-addon-manager:v5
|
# When updating version also bump it in cluster/images/hyperkube/static-pods/addon-manager.json
|
||||||
|
image: gcr.io/google-containers/kube-addon-manager:v5.1
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 5m
|
cpu: 5m
|
||||||
|
Loading…
Reference in New Issue
Block a user