Merge remote-tracking branch 'upstream/master' into kibana
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
# Maintainers
|
||||
|
||||
Matt Dupre <matt@projectcalico.org>, Casey Davenport <casey@tigera.io> and committers to the https://github.com/projectcalico/k8s-policy repository.
|
||||
|
||||
|
||||
[]()
|
||||
@@ -1,11 +1,11 @@
|
||||
# Calico Policy Controller
|
||||
==============
|
||||
|
||||
Calico is an implementation of the Kubernetes network policy API. The provided manifests install:
|
||||
|
||||
- A DaemonSet which runs Calico on each node in the cluster.
|
||||
- A Deployment which installs the Calico Typha agent.
|
||||
- A Service for the Calico Typha agent.
|
||||
- Horizontal and vertical autoscalers for Calico.
|
||||
|
||||
### Learn More
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: apiextensions.k8s.io/v1beta1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: bgpconfigurations.crd.projectcalico.org
|
||||
labels:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
spec:
|
||||
scope: Cluster
|
||||
group: crd.projectcalico.org
|
||||
version: v1
|
||||
names:
|
||||
kind: BGPConfiguration
|
||||
plural: bgpconfigurations
|
||||
singular: bgpconfiguration
|
||||
@@ -30,13 +30,6 @@ rules:
|
||||
- pods/status
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- patch
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
@@ -46,13 +39,6 @@ rules:
|
||||
- list
|
||||
- update
|
||||
- watch
|
||||
- apiGroups: ["extensions"]
|
||||
resources:
|
||||
- networkpolicies
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups: ["networking.k8s.io"]
|
||||
resources:
|
||||
- networkpolicies
|
||||
@@ -61,10 +47,8 @@ rules:
|
||||
- list
|
||||
- apiGroups: ["crd.projectcalico.org"]
|
||||
resources:
|
||||
- globalfelixconfigs
|
||||
- felixconfigurations
|
||||
- bgppeers
|
||||
- globalbgpconfigs
|
||||
- bgpconfigurations
|
||||
- ippools
|
||||
- globalnetworkpolicies
|
||||
@@ -78,3 +62,29 @@ rules:
|
||||
- list
|
||||
- update
|
||||
- watch
|
||||
# Used in Calico v2.6 only - can be removed after upgrade.
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- patch
|
||||
- apiGroups: ["crd.projectcalico.org"]
|
||||
resources:
|
||||
- globalfelixconfigs
|
||||
- globalbgpconfigs
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- update
|
||||
- watch
|
||||
- apiGroups: ["extensions"]
|
||||
resources:
|
||||
- networkpolicies
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
|
||||
@@ -33,7 +33,7 @@ spec:
|
||||
# container programs network policy and routes on each
|
||||
# host.
|
||||
- name: calico-node
|
||||
image: gcr.io/projectcalico-org/node:v2.6.7
|
||||
image: gcr.io/projectcalico-org/node:v3.3.1
|
||||
env:
|
||||
- name: CALICO_DISABLE_FILE_LOGGING
|
||||
value: "true"
|
||||
@@ -73,6 +73,7 @@ spec:
|
||||
httpGet:
|
||||
path: /liveness
|
||||
port: 9099
|
||||
host: localhost
|
||||
periodSeconds: 10
|
||||
initialDelaySeconds: 10
|
||||
failureThreshold: 6
|
||||
@@ -80,6 +81,7 @@ spec:
|
||||
httpGet:
|
||||
path: /readiness
|
||||
port: 9099
|
||||
host: localhost
|
||||
periodSeconds: 10
|
||||
volumeMounts:
|
||||
- mountPath: /lib/modules
|
||||
@@ -97,7 +99,7 @@ spec:
|
||||
# This container installs the Calico CNI binaries
|
||||
# and CNI network config file on each node.
|
||||
- name: install-cni
|
||||
image: gcr.io/projectcalico-org/cni:v1.11.2
|
||||
image: gcr.io/projectcalico-org/cni:v3.3.1
|
||||
command: ["/install-cni.sh"]
|
||||
env:
|
||||
- name: CNI_CONF_NAME
|
||||
@@ -110,7 +112,7 @@ spec:
|
||||
"plugins": [
|
||||
{
|
||||
"type": "calico",
|
||||
"log_level": "debug",
|
||||
"log_level": "info",
|
||||
"datastore_type": "kubernetes",
|
||||
"nodename": "__KUBERNETES_NODE_NAME__",
|
||||
"ipam": {
|
||||
@@ -118,11 +120,9 @@ spec:
|
||||
"subnet": "usePodCidr"
|
||||
},
|
||||
"policy": {
|
||||
"type": "k8s",
|
||||
"k8s_auth_token": "__SERVICEACCOUNT_TOKEN__"
|
||||
"type": "k8s"
|
||||
},
|
||||
"kubernetes": {
|
||||
"k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__",
|
||||
"kubeconfig": "__KUBECONFIG_FILEPATH__"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ spec:
|
||||
hostNetwork: true
|
||||
serviceAccountName: calico
|
||||
containers:
|
||||
- image: gcr.io/projectcalico-org/typha:v0.5.6
|
||||
- image: gcr.io/projectcalico-org/typha:v3.3.1
|
||||
name: calico-typha
|
||||
ports:
|
||||
- containerPort: 5473
|
||||
@@ -58,12 +58,14 @@ spec:
|
||||
httpGet:
|
||||
path: /liveness
|
||||
port: 9098
|
||||
host: localhost
|
||||
periodSeconds: 30
|
||||
initialDelaySeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readiness
|
||||
port: 9098
|
||||
host: localhost
|
||||
periodSeconds: 10
|
||||
volumes:
|
||||
- name: etc-calico
|
||||
|
||||
@@ -8,6 +8,8 @@ Design details [here](https://github.com/kubernetes/community/blob/master/keps/s
|
||||
|
||||
This directory contains the addon config yaml - `nodelocaldns.yaml`
|
||||
The variables will be substituted by the configure scripts when the yaml is copied into master.
|
||||
To create a GCE cluster with nodelocaldns enabled, use the command:
|
||||
`KUBE_ENABLE_NODELOCAL_DNS=true go run hack/e2e.go -v --up`
|
||||
|
||||
### Network policy and DNS connectivity
|
||||
|
||||
@@ -32,4 +34,4 @@ spec:
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
```
|
||||
```
|
||||
|
||||
@@ -84,7 +84,7 @@ metadata:
|
||||
name: node-local-dns
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
k8s-app: node-local-dns
|
||||
kubernetes.io/cluster-service: "true"
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
spec:
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
approvers:
|
||||
- coffeepac
|
||||
- monotek
|
||||
- piosz
|
||||
reviewers:
|
||||
- coffeepac
|
||||
- monotek
|
||||
- piosz
|
||||
labels:
|
||||
- sig/instrumentation
|
||||
|
||||
@@ -320,7 +320,7 @@ data:
|
||||
<source>
|
||||
@id journald-container-runtime
|
||||
@type systemd
|
||||
matches [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
|
||||
matches [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
|
||||
<storage>
|
||||
@type local
|
||||
persistent true
|
||||
|
||||
@@ -61,16 +61,18 @@ data:
|
||||
# reform.var.log.containers.<POD_NAME>_<NAMESPACE_NAME>_<CONTAINER_NAME>-<CONTAINER_ID>.log
|
||||
tag reform.*
|
||||
read_from_head true
|
||||
format multi_format
|
||||
<pattern>
|
||||
format json
|
||||
time_key time
|
||||
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
||||
</pattern>
|
||||
<pattern>
|
||||
format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
|
||||
time_format %Y-%m-%dT%H:%M:%S.%N%:z
|
||||
</pattern>
|
||||
<parse>
|
||||
@type multi_format
|
||||
<pattern>
|
||||
format json
|
||||
time_key time
|
||||
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
||||
</pattern>
|
||||
<pattern>
|
||||
format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
|
||||
time_format %Y-%m-%dT%H:%M:%S.%N%:z
|
||||
</pattern>
|
||||
</parse>
|
||||
</source>
|
||||
|
||||
<filter reform.**>
|
||||
@@ -251,7 +253,7 @@ data:
|
||||
|
||||
<source>
|
||||
@type systemd
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
|
||||
pos_file /var/log/gcp-journald-container-runtime.pos
|
||||
read_from_head true
|
||||
tag container-runtime
|
||||
@@ -287,7 +289,7 @@ data:
|
||||
@type grep
|
||||
<exclude>
|
||||
key _SYSTEMD_UNIT
|
||||
pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
|
||||
pattern ^(docker|{{ fluentd_container_runtime_service }}|kubelet|node-problem-detector)\.service$
|
||||
</exclude>
|
||||
</filter>
|
||||
# END_NODE_JOURNAL
|
||||
|
||||
@@ -64,16 +64,18 @@ data:
|
||||
# reform.var.log.containers.<POD_NAME>_<NAMESPACE_NAME>_<CONTAINER_NAME>-<CONTAINER_ID>.log
|
||||
tag reform.*
|
||||
read_from_head true
|
||||
format multi_format
|
||||
<pattern>
|
||||
format json
|
||||
time_key time
|
||||
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
||||
</pattern>
|
||||
<pattern>
|
||||
format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
|
||||
time_format %Y-%m-%dT%H:%M:%S.%N%:z
|
||||
</pattern>
|
||||
<parse>
|
||||
@type multi_format
|
||||
<pattern>
|
||||
format json
|
||||
time_key time
|
||||
time_format %Y-%m-%dT%H:%M:%S.%NZ
|
||||
</pattern>
|
||||
<pattern>
|
||||
format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
|
||||
time_format %Y-%m-%dT%H:%M:%S.%N%:z
|
||||
</pattern>
|
||||
</parse>
|
||||
</source>
|
||||
|
||||
<filter reform.**>
|
||||
@@ -266,7 +268,7 @@ data:
|
||||
|
||||
<source>
|
||||
@type systemd
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
|
||||
filters [{ "_SYSTEMD_UNIT": "{{ fluentd_container_runtime_service }}.service" }]
|
||||
pos_file /var/log/gcp-journald-container-runtime.pos
|
||||
read_from_head true
|
||||
tag container-runtime
|
||||
@@ -302,7 +304,7 @@ data:
|
||||
@type grep
|
||||
<exclude>
|
||||
key _SYSTEMD_UNIT
|
||||
pattern ^(docker|{{ container_runtime }}|kubelet|node-problem-detector)\.service$
|
||||
pattern ^(docker|{{ fluentd_container_runtime_service }}|kubelet|node-problem-detector)\.service$
|
||||
</exclude>
|
||||
</filter>
|
||||
# END_NODE_JOURNAL
|
||||
|
||||
@@ -409,8 +409,8 @@ fi
|
||||
|
||||
# Fluentd requirements
|
||||
# YAML exists to trigger a configuration refresh when changes are made.
|
||||
FLUENTD_GCP_YAML_VERSION="v3.1.0"
|
||||
FLUENTD_GCP_VERSION="${FLUENTD_GCP_VERSION:-0.5-1.5.36-1-k8s}"
|
||||
FLUENTD_GCP_YAML_VERSION="v3.2.0"
|
||||
FLUENTD_GCP_VERSION="${FLUENTD_GCP_VERSION:-0.6-1.6.0-1}"
|
||||
FLUENTD_GCP_MEMORY_LIMIT="${FLUENTD_GCP_MEMORY_LIMIT:-}"
|
||||
FLUENTD_GCP_CPU_REQUEST="${FLUENTD_GCP_CPU_REQUEST:-}"
|
||||
FLUENTD_GCP_MEMORY_REQUEST="${FLUENTD_GCP_MEMORY_REQUEST:-}"
|
||||
|
||||
@@ -177,7 +177,7 @@ ENABLE_METADATA_AGENT="${KUBE_ENABLE_METADATA_AGENT:-none}"
|
||||
# Useful for scheduling heapster in large clusters with nodes of small size.
|
||||
HEAPSTER_MACHINE_TYPE="${HEAPSTER_MACHINE_TYPE:-}"
|
||||
|
||||
# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.2.24-1) if you need
|
||||
# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.3.10-0) if you need
|
||||
# non-default version.
|
||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||
ETCD_DOCKER_REPOSITORY="${TEST_ETCD_DOCKER_REPOSITORY:-}"
|
||||
@@ -425,8 +425,8 @@ fi
|
||||
|
||||
# Fluentd requirements
|
||||
# YAML exists to trigger a configuration refresh when changes are made.
|
||||
FLUENTD_GCP_YAML_VERSION="v3.1.0"
|
||||
FLUENTD_GCP_VERSION="${FLUENTD_GCP_VERSION:-0.5-1.5.36-1-k8s}"
|
||||
FLUENTD_GCP_YAML_VERSION="v3.2.0"
|
||||
FLUENTD_GCP_VERSION="${FLUENTD_GCP_VERSION:-0.6-1.6.0-1}"
|
||||
FLUENTD_GCP_MEMORY_LIMIT="${FLUENTD_GCP_MEMORY_LIMIT:-}"
|
||||
FLUENTD_GCP_CPU_REQUEST="${FLUENTD_GCP_CPU_REQUEST:-}"
|
||||
FLUENTD_GCP_MEMORY_REQUEST="${FLUENTD_GCP_MEMORY_REQUEST:-}"
|
||||
|
||||
@@ -98,7 +98,7 @@ func TestEncryptionProviderFlag(t *testing.T) {
|
||||
// "-c", - Index 1
|
||||
// "exec /usr/local/bin/kube-apiserver " - Index 2
|
||||
execArgsIndex = 2
|
||||
encryptionConfigFlag = "--experimental-encryption-provider-config"
|
||||
encryptionConfigFlag = "--encryption-provider-config"
|
||||
)
|
||||
|
||||
testCases := []struct {
|
||||
|
||||
@@ -1089,6 +1089,11 @@ EOF
|
||||
}
|
||||
|
||||
function create-node-problem-detector-kubeconfig {
|
||||
local apiserver_address="${1}"
|
||||
if [[ -z "${apiserver_address}" ]]; then
|
||||
echo "Must provide API server address to create node-problem-detector kubeconfig file!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Creating node-problem-detector kubeconfig file"
|
||||
mkdir -p /var/lib/node-problem-detector
|
||||
cat <<EOF >/var/lib/node-problem-detector/kubeconfig
|
||||
@@ -1101,6 +1106,7 @@ users:
|
||||
clusters:
|
||||
- name: local
|
||||
cluster:
|
||||
server: https://${apiserver_address}
|
||||
certificate-authority-data: ${CA_CERT}
|
||||
contexts:
|
||||
- context:
|
||||
@@ -1230,7 +1236,7 @@ function start-node-problem-detector {
|
||||
local -r km_config="${KUBE_HOME}/node-problem-detector/config/kernel-monitor.json"
|
||||
# TODO(random-liu): Handle this for alternative container runtime.
|
||||
local -r dm_config="${KUBE_HOME}/node-problem-detector/config/docker-monitor.json"
|
||||
local -r custom_km_config="${KUBE_HOME}/node-problem-detector/config/kernel-monitor-counter.json"
|
||||
local -r custom_km_config="${KUBE_HOME}/node-problem-detector/config/kernel-monitor-counter.json,${KUBE_HOME}/node-problem-detector/config/systemd-monitor-counter.json,${KUBE_HOME}/node-problem-detector/config/docker-monitor-counter.json"
|
||||
echo "Using node problem detector binary at ${npd_bin}"
|
||||
local flags="${NPD_TEST_LOG_LEVEL:-"--v=2"} ${NPD_TEST_ARGS:-}"
|
||||
flags+=" --logtostderr"
|
||||
@@ -1815,7 +1821,7 @@ function start-kube-apiserver {
|
||||
# Sets-up etcd encryption.
|
||||
# Configuration of etcd level encryption consists of the following steps:
|
||||
# 1. Writing encryption provider config to disk
|
||||
# 2. Adding experimental-encryption-provider-config flag to kube-apiserver
|
||||
# 2. Adding encryption-provider-config flag to kube-apiserver
|
||||
# 3. Add kms-socket-vol and kms-socket-vol-mnt to enable communication with kms-plugin (if requested)
|
||||
#
|
||||
# Expects parameters:
|
||||
@@ -1855,7 +1861,7 @@ function setup-etcd-encryption {
|
||||
encryption_provider_config_path=${ENCRYPTION_PROVIDER_CONFIG_PATH:-/etc/srv/kubernetes/encryption-provider-config.yml}
|
||||
|
||||
echo "${ENCRYPTION_PROVIDER_CONFIG}" | base64 --decode > "${encryption_provider_config_path}"
|
||||
kube_api_server_params+=" --experimental-encryption-provider-config=${encryption_provider_config_path}"
|
||||
kube_api_server_params+=" --encryption-provider-config=${encryption_provider_config_path}"
|
||||
|
||||
default_encryption_provider_config_vol=$(echo "{ \"name\": \"encryptionconfig\", \"hostPath\": {\"path\": \"${encryption_provider_config_path}\", \"type\": \"File\"}}" | base64 | tr -d '\r\n')
|
||||
default_encryption_provider_config_vol_mnt=$(echo "{ \"name\": \"encryptionconfig\", \"mountPath\": \"${encryption_provider_config_path}\", \"readOnly\": true}" | base64 | tr -d '\r\n')
|
||||
@@ -2232,14 +2238,14 @@ function start-fluentd-resource-update {
|
||||
wait-for-apiserver-and-update-fluentd &
|
||||
}
|
||||
|
||||
# Update {{ container-runtime }} with actual container runtime name,
|
||||
# and {{ container-runtime-endpoint }} with actual container runtime
|
||||
# Update {{ fluentd_container_runtime_service }} with actual container runtime name,
|
||||
# and {{ container_runtime_endpoint }} with actual container runtime
|
||||
# endpoint.
|
||||
function update-container-runtime {
|
||||
local -r file="$1"
|
||||
local -r container_runtime_endpoint="${CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/dockershim.sock}"
|
||||
sed -i \
|
||||
-e "s@{{ *container_runtime *}}@${CONTAINER_RUNTIME_NAME:-docker}@g" \
|
||||
-e "s@{{ *fluentd_container_runtime_service *}}@${FLUENTD_CONTAINER_RUNTIME_SERVICE:-${CONTAINER_RUNTIME_NAME:-docker}}@g" \
|
||||
-e "s@{{ *container_runtime_endpoint *}}@${container_runtime_endpoint#unix://}@g" \
|
||||
"${file}"
|
||||
}
|
||||
@@ -2321,10 +2327,10 @@ function setup-fluentd {
|
||||
fluentd_gcp_configmap_name="fluentd-gcp-config-old"
|
||||
fi
|
||||
sed -i -e "s@{{ fluentd_gcp_configmap_name }}@${fluentd_gcp_configmap_name}@g" "${fluentd_gcp_yaml}"
|
||||
fluentd_gcp_yaml_version="${FLUENTD_GCP_YAML_VERSION:-v3.1.0}"
|
||||
fluentd_gcp_yaml_version="${FLUENTD_GCP_YAML_VERSION:-v3.2.0}"
|
||||
sed -i -e "s@{{ fluentd_gcp_yaml_version }}@${fluentd_gcp_yaml_version}@g" "${fluentd_gcp_yaml}"
|
||||
sed -i -e "s@{{ fluentd_gcp_yaml_version }}@${fluentd_gcp_yaml_version}@g" "${fluentd_gcp_scaler_yaml}"
|
||||
fluentd_gcp_version="${FLUENTD_GCP_VERSION:-0.5-1.5.36-1-k8s}"
|
||||
fluentd_gcp_version="${FLUENTD_GCP_VERSION:-0.6-1.6.0-1}"
|
||||
sed -i -e "s@{{ fluentd_gcp_version }}@${fluentd_gcp_version}@g" "${fluentd_gcp_yaml}"
|
||||
update-daemon-set-prometheus-to-sd-parameters ${fluentd_gcp_yaml}
|
||||
start-fluentd-resource-update ${fluentd_gcp_yaml}
|
||||
@@ -2622,7 +2628,7 @@ function setup-node-termination-handler-manifest {
|
||||
local -r nth_manifest="/etc/kubernetes/$1/$2/daemonset.yaml"
|
||||
if [[ -n "${NODE_TERMINATION_HANDLER_IMAGE}" ]]; then
|
||||
sed -i "s|image:.*|image: ${NODE_TERMINATION_HANDLER_IMAGE}|" "${nth_manifest}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Setups manifests for ingress controller and gce-specific policies for service controller.
|
||||
@@ -2826,7 +2832,7 @@ function main() {
|
||||
create-kubeproxy-user-kubeconfig
|
||||
fi
|
||||
if [[ "${ENABLE_NODE_PROBLEM_DETECTOR:-}" == "standalone" ]]; then
|
||||
create-node-problem-detector-kubeconfig
|
||||
create-node-problem-detector-kubeconfig ${KUBERNETES_MASTER_NAME}
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -2839,8 +2845,10 @@ function main() {
|
||||
|
||||
if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
|
||||
compute-master-manifest-variables
|
||||
start-etcd-servers
|
||||
start-etcd-empty-dir-cleanup-pod
|
||||
if [[ -z "${ETCD_SERVERS:-}" ]]; then
|
||||
start-etcd-servers
|
||||
start-etcd-empty-dir-cleanup-pod
|
||||
fi
|
||||
start-kube-apiserver
|
||||
start-kube-controller-manager
|
||||
start-kube-scheduler
|
||||
|
||||
@@ -26,8 +26,8 @@ set -o pipefail
|
||||
### Hardcoded constants
|
||||
DEFAULT_CNI_VERSION="v0.6.0"
|
||||
DEFAULT_CNI_SHA1="d595d3ded6499a64e8dac02466e2f5f2ce257c9f"
|
||||
DEFAULT_NPD_VERSION="v0.5.0"
|
||||
DEFAULT_NPD_SHA1="650ecfb2ae495175ee43706d0bd862a1ea7f1395"
|
||||
DEFAULT_NPD_VERSION="v0.6.0"
|
||||
DEFAULT_NPD_SHA1="a28e960a21bb74bc0ae09c267b6a340f30e5b3a6"
|
||||
DEFAULT_CRICTL_VERSION="v1.12.0"
|
||||
DEFAULT_CRICTL_SHA1="82ef8b44849f9da0589c87e9865d4716573eec7f"
|
||||
DEFAULT_MOUNTER_TAR_SHA="8003b798cf33c7f91320cd6ee5cec4fa22244571"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"containers": [
|
||||
{
|
||||
"name": "cluster-autoscaler",
|
||||
"image": "k8s.gcr.io/cluster-autoscaler:v1.12.0",
|
||||
"image": "k8s.gcr.io/cluster-autoscaler:v1.13.0",
|
||||
"livenessProbe": {
|
||||
"httpGet": {
|
||||
"path": "/health-check",
|
||||
|
||||
@@ -14,4 +14,4 @@ spec:
|
||||
dnsPolicy: Default
|
||||
containers:
|
||||
- name: etcd-empty-dir-cleanup
|
||||
image: k8s.gcr.io/etcd-empty-dir-cleanup:3.2.24.0
|
||||
image: k8s.gcr.io/etcd-empty-dir-cleanup:3.3.10.0
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"containers":[
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.2.24-1') }}",
|
||||
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.3.10-0') }}",
|
||||
"resources": {
|
||||
"requests": {
|
||||
"cpu": {{ cpulimit }}
|
||||
@@ -30,7 +30,7 @@
|
||||
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
|
||||
},
|
||||
{ "name": "TARGET_VERSION",
|
||||
"value": "{{ pillar.get('etcd_version', '3.2.24') }}"
|
||||
"value": "{{ pillar.get('etcd_version', '3.3.10') }}"
|
||||
},
|
||||
{ "name": "DATA_DIRECTORY",
|
||||
"value": "/var/etcd/data{{ suffix }}"
|
||||
|
||||
@@ -161,8 +161,8 @@ export KUBE_GCE_ENABLE_IP_ALIASES=true
|
||||
export SECONDARY_RANGE_NAME="pods-default"
|
||||
export STORAGE_BACKEND="etcd3"
|
||||
export STORAGE_MEDIA_TYPE="application/vnd.kubernetes.protobuf"
|
||||
export ETCD_IMAGE=3.2.24-1
|
||||
export ETCD_VERSION=3.2.24
|
||||
export ETCD_IMAGE=3.3.10-0
|
||||
export ETCD_VERSION=3.3.10
|
||||
|
||||
# Upgrade master with updated kube envs
|
||||
${KUBE_ROOT}/cluster/gce/upgrade.sh -M -l
|
||||
|
||||
@@ -2342,7 +2342,6 @@ function create-nodes() {
|
||||
|
||||
local instances_left=${nodes}
|
||||
|
||||
#TODO: parallelize this loop to speed up the process
|
||||
for ((i=1; i<=${NUM_MIGS}; i++)); do
|
||||
local group_name="${NODE_INSTANCE_PREFIX}-group-$i"
|
||||
if [[ $i == ${NUM_MIGS} ]]; then
|
||||
@@ -2365,8 +2364,9 @@ function create-nodes() {
|
||||
"${group_name}" \
|
||||
--zone "${ZONE}" \
|
||||
--project "${PROJECT}" \
|
||||
--timeout "${MIG_WAIT_UNTIL_STABLE_TIMEOUT}" || true;
|
||||
--timeout "${MIG_WAIT_UNTIL_STABLE_TIMEOUT}" || true &
|
||||
done
|
||||
wait
|
||||
}
|
||||
|
||||
# Assumes:
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
|
||||
.PHONY: build push
|
||||
|
||||
ETCD_VERSION = 3.2.24
|
||||
ETCD_VERSION = 3.3.10
|
||||
# Image should be pulled from k8s.gcr.io, which will auto-detect
|
||||
# region (us, eu, asia, ...) and pull from the closest.
|
||||
REGISTRY = k8s.gcr.io
|
||||
# Images should be pushed to staging-k8s.gcr.io.
|
||||
PUSH_REGISTRY = staging-k8s.gcr.io
|
||||
TAG = 3.2.24.0
|
||||
TAG = 3.3.10.0
|
||||
|
||||
clean:
|
||||
rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# Build the etcd image
|
||||
#
|
||||
# Usage:
|
||||
# [BUNDLED_ETCD_VERSIONS=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
|
||||
# [BUNDLED_ETCD_VERSIONS=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24 3.3.10] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
|
||||
#
|
||||
# The image contains different etcd versions to simplify
|
||||
# upgrades. Thus be careful when removing any versions from here.
|
||||
@@ -26,15 +26,15 @@
|
||||
# Except from etcd-$(version) and etcdctl-$(version) binaries, we also
|
||||
# need etcd and etcdctl binaries for backward compatibility reasons.
|
||||
# That binary will be set to the last version from $(BUNDLED_ETCD_VERSIONS).
|
||||
BUNDLED_ETCD_VERSIONS?=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24
|
||||
BUNDLED_ETCD_VERSIONS?=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24 3.3.10
|
||||
|
||||
# LATEST_ETCD_VERSION identifies the most recent etcd version available.
|
||||
LATEST_ETCD_VERSION?=3.2.24
|
||||
LATEST_ETCD_VERSION?=3.3.10
|
||||
|
||||
# REVISION provides a version number fo this image and all it's bundled
|
||||
# artifacts. It should start at zero for each LATEST_ETCD_VERSION and increment
|
||||
# for each revision of this image at that etcd version.
|
||||
REVISION?=1
|
||||
REVISION?=0
|
||||
|
||||
# IMAGE_TAG Uniquely identifies k8s.gcr.io/etcd docker image with a tag of the form "<etcd-version>-<revision>".
|
||||
IMAGE_TAG=$(LATEST_ETCD_VERSION)-$(REVISION)
|
||||
@@ -52,7 +52,7 @@ MANIFEST_IMAGE := $(PUSH_REGISTRY)/etcd
|
||||
# This option is for running docker manifest command
|
||||
export DOCKER_CLI_EXPERIMENTAL := enabled
|
||||
# golang version should match the golang version from https://github.com/coreos/etcd/releases for the current ETCD_VERSION.
|
||||
GOLANG_VERSION?=1.8.7
|
||||
GOLANG_VERSION?=1.10.4
|
||||
GOARM=7
|
||||
TEMP_DIR:=$(shell mktemp -d)
|
||||
|
||||
@@ -159,7 +159,7 @@ build-integration-test-image: build
|
||||
|
||||
integration-test:
|
||||
docker run --interactive -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -e GOARCH=$(ARCH) etcd-integration-test \
|
||||
/bin/bash -c "CGO_ENABLED=0 go test -tags=integration -v k8s.io/kubernetes/cluster/images/etcd/migrate -args -v 10 -logtostderr true"
|
||||
/bin/bash -c "CGO_ENABLED=0 go test -tags=integration k8s.io/kubernetes/cluster/images/etcd/migrate -args -v 10 -logtostderr true"
|
||||
|
||||
integration-build-test: build-integration-test-image integration-test
|
||||
test: unit-test integration-build-test
|
||||
|
||||
@@ -26,7 +26,7 @@ server.
|
||||
|
||||
`migrate` writes a `version.txt` file to track the "current" version
|
||||
of etcd that was used to persist data to disk. A "target" version may also be provided
|
||||
by the `TARGET_STORAGE` (e.g. "etcd3") and `TARGET_VERSION` (e.g. "3.2.24" )
|
||||
by the `TARGET_STORAGE` (e.g. "etcd3") and `TARGET_VERSION` (e.g. "3.3.10" )
|
||||
environment variables. If the persisted version differs from the target version,
|
||||
`migrate-if-needed.sh` will migrate the data from the current to the target
|
||||
version.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# This script performs etcd upgrade based on the following environmental
|
||||
# variables:
|
||||
# TARGET_STORAGE - API of etcd to be used (supported: 'etcd2', 'etcd3')
|
||||
# TARGET_VERSION - etcd release to be used (supported: '2.2.1', '2.3.7', '3.0.17', '3.1.12', '3.2.24')
|
||||
# TARGET_VERSION - etcd release to be used (supported: '2.2.1', '2.3.7', '3.0.17', '3.1.12', '3.2.24', "3.3.10")
|
||||
# DATA_DIRECTORY - directory with etcd data
|
||||
#
|
||||
# The current etcd version and storage format is detected based on the
|
||||
@@ -30,6 +30,7 @@
|
||||
# - 2.3.7/etcd2 -> 3.0.17/etcd2
|
||||
# - 3.0.17/etcd3 -> 3.1.12/etcd3
|
||||
# - 3.1.12/etcd3 -> 3.2.24/etcd3
|
||||
# - 3.2.24/etcd3 -> 3.3.10/etcd3
|
||||
#
|
||||
# NOTE: The releases supported in this script has to match release binaries
|
||||
# present in the etcd image (to make this script work correctly).
|
||||
@@ -42,7 +43,7 @@ set -o nounset
|
||||
|
||||
# NOTE: BUNDLED_VERSION has to match release binaries present in the
|
||||
# etcd image (to make this script work correctly).
|
||||
BUNDLED_VERSIONS="2.2.1, 2.3.7, 3.0.17, 3.1.12, 3.2.24"
|
||||
BUNDLED_VERSIONS="2.2.1, 2.3.7, 3.0.17, 3.1.12, 3.2.24, 3.3.10"
|
||||
|
||||
ETCD_NAME="${ETCD_NAME:-etcd-$(hostname)}"
|
||||
if [ -z "${DATA_DIRECTORY:-}" ]; then
|
||||
|
||||
@@ -122,7 +122,7 @@ type VersionFile struct {
|
||||
path string
|
||||
}
|
||||
|
||||
// Exists returns true if a version.txt file exists on the filesystem.
|
||||
// Exists returns true if a version.txt file exists on the file system.
|
||||
func (v *VersionFile) Exists() (bool, error) {
|
||||
return exists(v.path)
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ ETCD_COMPACTION_INTERVAL_SEC="${KUBEMARK_ETCD_COMPACTION_INTERVAL_SEC:-}"
|
||||
# non-default version.
|
||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||
ETCD_SERVERS="${KUBEMARK_ETCD_SERVERS:-}"
|
||||
ETCD_SERVERS_OVERRIDES="${KUBEMARK_ETCD_SERVERS_OVERRIDES:-}"
|
||||
|
||||
# Storage backend. 'etcd2' and 'etcd3' are supported.
|
||||
STORAGE_BACKEND=${STORAGE_BACKEND:-}
|
||||
|
||||
Reference in New Issue
Block a user