runtime-parameters.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. jobmanager:
  2. containerPorts:
  3. rpc: 6555
  4. http: 8078
  5. blob: 9191
  6. service:
  7. type: LoadBalancer
  8. ports:
  9. rpc: 6557
  10. http: 80
  11. # Must be equal to the containerPort.blob. More info in the values documentation.
  12. blob: 9191
  13. podSecurityContext:
  14. fsGroup: 1002
  15. containerSecurityContext:
  16. runAsUser: 1002
  17. taskmanager:
  18. service:
  19. ports:
  20. rpc: 14272
  21. extraDeploy:
  22. - |
  23. apiVersion: batch/v1
  24. kind: Job
  25. metadata:
  26. name: flink-job-runner
  27. spec:
  28. template:
  29. spec:
  30. restartPolicy: OnFailure
  31. containers:
  32. - name: job-runner
  33. image: docker.io/bitnami/flink:latest
  34. command:
  35. - /bin/bash
  36. args:
  37. - -ec
  38. - |
  39. #!/bin/bash
  40. set -o errexit
  41. set -o nounset
  42. set -o pipefail
  43. . /opt/bitnami/scripts/libos.sh
  44. # Set the endpoint URL
  45. host=flink-jobmanager
  46. port={{ .Values.jobmanager.service.ports.rpc }}
  47. jobmanager_ready() {
  48. # Test the TCP connection with a timeout
  49. if timeout 5 bash -c "</dev/tcp/$host/$port"; then
  50. return 0
  51. else
  52. return 1
  53. fi
  54. }
  55. echo "0" > /tmp/ready
  56. info "Waiting for the Jobmanager instance"
  57. if ! retry_while "jobmanager_ready" 12 30; then
  58. error "Could not connect to the Jobmanager instance"
  59. exit 1
  60. else
  61. info "Jobmanager ready! Running job in 10 seconds"
  62. sleep 10
  63. while true
  64. do
  65. ./bin/flink run ./examples/batch/EnumTriangles.jar --jobmanager $host:$port -Drest.port={{ .Values.jobmanager.service.ports.http }}
  66. echo "1" > /tmp/ready
  67. # Adding a sleep to not overload the deployment
  68. sleep 10
  69. done
  70. fi
  71. startupProbe:
  72. exec:
  73. command:
  74. - sh
  75. - -c
  76. - |
  77. if [ $(cat /tmp/ready) = "1" ]; then
  78. exit 0
  79. else
  80. exit 1
  81. fi
  82. initialDelaySeconds: 40
  83. periodSeconds: 20
  84. timeoutSeconds: 1
  85. failureThreshold: 15
  86. successThreshold: 1
  87. securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.jobmanager.containerSecurityContext "context" $) | nindent 12 }}
  88. volumeMounts:
  89. - name: flink-config-volume
  90. mountPath: /opt/bitnami/flink/conf
  91. - name: tmp
  92. mountPath: /tmp
  93. volumes:
  94. - name: flink-config-volume
  95. configMap:
  96. name: flink-job-config
  97. items:
  98. - key: config.yaml
  99. path: config.yaml
  100. - name: tmp
  101. emptyDir: {}
  102. - |
  103. apiVersion: v1
  104. kind: ConfigMap
  105. metadata:
  106. name: flink-job-config
  107. data:
  108. config.yaml: |+
  109. jobmanager.rpc.address: flink-jobmanager
  110. jobmanager.rpc.port: {{ .Values.jobmanager.service.ports.rpc }}
  111. rest.address: flink-jobmanager
  112. rest.bind-address: 0.0.0.0
  113. blob.server.port: {{ .Values.jobmanager.service.ports.blob }}
  114. rest.port: {{ .Values.jobmanager.service.ports.http }}