Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3321f00
Release commit for Kubernetes v1.20.0-rc.0
Dec 1, 2020
7d6ffe0
Add AcceleratorStats to cri_stats_provider
ruiwen-zhao Nov 25, 2020
d1e54b9
APF e2e: disable drown-out tests temporarily
Dec 4, 2020
af46c47
Merge pull request #97075 from adtac/apfe2e-5
k8s-ci-robot Dec 4, 2020
f674d4e
fix migration logic
rajansandeep Dec 1, 2020
49eb3a8
Revert "iAdd host IP to etcd listen client URLs."
liggitt Dec 8, 2020
2e6a0a0
Update CHANGELOG/CHANGELOG-1.20.md for v1.20.0
Dec 8, 2020
416165a
vendor: update cAdvisor to v0.38.6
hanlins Dec 9, 2020
27131c7
Merge pull request #97018 from ruiwen-zhao/release-1.20-metric-fix
k8s-ci-robot Dec 10, 2020
34077ee
Fix FibreChannel volume plugin corrupting filesystem on detach
jsafrane Dec 2, 2020
0c1a538
Flush FibreChannel devices before deleting
jsafrane Dec 3, 2020
b122452
Merge pull request #97128 from liggitt/automated-cherry-pick-of-#9712…
k8s-ci-robot Dec 12, 2020
8a224b5
etcd version for 1.19 is 3.4.13 for cve fixes
pacoxu Dec 11, 2020
75bdfd3
Merge pull request #97175 from hanlins/fix/1.20/cadvisor-95727
k8s-ci-robot Dec 14, 2020
79def50
Merge pull request #97284 from pacoxu/fix/etcd-version-1
k8s-ci-robot Dec 14, 2020
787e3a6
Add more logging for Mount error
saad-ali Dec 12, 2020
6666afa
Revert "Use host IP instead of localhost for control plane component …
benhxy Dec 11, 2020
2e6adaa
Merge pull request #97197 from jsafrane/automated-cherry-pick-of-#970…
k8s-ci-robot Dec 15, 2020
f499562
Merge pull request #97301 from benhxy/automated-cherry-pick-of-#97253…
k8s-ci-robot Dec 17, 2020
6af63cd
Merge pull request #97106 from neolit123/automated-cherry-pick-of-#97…
k8s-ci-robot Dec 17, 2020
c4d7527
Release commit for Kubernetes v1.20.1
Dec 18, 2020
764cafc
Release commit for Kubernetes v1.20.2-rc.0
Dec 18, 2020
0c0d4fe
Update CHANGELOG/CHANGELOG-1.20.md for v1.20.1
Dec 18, 2020
98dffa7
fix: azure file latency issue for metadata-heavy workload
andyzhangx Dec 5, 2020
a79db17
fix azure file secret not found issue
andyzhangx Dec 21, 2020
0f764ea
clean up executing request on panic
tkashem Dec 10, 2020
d8ba4e4
Fix bug in CPUManager with race on map acccess
klueska Dec 21, 2020
16559f7
Cherry pick 443 and 448 from cloud provider azure
nilo19 Dec 31, 2020
a1ac5f4
fix the deadlock in priority and fairness config controller
tkashem Dec 15, 2020
3c67a0a
Create OWNERS for most of the API Priority and Fairness impl
MikeSpreitzer Dec 11, 2020
4d8ac66
Fix cadvisor machine metrics
erikwilson Sep 30, 2020
65a0dbe
Merge pull request #97297 from saad-ali/automated-cherry-pick-of-#972…
k8s-ci-robot Jan 5, 2021
37e3fea
Ensure reproducible builds when build through docker
dims Jan 5, 2021
6cc8980
Merge pull request #97691 from ehashman/automated-cherry-pick-of-#970…
k8s-ci-robot Jan 5, 2021
d9d57a2
Merge pull request #97671 from MikeSpreitzer/automated-cherry-pick-of…
k8s-ci-robot Jan 5, 2021
ab8ca72
Merge pull request #97529 from klueska/automated-cherry-pick-of-#9742…
k8s-ci-robot Jan 5, 2021
d3467a5
Merge pull request #97732 from dims/automated-cherry-pick-of-#97699-u…
k8s-ci-robot Jan 5, 2021
aedab82
Merge pull request #97449 from andyzhangx/automated-cherry-pick-of-#9…
k8s-ci-robot Jan 6, 2021
0785b92
Merge pull request #97464 from tkashem/automated-cherry-pick-of-#9732…
k8s-ci-robot Jan 6, 2021
19a48fe
Merge pull request #97639 from nilo19/bug/cherry-pick-443-448-1.20
k8s-ci-robot Jan 6, 2021
fc2b746
Merge pull request #97439 from andyzhangx/automated-cherry-pick-of-#9…
k8s-ci-robot Jan 6, 2021
287ca88
Release reserved GCE IP address after ensure completes.
prameshj Jan 5, 2021
2d0ffc1
cherry-pick part of #97451: fix nodeport quota check failure during c…
pacoxu Jan 8, 2021
3b0dac9
Merge pull request #97770 from prameshj/automated-cherry-pick-of-#977…
k8s-ci-robot Jan 8, 2021
c3e150f
use default unkown sock for kubeadm cmd if cri detect is not needed
pacoxu Dec 31, 2020
c4a3ce0
Merge pull request #97847 from pacoxu/automated-cherry-pick-of-#97625…
k8s-ci-robot Jan 8, 2021
bde7218
Merge pull request #97826 from pacoxu/cherry-pick/nodeport-quota
k8s-ci-robot Jan 8, 2021
d8a1dfb
move all variables in sampleAndWaterMarkHistograms::innerSet
MikeSpreitzer Jan 8, 2021
a5351e9
Merge pull request #97866 from MikeSpreitzer/automated-cherry-pick-of…
k8s-ci-robot Jan 8, 2021
6a61eae
Merge pull request #97463 from tkashem/automated-cherry-pick-of-#9720…
k8s-ci-robot Jan 9, 2021
faecb19
Release commit for Kubernetes v1.20.2
Jan 13, 2021
d88e1de
initialdelaymilliseconds
MHBauer Oct 5, 2020
70bfb10
ProbeMilliseconds Implementation
MHBauer Oct 6, 2020
96b9c22
reorder for protos?
MHBauer Jan 6, 2021
883d44f
use milliseconds as for defaultProbe in unit tests
MHBauer Feb 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,134 changes: 0 additions & 3,134 deletions CHANGELOG/CHANGELOG-1.10.md

