[FixBug]fix 'Load kubernetes config failed' error #4234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
当dinky和k8s不部署在同一它机器并且kubeconfig通过页面上提交(不使用默认文件)时,提交k8s的任务会报错,具体错误如下:
Caused by: java.lang.RuntimeException: {"type":"org.apache.flink.kubernetes.operator.exception.ReconciliationException","message":"org.apache.flink.kubernetes.shaded.io.fabric8.kubernetes.client.KubernetesClientException: Load kubernetes config failed.","additionalMetadata":{},"throwableList":[{"type":"org.apache.flink.kubernetes.shaded.io.fabric8.kubernetes.client.KubernetesClientException","message":"Load kubernetes config failed.","additionalMetadata":{}},{"type":"java.nio.file.NoSuchFileException","message":"/opt/dinky/tmp/kubernetes/b9975abc-978a-4b80-a372-ae33575323fb/kubernetes.config.file.yaml","additionalMetadata":{}}]}
错误显示kubernetes.config.file.yaml文件不存在,但是这个文件在dinky的机器上存在的,而这个文件不存在的位置其实是在k8s的机器上
根本原因是: 在提交k8s任务时,传递了kubernetes.config.file这个配置,存在这个配置会导致k8s机器通过这个配置来查找本地的k8s配置文件,所以这个配置不应该传递,对应k8s的机器,应该使用k8s自己配置的文件