Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Removing deprecated Kubernetes APIs to support Kubernetes 1.16 #3409

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ maven_jar(
# end Pulsar Client

# Kubernetes java client
kubernetes_client_version = "1.0.0-beta1"
kubernetes_client_version = "3.0.0"
squareup_okhttp_version = "2.7.5"

maven_jar(
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/general/apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subjects:

---

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: heron-apiserver
Expand Down
12 changes: 10 additions & 2 deletions deploy/kubernetes/general/bookkeeper.statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ data:
BK_useHostNameAsBookieID: "true"
---

apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: bookie
labels:
app: bookkeeper
component: bookie
spec:
selector:
matchLabels:
app: bookkeeper
component: bookie
serviceName: "bookkeeper"
replicas: 3
template:
Expand Down Expand Up @@ -145,11 +149,15 @@ spec:
## Auto-Recovery makes sure to restore the replication factor when any bookie
## crashes and it's not recovering on its own.
##
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookie-autorecovery
spec:
selector:
matchLabels:
app: bookkeeper
component: bookkeeper-replication
replicas: 2
template:
metadata:
Expand Down
12 changes: 10 additions & 2 deletions deploy/kubernetes/general/bookkeeper.statefulset_empty.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ data:
BK_useHostNameAsBookieID: "true"
---

apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: bookie
labels:
app: bookkeeper
component: bookie
spec:
selector:
matchLabels:
app: bookkeeper
component: bookie
serviceName: "bookkeeper"
replicas: 3
template:
Expand Down Expand Up @@ -129,11 +133,15 @@ spec:
## Auto-Recovery makes sure to restore the replication factor when any bookie
## crashes and it's not recovering on its own.
##
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookie-autorecovery
spec:
selector:
matchLabels:
app: bookkeeper
component: bookkeeper-replication
replicas: 2
template:
metadata:
Expand Down
13 changes: 11 additions & 2 deletions deploy/kubernetes/general/bookkeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,19 @@ data:
## cannot be moved across different nodes.
## For this reason, we run BK as a daemon set, one for each node in the
## cluster, unless restricted by label selectors
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: bookie
labels:
app: bookkeeper
component: bookie
spec:
selector:
matchLabels:
app: bookkeeper
component: bookie
cluster: bookkeeper
template:
metadata:
labels:
Expand Down Expand Up @@ -130,11 +135,15 @@ spec:
## Auto-Recovery makes sure to restore the replication factor when any bookie
## crashes and it's not recovering on its own.
##
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookie-autorecovery
spec:
selector:
matchLabels:
app: bookkeeper
component: bookkeeper-replication
replicas: 2
template:
metadata:
Expand Down
19 changes: 18 additions & 1 deletion deploy/kubernetes/general/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
##
## Deployment Pod for tracker and ui
##
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: heron-tracker
namespace: default
spec:
selector:
matchLabels:
app: heron-tracker
template:
metadata:
labels:
Expand Down Expand Up @@ -57,6 +60,13 @@ spec:
--name=localzk
--hostport=zookeeper:2181
--rootpath="/heron"
resources:
requests:
cpu: "100m"
memory: "200M"
limits:
cpu: "200m"
memory: "300M"
- name: heron-ui
image: heron/heron:latest
ports:
Expand All @@ -68,6 +78,13 @@ spec:
heron-ui
--port=8889
--base_url=/api/v1/namespaces/default/services/heron-ui:8889/proxy
resources:
requests:
cpu: "100m"
memory: "200M"
limits:
cpu: "200m"
memory: "300M"
---

##
Expand Down
8 changes: 6 additions & 2 deletions deploy/kubernetes/general/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
---

## Define a StatefulSet for ZK servers
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: zk
Expand All @@ -43,6 +43,10 @@ metadata:
spec:
serviceName: zookeeper
replicas: 1
selector:
matchLabels:
app: heron
component: zookeeper
template:
metadata:
labels:
Expand All @@ -66,7 +70,7 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: zookeeper
image: heron/heron:0.16.2
image: heron/heron:latest
command: ["sh", "-c"]
args:
- >
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/gke/gcs-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subjects:

---

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: heron-apiserver
Expand Down
9 changes: 7 additions & 2 deletions deploy/kubernetes/helm/templates/bookie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ data:
## For this reason, we run BK as a daemon set, one for each node in the
## cluster, unless restricted by label selectors
{{- if or (eq .Values.platform "gke") (eq .Values.platform "minikube") }}
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
{{- else }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
{{- end }}

Expand All @@ -70,6 +70,11 @@ metadata:
app: {{ .Release.Name }}-bookkeeper
component: {{ .Release.Name }}-bookie
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-bookkeeper
component: {{ .Release.Name }}-bookie
cluster: {{ .Release.Name }}-bookkeeper
{{- if or (eq .Values.platform "gke") (eq .Values.platform "minikube") }}
serviceName: {{ .Release.Name }}-bookie
replicas: {{ $bookieReplicas }}
Expand Down
6 changes: 5 additions & 1 deletion deploy/kubernetes/helm/templates/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data:
HERON_APISERVER_MEM_MAX: {{ $apiServerMemory | quote }}
---

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-tools
Expand All @@ -38,6 +38,10 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-tools
release: {{ .Release.Name }}
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/minikube/apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ subjects:

---

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: heron-apiserver
Expand Down
7 changes: 6 additions & 1 deletion deploy/kubernetes/minikube/bookkeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,19 @@ data:
## cannot be moved across different nodes.
## For this reason, we run BK as a daemon set, one for each node in the
## cluster, unless restricted by label selectors
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: bookie
labels:
app: bookkeeper
component: bookie
spec:
selector:
matchLabels:
app: bookkeeper
component: bookie
cluster: bookkeeper
template:
metadata:
labels:
Expand Down
19 changes: 18 additions & 1 deletion deploy/kubernetes/minikube/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
##
## Deployment Pod for tracker and ui
##
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: heron-tracker
namespace: default
spec:
selector:
matchLabels:
app: heron-tracker
template:
metadata:
labels:
Expand All @@ -43,6 +46,13 @@ spec:
--name=kubernetes
--hostport=zookeeper:2181
--rootpath="/heron"
resources:
requests:
cpu: "100m"
memory: "200M"
limits:
cpu: "200m"
memory: "300M"
- name: heron-ui
image: heron/heron:latest
ports:
Expand All @@ -54,6 +64,13 @@ spec:
heron-ui
--port=8889
--base_url=/api/v1/namespaces/default/services/heron-ui:8889/proxy
resources:
requests:
cpu: "100m"
memory: "200M"
limits:
cpu: "200m"
memory: "300M"
---

##
Expand Down
20 changes: 19 additions & 1 deletion deploy/kubernetes/minikube/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##

## Define a StatefulSet for ZK servers
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: zk
Expand All @@ -30,13 +30,31 @@ metadata:
spec:
serviceName: zookeeper
replicas: 1
selector:
matchLabels:
app: heron
component: zookeeper
template:
metadata:
labels:
app: heron
component: zookeeper

spec:
# Make sure multiple pods of ZK don't get scheduled on the
# same node, unless there are no other available nodes
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- zookeeper
topologyKey: "kubernetes.io/hostname"
containers:
- name: zookeeper
image: heron/heron:latest
Expand Down
Loading