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

Commit

Permalink
Updated to support Kubernetes 1.16 (#3426)
Browse files Browse the repository at this point in the history
* Updating to fix deprecated Kubernetes APIs

* Removing the old controller logic

* Formatting cleanup

* Trying to use latest k8s java client

* Updated to use the latest K8s client

* Updated tools k8s limits

* Fix for missing statefulset selector in Helm chart

* Updated to K8s client 7.0.0

* Code cleanup

* Updated gson and added gson-fire dependencies

* Updates to better handle k8s resource delete
  • Loading branch information
nicknezis authored and joshfischer1108 committed Jan 10, 2020
1 parent 2f0c1db commit e51f265
Show file tree
Hide file tree
Showing 22 changed files with 229 additions and 136 deletions.
18 changes: 9 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ maven_jar(
# end Pulsar Client

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

maven_jar(
name = "kubernetes_java_client",
Expand All @@ -557,25 +557,25 @@ maven_jar(

maven_jar(
name = "squareup_okhttp",
artifact = "com.squareup.okhttp:okhttp:" + squareup_okhttp_version
artifact = "com.squareup.okhttp3:okhttp:" + squareup_okhttp_version
)
maven_jar(
name = "squareup_okio",
artifact = "com.squareup.okio:okio:1.6.0"
artifact = "com.squareup.okio:okio:1.17.2"
)
maven_jar(
name = "squareup_okhttp_logging_interceptor",
artifact = "com.squareup.okhttp:logging-interceptor:" + squareup_okhttp_version
artifact = "com.squareup.okhttp3:logging-interceptor:" + squareup_okhttp_version
)

maven_jar(
name = "squareup_okhttp_ws",
artifact = "com.squareup.okhttp:okhttp-ws:" + squareup_okhttp_version
name = "google_gson",
artifact = "com.google.code.gson:gson:2.8.0"
)

maven_jar(
name = "google_gson",
artifact = "com.google.code.gson:gson:2.6.2"
name = "io_gsonfire",
artifact = "io.gsonfire:gson-fire:1.8.3"
)

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: "400m"
memory: "512M"
- 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: "400m"
memory: "512M"
---

##
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
14 changes: 9 additions & 5 deletions 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 Expand Up @@ -80,8 +84,8 @@ spec:
cpu: "100m"
memory: "200M"
limits:
cpu: "200m"
memory: "300M"
cpu: "400m"
memory: "512M"
ports:
- containerPort: 8888
name: api-port
Expand All @@ -101,8 +105,8 @@ spec:
cpu: "100m"
memory: "200M"
limits:
cpu: "200m"
memory: "300M"
cpu: "400m"
memory: "512M"
ports:
- containerPort: 8889
name: app-port
Expand Down
8 changes: 5 additions & 3 deletions deploy/kubernetes/helm/templates/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ spec:
{{- end }}

---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-zookeeper
labels:
app: {{ .Release.Name }}-zookeeper
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-zookeeper
release: {{ .Release.Name | quote }}
serviceName: {{ .Release.Name }}-zookeeper-headless
replicas: {{ $zkReplicas }}
template:
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
Loading

0 comments on commit e51f265

Please sign in to comment.