Skip to content

Commit

Permalink
add support for k8s 1.21.0
Browse files Browse the repository at this point in the history
This commit adds the minimal set of changes required to be able to
compile Cilium with the new k8s libraries as well as it synced all files
in pkg/k8s/slim with the upstream versions.

Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
aanm committed Mar 31, 2021
1 parent a39b030 commit 382e7e4
Show file tree
Hide file tree
Showing 1,464 changed files with 109,924 additions and 10,693 deletions.
2 changes: 1 addition & 1 deletion Documentation/concepts/kubernetes/compatibility.rst
Expand Up @@ -21,7 +21,7 @@ backward compatibility offered by Kubernetes.
| k8s Version | k8s NetworkPolicy API | CiliumNetworkPolicy |
+------------------------------------+---------------------------+----------------------------+
| | | ``cilium.io/v2`` has a |
| 1.16, 1.17, 1.18, 1.19, 1.20 | * `networking.k8s.io/v1`_ | `CustomResourceDefinition` |
| 1.16, 1.17, 1.18, 1.19, 1.20, 1.21 | * `networking.k8s.io/v1`_ | `CustomResourceDefinition` |
+------------------------------------+---------------------------+----------------------------+

Cilium CRD schema validation
Expand Down
1 change: 1 addition & 0 deletions Documentation/concepts/kubernetes/requirements.rst
Expand Up @@ -23,6 +23,7 @@ backward compatibility offered by Kubernetes.
* 1.18
* 1.19
* 1.20
* 1.21

System Requirements
===================
Expand Down
1 change: 1 addition & 0 deletions Documentation/contributing/testing/e2e.rst
Expand Up @@ -135,6 +135,7 @@ The Kubernetes tests support the following Kubernetes versions:
* 1.18
* 1.19
* 1.20
* 1.21

By default, the Vagrant VMs are provisioned with Kubernetes 1.20. To run with any other
supported version of Kubernetes, run the test suite with the following format:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -376,12 +376,14 @@ generate-k8s-api: ## Generate Cilium k8s API client, deepcopy and deepequal Go s
github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/meta/v1$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/meta/v1beta1$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/util/intstr$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1$(comma)$\
github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1beta1)
$(call generate_k8s_api_deepcopy_deepequal_client,client,github.com/cilium/cilium/pkg/k8s/slim/k8s/api,"$\
discovery:v1beta1\
discovery:v1\
networking:v1\
core:v1")
$(call generate_k8s_api_deepcopy_deepequal_client,apiextensions-client,github.com/cilium/cilium/pkg/k8s/slim/k8s/apis,"$\
Expand Down
2 changes: 1 addition & 1 deletion contrib/vagrant/deployments/coredns-cm.yaml.sed
@@ -1,5 +1,5 @@
# File source
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.20/cluster/addons/dns/coredns/coredns.yaml.base
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.21/cluster/addons/dns/coredns/coredns.yaml.base

apiVersion: v1
kind: ConfigMap
Expand Down
4 changes: 2 additions & 2 deletions contrib/vagrant/deployments/coredns-controller.yaml
@@ -1,5 +1,5 @@
# File source
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.20/cluster/addons/dns/coredns/coredns.yaml.base
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.21/cluster/addons/dns/coredns/coredns.yaml.base
# __MACHINE_GENERATED_WARNING__

apiVersion: apps/v1
Expand Down Expand Up @@ -52,7 +52,7 @@ spec:
kubernetes.io/os: linux
containers:
- name: coredns
image: k8s.gcr.io/coredns:1.7.0
image: k8s.gcr.io/coredns/coredns:v1.8.0
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion contrib/vagrant/deployments/coredns-sa.yaml
@@ -1,5 +1,5 @@
# File source
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.20/cluster/addons/dns/coredns/coredns.yaml.base
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.21/cluster/addons/dns/coredns/coredns.yaml.base
---
apiVersion: v1
kind: ServiceAccount
Expand Down
2 changes: 1 addition & 1 deletion contrib/vagrant/deployments/coredns-svc.yaml.sed
@@ -1,5 +1,5 @@
# File source
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.20/cluster/addons/dns/coredns/coredns.yaml.base
# https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.21/cluster/addons/dns/coredns/coredns.yaml.base

apiVersion: v1
kind: Service
Expand Down
2 changes: 1 addition & 1 deletion contrib/vagrant/scripts/helpers.bash
Expand Up @@ -76,7 +76,7 @@ cluster_api_server_ip=${K8S_CLUSTER_API_SERVER_IP:-"172.20.0.1"}
#cluster_dns_ip=${K8S_CLUSTER_DNS_IP:-"FD03::A"}
#cluster_api_server_ip=${K8S_CLUSTER_API_SERVER_IP:-"FD03::1"}

k8s_version="v1.20.1"
k8s_version="v1.21.0-rc.0"
etcd_version="v3.4.13"

function restore_flag {
Expand Down
25 changes: 12 additions & 13 deletions go.mod
Expand Up @@ -79,12 +79,12 @@ require (
github.com/vishvananda/netns v0.0.0-20201230012202-c4f3ca719c73
go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b
go.uber.org/goleak v1.1.10
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sys v0.0.0-20210217105451-b926d437f341
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
golang.org/x/tools v0.1.0
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506
google.golang.org/grpc v1.29.1
Expand All @@ -93,20 +93,19 @@ require (
gopkg.in/ini.v1 v1.62.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.4
k8s.io/apiextensions-apiserver v0.20.4
k8s.io/apimachinery v0.20.4
k8s.io/client-go v0.20.4
k8s.io/code-generator v0.20.4
k8s.io/klog/v2 v2.5.0
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
k8s.io/api v0.21.0-rc.0
k8s.io/apiextensions-apiserver v0.21.0-rc.0
k8s.io/apimachinery v0.21.0-rc.0
k8s.io/client-go v0.21.0-rc.0
k8s.io/code-generator v0.21.0-rc.0
k8s.io/klog/v2 v2.8.0
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
// We specify the controller-tools version here to be the version of the
// fork below, so that when we generate CRDs, the generated CRD contains
// version number of the tool. We want the version number to match up with
// the fork, even though this specific version doesn't exist in upstream
// controller-tools.
sigs.k8s.io/controller-tools v0.3.1-0.20200716001835-4a903ddb7005
sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect
sigs.k8s.io/yaml v1.2.0
)

Expand Down

0 comments on commit 382e7e4

Please sign in to comment.