[calico] clean up workarounds for older versions

pull/8978/head
Calin Cristian Andrei 2022-06-11 18:57:09 +03:00 committed by Kubernetes Prow Robot
parent 9efe145688
commit 2de5c4821c
7 changed files with 5 additions and 11 deletions

View File

@ -40,7 +40,6 @@ spec:
requests: requests:
cpu: {{ calico_policy_controller_cpu_requests }} cpu: {{ calico_policy_controller_cpu_requests }}
memory: {{ calico_policy_controller_memory_requests }} memory: {{ calico_policy_controller_memory_requests }}
{% if calico_version is version('v3.19.0', '>=') %}
livenessProbe: livenessProbe:
exec: exec:
command: command:
@ -49,7 +48,6 @@ spec:
periodSeconds: 10 periodSeconds: 10
initialDelaySeconds: 10 initialDelaySeconds: 10
failureThreshold: 6 failureThreshold: 6
{% endif %}
readinessProbe: readinessProbe:
exec: exec:
command: command:

View File

@ -4,13 +4,13 @@ dependencies:
when: when:
- kube_network_plugin == 'calico' - kube_network_plugin == 'calico'
- enable_network_policy - enable_network_policy
- calico_datastore != "kdd" or calico_policy_version is version('v3.6.0', '>=') - calico_datastore != "kdd"
tags: tags:
- policy-controller - policy-controller
- role: policy_controller/calico - role: policy_controller/calico
when: when:
- kube_network_plugin == 'canal' - kube_network_plugin == 'canal'
- calico_datastore != "kdd" or calico_policy_version is version('v3.6.0', '>=') - calico_datastore != "kdd"
tags: tags:
- policy-controller - policy-controller

View File

@ -4,6 +4,6 @@
kube_proxy_deployed: "{{ 'addon/kube-proxy' not in kubeadm_init_phases_skip }}" kube_proxy_deployed: "{{ 'addon/kube-proxy' not in kubeadm_init_phases_skip }}"
# The lowest version allowed to upgrade from (same as calico_version in the previous branch) # The lowest version allowed to upgrade from (same as calico_version in the previous branch)
calico_min_version_required: "v3.17.5" calico_min_version_required: "v3.19.4"
containerd_min_version_required: "1.3.7" containerd_min_version_required: "1.3.7"

View File

@ -13,7 +13,6 @@ rules:
- configmaps - configmaps
verbs: verbs:
- get - get
{% if calico_version is version("v3.20.0", ">=") %}
# EndpointSlices are used for Service-based network policy rule # EndpointSlices are used for Service-based network policy rule
# enforcement. # enforcement.
- apiGroups: ["discovery.k8s.io"] - apiGroups: ["discovery.k8s.io"]
@ -22,7 +21,6 @@ rules:
verbs: verbs:
- watch - watch
- list - list
{% endif %}
- apiGroups: [""] - apiGroups: [""]
resources: resources:
- endpoints - endpoints

View File

@ -310,14 +310,12 @@ spec:
requests: requests:
cpu: {{ calico_node_cpu_requests }} cpu: {{ calico_node_cpu_requests }}
memory: {{ calico_node_memory_requests }} memory: {{ calico_node_memory_requests }}
{% if calico_version is version('v3.21.0', '>=') %}
lifecycle: lifecycle:
preStop: preStop:
exec: exec:
command: command:
- /bin/calico-node - /bin/calico-node
- -shutdown - -shutdown
{% endif %}
livenessProbe: livenessProbe:
exec: exec:
command: command:

View File

@ -3,4 +3,4 @@ ETCD_ENDPOINTS={{ etcd_access_addresses }} \
ETCD_CA_CERT_FILE={{ calico_cert_dir }}/ca_cert.crt \ ETCD_CA_CERT_FILE={{ calico_cert_dir }}/ca_cert.crt \
ETCD_CERT_FILE={{ calico_cert_dir }}/cert.crt \ ETCD_CERT_FILE={{ calico_cert_dir }}/cert.crt \
ETCD_KEY_FILE={{ calico_cert_dir }}/key.pem \ ETCD_KEY_FILE={{ calico_cert_dir }}/key.pem \
{{ bin_dir }}/calicoctl {% if calico_version is version('v3.20.0', '>=') %}--allow-version-mismatch{% endif %} "$@" {{ bin_dir }}/calicoctl --allow-version-mismatch "$@"

View File

@ -5,4 +5,4 @@ KUBECONFIG=/etc/kubernetes/admin.conf \
{% else %} {% else %}
KUBECONFIG=/etc/cni/net.d/calico-kubeconfig \ KUBECONFIG=/etc/cni/net.d/calico-kubeconfig \
{% endif %} {% endif %}
{{ bin_dir }}/calicoctl {% if calico_version is version('v3.20.0', '>=') %}--allow-version-mismatch{% endif %} "$@" {{ bin_dir }}/calicoctl --allow-version-mismatch "$@"