kubernetes-taskmanager.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. ################################################################################
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. ################################################################################
  19. # Start a Flink TaskManager for native Kubernetes.
  20. # NOTE: This script is not meant to be started manually. It will be used by native Kubernetes integration.
  21. USAGE="Usage: kubernetes-taskmanager.sh [args]"
  22. ENTRYPOINT=kubernetes-taskmanager
  23. ARGS=("${@:1}")
  24. bin=`dirname "$0"`
  25. bin=`cd "$bin"; pwd`
  26. . "$bin"/config.sh
  27. # if no other JVM options are set, set the GC to G1
  28. if [ -z "${FLINK_ENV_JAVA_OPTS}" ] && [ -z "${FLINK_ENV_JAVA_OPTS_TM}" ]; then
  29. export JVM_ARGS="$JVM_ARGS -XX:+UseG1GC"
  30. fi
  31. # Add TaskManager specific JVM options
  32. export FLINK_ENV_JAVA_OPTS="${FLINK_ENV_JAVA_OPTS} ${FLINK_ENV_JAVA_OPTS_TM}"
  33. export JVM_ARGS="$JVM_ARGS $FLINK_TM_JVM_MEM_OPTS"
  34. ARGS=("--configDir" "${FLINK_CONF_DIR}" "${ARGS[@]}")
  35. exec "${FLINK_BIN_DIR}"/flink-console.sh $ENTRYPOINT "${ARGS[@]}"