Skip to content

Commit

Permalink
Add support for k8s 1.16
Browse files Browse the repository at this point in the history
Fixes #3356

1.16 removes some api groups that were already deprecated. From k8s blog
post (https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/):

```
- PodSecurityPolicy: will no longer be served from extensions/v1beta1 in
v1.16.
    Migrate to the policy/v1beta1 API, available since v1.10. Existing
    persisted data can be retrieved/updated via the policy/v1beta1 API.
- DaemonSet, Deployment, StatefulSet, and ReplicaSet: will no longer be
served from extensions/v1beta1, apps/v1beta1, or apps/v1beta2 in v1.16.
    Migrate to the apps/v1 API, available since v1.9. Existing persisted
    data can be retrieved/updated via the apps/v1 API.
```

Previous PRs had already made this change at the Helm templates level,
but we still needed to do it at the API calls and tests.

The integration tests ran fine for k8s 1.12 and 1.15. They fail on 1.16
because the upgrade integration test tries to install linkerd 2.5 which is not
compatible with 1.16.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
  • Loading branch information
alpeb committed Sep 3, 2019
1 parent e281fb3 commit 5d09984
Show file tree
Hide file tree
Showing 57 changed files with 149 additions and 150 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_contour.input.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
8 changes: 4 additions & 4 deletions cli/cmd/testdata/inject_emojivoto_already_injected.golden.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -163,7 +163,7 @@ spec:
name: linkerd-identity-end-entity
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -328,7 +328,7 @@ spec:
name: linkerd-identity-end-entity
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -493,7 +493,7 @@ spec:
name: linkerd-identity-end-entity
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
8 changes: 4 additions & 4 deletions cli/cmd/testdata/inject_emojivoto_already_injected.input.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -37,7 +37,7 @@ spec:
name: linkerd-proxy
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -74,7 +74,7 @@ spec:
- name: linkerd-proxy
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -113,7 +113,7 @@ spec:
name: linkerd-init
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_deployment.golden.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_deployment.input.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -163,7 +163,7 @@ spec:
name: linkerd-identity-end-entity
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -34,7 +34,7 @@ spec:
resources: {}
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_deployment_udp.input.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_istio.input.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_list.golden.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
items:
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -164,7 +164,7 @@ items:
medium: Memory
name: linkerd-identity-end-entity
status: {}
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_list.input.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
items:
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -35,7 +35,7 @@ items:
name: http
resources: {}
status: {}
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
items:
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -164,7 +164,7 @@ items:
medium: Memory
name: linkerd-identity-end-entity
status: {}
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v1
items:
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -36,7 +36,7 @@ items:
name: http
resources: {}
status: {}
- apiVersion: apps/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/testdata/inject_gettest_deployment.bad.input.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
spec:
template:
Expand All @@ -19,7 +19,7 @@ spec:
ports:
- containerPort: 9090
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: get-test-deploy-injected-2
Expand Down
6 changes: 4 additions & 2 deletions cli/cmd/testdata/inject_gettest_deployment.good.golden.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
name: get-test-deploy-injected-1
spec:
selector: null
strategy: {}
template:
metadata:
Expand Down Expand Up @@ -165,12 +166,13 @@ spec:
name: linkerd-identity-end-entity
status: {}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
name: get-test-deploy-injected-2
spec:
selector: null
strategy: {}
template:
metadata:
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/testdata/inject_gettest_deployment.good.input.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: get-test-deploy-injected-1
Expand All @@ -21,7 +21,7 @@ spec:
ports:
- containerPort: 9090
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: get-test-deploy-injected-2
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/testdata/install-cni-plugin_default.golden
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ data:
# This manifest installs the linkerd CNI plugins and network config on
# each master and worker node in a Kubernetes cluster.
kind: DaemonSet
apiVersion: extensions/v1beta1
apiVersion: apps/v1
metadata:
name: linkerd-cni
namespace: linkerd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ data:
# This manifest installs the linkerd CNI plugins and network config on
# each master and worker node in a Kubernetes cluster.
kind: DaemonSet
apiVersion: extensions/v1beta1
apiVersion: apps/v1
metadata:
name: linkerd-cni
namespace: other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ data:
# This manifest installs the linkerd CNI plugins and network config on
# each master and worker node in a Kubernetes cluster.
kind: DaemonSet
apiVersion: extensions/v1beta1
apiVersion: apps/v1
metadata:
name: linkerd-cni
namespace: other
Expand Down
2 changes: 1 addition & 1 deletion cli/install/cni-template.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ data:
# This manifest installs the linkerd CNI plugins and network config on
# each master and worker node in a Kubernetes cluster.
kind: DaemonSet
apiVersion: extensions/v1beta1
apiVersion: apps/v1
metadata:
name: linkerd-cni
namespace: {{.Namespace}}
Expand Down
Loading

0 comments on commit 5d09984

Please sign in to comment.