This file was deleted.

2,576 changes: 0 additions & 2,576 deletions CHANGELOG/CHANGELOG-1.11.md

This file was deleted.

2,342 changes: 0 additions & 2,342 deletions CHANGELOG/CHANGELOG-1.12.md

This file was deleted.

2,224 changes: 0 additions & 2,224 deletions CHANGELOG/CHANGELOG-1.13.md

This file was deleted.

2,225 changes: 0 additions & 2,225 deletions CHANGELOG/CHANGELOG-1.14.md

This file was deleted.

2,224 changes: 0 additions & 2,224 deletions CHANGELOG/CHANGELOG-1.15.md

This file was deleted.

3,029 changes: 0 additions & 3,029 deletions CHANGELOG/CHANGELOG-1.16.md

This file was deleted.

2,900 changes: 0 additions & 2,900 deletions CHANGELOG/CHANGELOG-1.17.md

This file was deleted.

2,640 changes: 0 additions & 2,640 deletions CHANGELOG/CHANGELOG-1.18.md

This file was deleted.

3,237 changes: 0 additions & 3,237 deletions CHANGELOG/CHANGELOG-1.19.md

This file was deleted.

581 changes: 0 additions & 581 deletions CHANGELOG/CHANGELOG-1.2.md

This file was deleted.

1,311 changes: 1,186 additions & 125 deletions CHANGELOG/CHANGELOG-1.20.md

Large diffs are not rendered by default.

970 changes: 0 additions & 970 deletions CHANGELOG/CHANGELOG-1.3.md

