Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for additional libraries #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Deploy a non-HA Flink cluster with three taskmanagers:

$ helm install --name my-cluster --set flink.num_taskmanagers=3 flink*.tgz

Install additional (optional) libraries from the flink distribution (you can only reference libraries from `$FLINK_BASEDIR/opt` here):

$ helm install --name my-cluster --set flink.additional_libs="{flink-metrics-prometheus-1.4.0.jar,flink-metrics-dropwizard-1.4.0.jar}" flink*.tgz

Deploy an HA Flink cluster with three taskmanagers:

$ cat > values.yaml <<EOF
Expand Down
14 changes: 14 additions & 0 deletions helm/flink/templates/deployment-jobmanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ spec:
app: {{ template "fullname" . }}
component: jobmanager
spec:
initContainers:
- name: flink-copy-libs
image: {{ .Values.image }}:{{ .Values.imageTag }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The init container should probably also respect imagePullPolicy. (also in deployment-taskmanager.yaml)

command:
- sh
- -c
- cp /opt/flink/lib/* {{ range .Values.flink.additional_libs}}/opt/flink/opt/{{ . }} {{ end }} /flink-lib;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor style: space after additional_libs (also in deployment-taskmanager.yaml)

volumeMounts:
- name: flink-lib
mountPath: /flink-lib
containers:
- name: jobmanager
image: {{ .Values.image }}:{{ .Values.imageTag }}
Expand Down Expand Up @@ -38,10 +48,14 @@ spec:
mountPath: /etc/flink
- name: {{ template "fullname" . }}-hadoop-config
mountPath: /etc/hadoop/conf
- name: flink-lib
mountPath: /opt/flink/lib
volumes:
- name: {{ template "fullname" . }}-flink-config
configMap:
name: {{ template "fullname" . }}-flink-config
- name: {{ template "fullname" . }}-hadoop-config
configMap:
name: {{ template "fullname" . }}-hadoop-config
- name: flink-lib
emptyDir: {}
14 changes: 14 additions & 0 deletions helm/flink/templates/deployment-taskmanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ spec:
app: {{ template "fullname" . }}
component: taskmanager
spec:
initContainers:
- name: flink-copy-libs
image: {{ .Values.image }}:{{ .Values.imageTag }}
command:
- sh
- -c
- cp /opt/flink/lib/* {{ range .Values.flink.additional_libs}}/opt/flink/opt/{{ . }} {{ end }} /flink-lib;
volumeMounts:
- name: flink-lib
mountPath: /flink-lib
containers:
- name: taskmanager
image: {{ .Values.image }}:{{ .Values.imageTag }}
Expand Down Expand Up @@ -38,10 +48,14 @@ spec:
mountPath: /etc/flink
- name: {{ template "fullname" . }}-hadoop-config
mountPath: /etc/hadoop/conf
- name: flink-lib
mountPath: /opt/flink/lib
volumes:
- name: {{ template "fullname" . }}-flink-config
configMap:
name: {{ template "fullname" . }}-flink-config
- name: {{ template "fullname" . }}-hadoop-config
configMap:
name: {{ template "fullname" . }}-hadoop-config
- name: flink-lib
emptyDir: {}