This file was deleted.

1,434 changes: 0 additions & 1,434 deletions CHANGELOG/CHANGELOG-1.4.md

This file was deleted.

1,325 changes: 0 additions & 1,325 deletions CHANGELOG/CHANGELOG-1.5.md

This file was deleted.

2,883 changes: 0 additions & 2,883 deletions CHANGELOG/CHANGELOG-1.6.md

This file was deleted.

3,292 changes: 0 additions & 3,292 deletions CHANGELOG/CHANGELOG-1.7.md

This file was deleted.

3,089 changes: 0 additions & 3,089 deletions CHANGELOG/CHANGELOG-1.8.md

This file was deleted.

2,647 changes: 0 additions & 2,647 deletions CHANGELOG/CHANGELOG-1.9.md

This file was deleted.

8 changes: 7 additions & 1 deletion build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,17 @@ function kube::build::run_build_command_ex() {
--env "KUBE_BUILD_WITH_COVERAGE=${KUBE_BUILD_WITH_COVERAGE:-}"
--env "KUBE_BUILD_PLATFORMS=${KUBE_BUILD_PLATFORMS:-}"
--env "GOFLAGS=${GOFLAGS:-}"
--env "GOLDFLAGS=${GOLDFLAGS:-}"
--env "GOGCFLAGS=${GOGCFLAGS:-}"
--env "SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-}"
)

# use GOLDFLAGS only if it is set explicitly.
if [[ -v GOLDFLAGS ]]; then
docker_run_opts+=(
--env "GOLDFLAGS=${GOLDFLAGS:-}"
)
fi

if [[ -n "${DOCKER_CGROUP_PARENT:-}" ]]; then
kube::log::status "Using ${DOCKER_CGROUP_PARENT} as container cgroup parent"
docker_run_opts+=(--cgroup-parent "${DOCKER_CGROUP_PARENT}")
Expand Down
8 changes: 0 additions & 8 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,5 @@ export ENABLE_CSI_PROXY="${ENABLE_CSI_PROXY:-true}"
# kube-apiserver is healthchecked on host IP instead of 127.0.0.1.
export KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP="${KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP:-false}"

# ETCD_LISTEN_ON_HOST_IP decides whether etcd servers should also listen on host IP,
# in addition to listening to 127.0.0.1, and whether kube-apiserver should connect to etcd servers
# through host IP.
export ETCD_LISTEN_ON_HOST_IP="${ETCD_LISTEN_ON_HOST_IP:-false}"

# ETCD_PROGRESS_NOTIFY_INTERVAL defines the interval for etcd watch progress notify events.
export ETCD_PROGRESS_NOTIFY_INTERVAL="${ETCD_PROGRESS_NOTIFY_INTERVAL:-10m}"

# Use host IP instead of localhost in control plane kubeconfig files.
export KUBECONFIG_USE_HOST_IP="${KUBECONFIG_USE_HOST_IP:-false}"
8 changes: 0 additions & 8 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -587,13 +587,5 @@ export ENABLE_CSI_PROXY="${ENABLE_CSI_PROXY:-true}"
# kube-apiserver is healthchecked on host IP instead of 127.0.0.1.
export KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP="${KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP:-false}"

# ETCD_LISTEN_ON_HOST_IP decides whether etcd servers should also listen on host IP,
# in addition to listening to 127.0.0.1, and whether kube-apiserver should connect to etcd servers
# through host IP.
export ETCD_LISTEN_ON_HOST_IP="${ETCD_LISTEN_ON_HOST_IP:-false}"

# ETCD_PROGRESS_NOTIFY_INTERVAL defines the interval for etcd watch progress notify events.
export ETCD_PROGRESS_NOTIFY_INTERVAL="${ETCD_PROGRESS_NOTIFY_INTERVAL:-10m}"

# Use host IP instead of localhost in control plane kubeconfig files.
export KUBECONFIG_USE_HOST_IP="${KUBECONFIG_USE_HOST_IP:-false}"
15 changes: 1 addition & 14 deletions cluster/gce/gci/apiserver_etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ type kubeAPIServeETCDEnv struct {
StorageBackend string
StorageMediaType string
CompactionInterval string
HostPrimaryIP string
ETCDListenOnHostIP string
}

func TestServerOverride(t *testing.T) {
Expand All @@ -54,7 +52,7 @@ func TestServerOverride(t *testing.T) {
},
},
{
desc: "ETCD-SERVERS and ETCD_SERVERS_OVERRIDES are set",
desc: "ETCD-SERVERS and ETCD_SERVERS_OVERRIDES iare set",
env: kubeAPIServeETCDEnv{
ETCDServers: "ETCDServers",
ETCDServersOverride: "ETCDServersOverrides",
Expand All @@ -63,17 +61,6 @@ func TestServerOverride(t *testing.T) {
"--etcd-servers-overrides=ETCDServersOverrides",
},
},
{
desc: "HOST_PRIMARY_IP is set and etcd is set to listen to host IP",
env: kubeAPIServeETCDEnv{
HostPrimaryIP: "HostPrimaryIP",
ETCDListenOnHostIP: "true",
},
want: []string{
"--etcd-servers-overrides=/events#http://HostPrimaryIP:4002",
"--etcd-servers=http://HostPrimaryIP:2379",
},
},
}

for _, tc := range testCases {
Expand Down
38 changes: 5 additions & 33 deletions cluster/gce/gci/configure-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1265,18 +1265,11 @@ EOF
fi
}

# Create kubeconfig files for control plane components.
function create-kubeconfig {
local component=$1
local token=$2
echo "Creating kubeconfig file for component ${component}"
mkdir -p "/etc/srv/kubernetes/${component}"

local kube_apiserver="localhost"
if [[ ${KUBECONFIG_USE_HOST_IP:-} == "true" ]] ; then
kube_apiserver=$(hostname -i)
fi

cat <<EOF >"/etc/srv/kubernetes/${component}/kubeconfig"
apiVersion: v1
kind: Config
Expand All @@ -1288,7 +1281,7 @@ clusters:
- name: local
cluster:
insecure-skip-tls-verify: true
server: https://${kube_apiserver}:443
server: https://localhost:443
contexts:
- context:
cluster: local
Expand Down Expand Up @@ -1702,8 +1695,8 @@ function start-kube-proxy {
# Replaces the variables in the etcd manifest file with the real values, and then
# copy the file to the manifest dir
# $1: value for variable 'suffix'
# $2: value for variable 'port', for listening to clients
# $3: value for variable 'server_port', for etcd peering
# $2: value for variable 'port'
# $3: value for variable 'server_port'
# $4: value for variable 'cpulimit'
# $5: pod name, which should be either etcd or etcd-events
function prepare-etcd-manifest {
Expand All @@ -1722,43 +1715,23 @@ function prepare-etcd-manifest {
if [[ -n "${INITIAL_ETCD_CLUSTER_STATE:-}" ]]; then
cluster_state="${INITIAL_ETCD_CLUSTER_STATE}"
fi

# Configure mTLS for etcd peers.
if [[ -n "${ETCD_CA_CERT:-}" && -n "${ETCD_PEER_KEY:-}" && -n "${ETCD_PEER_CERT:-}" ]]; then
etcd_creds=" --peer-trusted-ca-file /etc/srv/kubernetes/etcd-ca.crt --peer-cert-file /etc/srv/kubernetes/etcd-peer.crt --peer-key-file /etc/srv/kubernetes/etcd-peer.key -peer-client-cert-auth "
etcd_protocol="https"
fi

# host_primary_ip is the primary internal IP of the host.
# Override host primary IP if specifically provided.
local host_primary_ip
host_primary_ip="${HOST_PRIMARY_IP:-$(hostname -i)}"

# Configure mTLS for clients (e.g. kube-apiserver).
# mTLS should only be enabled for etcd server but not etcd-events. If $1 suffix is empty, it's etcd server.
local etcd_listen_metrics_urls=""
# mTLS should only be enabled for etcd server but not etcd-events. if $1 suffix is empty, it's etcd server.
if [[ -z "${suffix}" && -n "${ETCD_APISERVER_CA_KEY:-}" && -n "${ETCD_APISERVER_CA_CERT:-}" && -n "${ETCD_APISERVER_SERVER_KEY:-}" && -n "${ETCD_APISERVER_SERVER_CERT:-}" && -n "${ETCD_APISERVER_CLIENT_KEY:-}" && -n "${ETCD_APISERVER_CLIENT_CERT:-}" ]]; then
etcd_apiserver_creds=" --client-cert-auth --trusted-ca-file ${ETCD_APISERVER_CA_CERT_PATH} --cert-file ${ETCD_APISERVER_SERVER_CERT_PATH} --key-file ${ETCD_APISERVER_SERVER_KEY_PATH} "
etcd_apiserver_protocol="https"
etcd_livenessprobe_port="2382"
etcd_listen_metrics_urls="http://${ETCD_LISTEN_CLIENT_IP:-127.0.0.1}:${etcd_livenessprobe_port}"
if [[ ${ETCD_LISTEN_ON_HOST_IP:-} == "true" ]]; then
etcd_listen_metrics_urls+=",http://${host_primary_ip}:${etcd_livenessprobe_port}"
fi
etcd_extra_args+=" --listen-metrics-urls=${etcd_listen_metrics_urls} "
etcd_extra_args+=" --listen-metrics-urls=http://${ETCD_LISTEN_CLIENT_IP:-127.0.0.1}:${etcd_livenessprobe_port} "
fi

if [[ -n "${ETCD_PROGRESS_NOTIFY_INTERVAL:-}" ]]; then
etcd_extra_args+=" --experimental-watch-progress-notify-interval=${ETCD_PROGRESS_NOTIFY_INTERVAL}"
fi

# If etcd is configured to listen on host IP, an additional client listening URL is added.
local etcd_listen_client_urls="${etcd_apiserver_protocol}://${ETCD_LISTEN_CLIENT_IP:-127.0.0.1}:$2"
if [[ ${ETCD_LISTEN_ON_HOST_IP:-} == "true" ]] ; then
etcd_listen_client_urls+=",${etcd_apiserver_protocol}://${host_primary_ip}:$2"
fi

# Generate etcd member URLs.
for host in $(echo "${INITIAL_ETCD_CLUSTER:-${host_name}}" | tr "," "\n"); do
etcd_host="etcd-${host}=${etcd_protocol}://${host}:$3"
if [[ -n "${etcd_cluster}" ]]; then
Expand All @@ -1778,7 +1751,6 @@ function prepare-etcd-manifest {
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${temp_file}"
sed -i -e "s@{{ *liveness_probe_initial_delay *}}@${ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC:-15}@g" "${temp_file}"
sed -i -e "s@{{ *listen_client_ip *}}@${ETCD_LISTEN_CLIENT_IP:-127.0.0.1}@g" "${temp_file}"
sed -i -e "s@{{ *etcd_listen_client_urls *}}@${etcd_listen_client_urls:-}@g" "${temp_file}"
# Get default storage backend from manifest file.
local -r default_storage_backend=$( \
grep -o "{{ *pillar\.get('storage_backend', '\(.*\)') *}}" "${temp_file}" | \
Expand Down
17 changes: 4 additions & 13 deletions cluster/gce/gci/configure-kubeapiserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,25 @@
# limitations under the License.


# Configures etcd related parameters of kube-apiserver.
# Configures etcd related flags of kube-apiserver.
function configure-etcd-params {
local -n params_ref=$1

local host_ip="127.0.0.1"
# If etcd is configured to listen on host IP,
# host_ip is set to the primary internal IP of host VM.
if [[ ${ETCD_LISTEN_ON_HOST_IP:-} == "true" ]] ; then
host_ip="${HOST_PRIMARY_IP:-$(hostname -i)}"
fi

# Configure the main etcd.
if [[ -n "${ETCD_APISERVER_CA_KEY:-}" && -n "${ETCD_APISERVER_CA_CERT:-}" && -n "${ETCD_APISERVER_SERVER_KEY:-}" && -n "${ETCD_APISERVER_SERVER_CERT:-}" && -n "${ETCD_APISERVER_CLIENT_KEY:-}" && -n "${ETCD_APISERVER_CLIENT_CERT:-}" ]]; then
params_ref+=" --etcd-servers=${ETCD_SERVERS:-https://${host_ip}:2379}"
params_ref+=" --etcd-servers=${ETCD_SERVERS:-https://127.0.0.1:2379}"
params_ref+=" --etcd-cafile=${ETCD_APISERVER_CA_CERT_PATH}"
params_ref+=" --etcd-certfile=${ETCD_APISERVER_CLIENT_CERT_PATH}"
params_ref+=" --etcd-keyfile=${ETCD_APISERVER_CLIENT_KEY_PATH}"
elif [[ -z "${ETCD_APISERVER_CA_KEY:-}" && -z "${ETCD_APISERVER_CA_CERT:-}" && -z "${ETCD_APISERVER_SERVER_KEY:-}" && -z "${ETCD_APISERVER_SERVER_CERT:-}" && -z "${ETCD_APISERVER_CLIENT_KEY:-}" && -z "${ETCD_APISERVER_CLIENT_CERT:-}" ]]; then
params_ref+=" --etcd-servers=${ETCD_SERVERS:-http://${host_ip}:2379}"
params_ref+=" --etcd-servers=${ETCD_SERVERS:-http://127.0.0.1:2379}"
echo "WARNING: ALL of ETCD_APISERVER_CA_KEY, ETCD_APISERVER_CA_CERT, ETCD_APISERVER_SERVER_KEY, ETCD_APISERVER_SERVER_CERT, ETCD_APISERVER_CLIENT_KEY and ETCD_APISERVER_CLIENT_CERT are missing, mTLS between etcd server and kube-apiserver is not enabled."
else
echo "ERROR: Some of ETCD_APISERVER_CA_KEY, ETCD_APISERVER_CA_CERT, ETCD_APISERVER_SERVER_KEY, ETCD_APISERVER_SERVER_CERT, ETCD_APISERVER_CLIENT_KEY and ETCD_APISERVER_CLIENT_CERT are missing, mTLS between etcd server and kube-apiserver cannot be enabled. Please provide all mTLS credential."
exit 1
fi

# Configure the event log etcd.
if [[ -z "${ETCD_SERVERS:-}" ]]; then
params_ref+=" --etcd-servers-overrides=${ETCD_SERVERS_OVERRIDES:-/events#http://${host_ip}:4002}"
params_ref+=" --etcd-servers-overrides=${ETCD_SERVERS_OVERRIDES:-/events#http://127.0.0.1:4002}"
elif [[ -n "${ETCD_SERVERS_OVERRIDES:-}" ]]; then
params_ref+=" --etcd-servers-overrides=${ETCD_SERVERS_OVERRIDES:-}"
fi
Expand Down
2 changes: 0 additions & 2 deletions cluster/gce/gci/testdata/kube-apiserver/etcd.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ readonly ETCD_SERVERS_OVERRIDES={{.ETCDServersOverride}}
readonly STORAGE_BACKEND={{.StorageBackend}}
readonly STORAGE_MEDIA_TYPE={{.StorageMediaType}}
readonly ETCD_COMPACTION_INTERVAL_SEC={{.CompactionInterval}}
readonly HOST_PRIMARY_IP={{.HostPrimaryIP}}
readonly ETCD_LISTEN_ON_HOST_IP={{.ETCDListenOnHostIP}}
7 changes: 2 additions & 5 deletions cluster/gce/manifests/etcd.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"command": [
"/bin/sh",
"-c",
"set -o errexit; if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh 1>>/var/log/etcd{{ suffix }}.log 2>&1; fi; exec /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls {{ etcd_protocol }}://{{ host_ip }}:{{ server_port }} --initial-advertise-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --advertise-client-urls {{ etcd_apiserver_protocol }}://127.0.0.1:{{ port }} --listen-client-urls {{ etcd_listen_client_urls }} {{ quota_bytes }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} {{ etcd_creds }} {{ etcd_apiserver_creds }} {{ etcd_extra_args }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
"set -o errexit; if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh 1>>/var/log/etcd{{ suffix }}.log 2>&1; fi; exec /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls {{ etcd_protocol }}://{{ host_ip }}:{{ server_port }} --initial-advertise-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --advertise-client-urls {{ etcd_apiserver_protocol }}://127.0.0.1:{{ port }} --listen-client-urls {{ etcd_apiserver_protocol }}://{{ listen_client_ip }}:{{ port }} {{ quota_bytes }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} {{ etcd_creds }} {{ etcd_apiserver_creds }} {{ etcd_extra_args }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
],
"env": [
{ "name": "TARGET_STORAGE",
Expand Down Expand Up @@ -58,11 +58,8 @@
},
{ "name": "ETCD_HOSTNAME",
"value": "{{ hostname }}"
},
{ "name": "LISTEN_CLIENT_URLS",
"value": "{{ etcd_listen_client_urls }}"
}
],
],
"livenessProbe": {
"httpGet": {
"host": "127.0.0.1",
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubeadm/app/cmd/alpha/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (o *genCSRConfig) addFlagSet(flagSet *pflag.FlagSet) {
func (o *genCSRConfig) load() (err error) {
o.kubeadmConfig, err = configutil.LoadOrDefaultInitConfiguration(
o.kubeadmConfigPath,
&kubeadmapiv1beta2.InitConfiguration{},
cmdutil.DefaultInitConfiguration(),
&kubeadmapiv1beta2.ClusterConfiguration{},
)
if err != nil {
Expand Down Expand Up @@ -358,7 +358,7 @@ func getInternalCfg(cfgPath string, kubeconfigPath string, cfg kubeadmapiv1beta2
}

// Otherwise read config from --config if provided, otherwise use default configuration
return configutil.LoadOrDefaultInitConfiguration(cfgPath, &kubeadmapiv1beta2.InitConfiguration{}, &cfg)
return configutil.LoadOrDefaultInitConfiguration(cfgPath, cmdutil.DefaultInitConfiguration(), &cfg)
}

// newCmdCertsExpiration creates a new `cert check-expiration` command.
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/cmd/alpha/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func newCmdKubeConfigUtility(out io.Writer) *cobra.Command {
// newCmdUserKubeConfig returns sub commands for kubeconfig phase
func newCmdUserKubeConfig(out io.Writer) *cobra.Command {

initCfg := &kubeadmapiv1beta2.InitConfiguration{}
initCfg := cmdutil.DefaultInitConfiguration()
clusterCfg := &kubeadmapiv1beta2.ClusterConfiguration{}

var (
Expand Down
9 changes: 1 addition & 8 deletions cmd/kubeadm/app/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,7 @@ func newCmdConfigImagesList(out io.Writer, mockK8sVersion *string) *cobra.Comman

// NewImagesList returns the underlying struct for the "kubeadm config images list" command
func NewImagesList(cfgPath string, cfg *kubeadmapiv1beta2.ClusterConfiguration) (*ImagesList, error) {
// Avoid running the CRI auto-detection code as we don't need it
versionedInitCfg := &kubeadmapiv1beta2.InitConfiguration{
NodeRegistration: kubeadmapiv1beta2.NodeRegistrationOptions{
CRISocket: constants.DefaultDockerCRISocket,
},
}

initcfg, err := configutil.LoadOrDefaultInitConfiguration(cfgPath, versionedInitCfg, cfg)
initcfg, err := configutil.LoadOrDefaultInitConfiguration(cfgPath, cmdutil.DefaultInitConfiguration(), cfg)
if err != nil {
return nil, errors.Wrap(err, "could not convert cfg to an internal cfg")
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/kubeadm/app/cmd/phases/init/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ func getCertPhaseFlags(name string) []string {

func getSANDescription(certSpec *certsphase.KubeadmCert) string {
//Defaulted config we will use to get SAN certs
defaultConfig := &kubeadmapiv1beta2.InitConfiguration{
LocalAPIEndpoint: kubeadmapiv1beta2.APIEndpoint{
// GetAPIServerAltNames errors without an AdvertiseAddress; this is as good as any.
AdvertiseAddress: "127.0.0.1",
},
defaultConfig := cmdutil.DefaultInitConfiguration()
// GetAPIServerAltNames errors without an AdvertiseAddress; this is as good as any.
defaultConfig.LocalAPIEndpoint = kubeadmapiv1beta2.APIEndpoint{
AdvertiseAddress: "127.0.0.1",
}

defaultInternalConfig := &kubeadmapi.InitConfiguration{}

kubeadmscheme.Scheme.Default(defaultConfig)
Expand Down
7 changes: 1 addition & 6 deletions cmd/kubeadm/app/cmd/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func newCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
tokenCmd.PersistentFlags().BoolVar(&dryRun,
options.DryRun, dryRun, "Whether to enable dry-run mode or not")

cfg := &kubeadmapiv1beta2.InitConfiguration{}
cfg := cmdutil.DefaultInitConfiguration()

// Default values for the cobra help text
kubeadmscheme.Scheme.Default(cfg)
Expand Down Expand Up @@ -244,11 +244,6 @@ func RunCreateToken(out io.Writer, client clientset.Interface, cfgPath string, i
// This call returns the ready-to-use configuration based on the configuration file that might or might not exist and the default cfg populated by flags
klog.V(1).Infoln("[token] loading configurations")

// In fact, we don't do any CRI ops at all.
// This is just to force skipping the CRI detection.
// Ref: https://github.com/kubernetes/kubeadm/issues/1559
initCfg.NodeRegistration.CRISocket = kubeadmconstants.DefaultDockerCRISocket

internalcfg, err := configutil.LoadOrDefaultInitConfiguration(cfgPath, initCfg, clusterCfg)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions cmd/kubeadm/app/cmd/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
importpath = "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util",
visibility = ["//visibility:public"],
deps = [
"//cmd/kubeadm/app/apis/kubeadm/v1beta2:go_default_library",
"//cmd/kubeadm/app/cmd/options:go_default_library",
"//cmd/kubeadm/app/constants:go_default_library",
"//cmd/kubeadm/app/util/kubeconfig:go_default_library",
Expand Down
12 changes: 12 additions & 0 deletions cmd/kubeadm/app/cmd/util/cmdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog/v2"
kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
)
Expand Down Expand Up @@ -87,3 +88,14 @@ func AddCRISocketFlag(flagSet *pflag.FlagSet, criSocket *string) {
"Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.",
)
}

// DefaultInitConfiguration return default InitConfiguration. Avoid running the CRI auto-detection
// code as we don't need it.
func DefaultInitConfiguration() *kubeadmapiv1beta2.InitConfiguration {
initCfg := &kubeadmapiv1beta2.InitConfiguration{
NodeRegistration: kubeadmapiv1beta2.NodeRegistrationOptions{
CRISocket: kubeadmconstants.UnknownCRISocket, // avoid CRI detection
},
}
return initCfg
}
5 changes: 4 additions & 1 deletion cmd/kubeadm/app/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ const (
// init/join time for use later. kubeadm annotates the node object with this information
AnnotationKubeadmCRISocket = "kubeadm.alpha.kubernetes.io/cri-socket"

// UnknownCRISocket defines the undetected or unknown CRI socket
UnknownCRISocket = "/var/run/unknown.sock"

// KubeadmConfigConfigMap specifies in what ConfigMap in the kube-system namespace the `kubeadm init` configuration should be stored
KubeadmConfigConfigMap = "kubeadm-config"

Expand Down Expand Up @@ -469,7 +472,7 @@ var (
16: "3.3.17-0",
17: "3.4.3-0",
18: "3.4.3-0",
19: "3.4.9-1",
19: "3.4.13-0",
20: "3.4.13-0",
21: "3.4.13-0",
}
Expand Down
Loading