You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/08/27 02:40:17 UTC

[GitHub] [flink] KarmaGYZ opened a new pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

KarmaGYZ opened a new pull request #13255:
URL: https://github.com/apache/flink/pull/13255


   …as Secrete
   
   
   ## What is the purpose of the change
   
   Support to mount kerberos conf as ConfigMap and Keytab as Secrete
   
   
   ## Brief change log
   
   - Add "kubernetes.kerberos.krb5-conf.path" Config option, which specify the local location of the krb5.conf file to be mounted on the JobManager and TaskManager for Kerberos.
   - Introduce KerberosMountDecorator
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Existing UTs and IT cases.
   - KerberosMountDecoratorTest
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented? docs
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] xintongsong commented on a change in pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
xintongsong commented on a change in pull request #13255:
URL: https://github.com/apache/flink/pull/13255#discussion_r503740996



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/KerberosMountDecorator.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.kubeclient.decorators;
+
+import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
+import org.apache.flink.kubernetes.kubeclient.FlinkPod;
+import org.apache.flink.kubernetes.kubeclient.parameters.AbstractKubernetesParameters;
+import org.apache.flink.kubernetes.utils.Constants;
+import org.apache.flink.runtime.security.SecurityConfiguration;
+import org.apache.flink.util.StringUtils;
+
+import org.apache.flink.shaded.guava18.com.google.common.io.Files;
+
+import io.fabric8.kubernetes.api.model.ConfigMapBuilder;
+import io.fabric8.kubernetes.api.model.ContainerBuilder;
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.api.model.KeyToPathBuilder;
+import io.fabric8.kubernetes.api.model.PodBuilder;
+import io.fabric8.kubernetes.api.model.SecretBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * Mount the custom Kerberos Configuration and Credential to the JobManager(s)/TaskManagers.
+ */
+public class KerberosMountDecorator extends AbstractKubernetesStepDecorator {
+	private static final Logger LOG = LoggerFactory.getLogger(KerberosMountDecorator.class);
+
+	private final AbstractKubernetesParameters kubernetesParameters;
+	private final SecurityConfiguration securityConfig;
+
+	public KerberosMountDecorator(AbstractKubernetesParameters kubernetesParameters) {
+		this.kubernetesParameters = checkNotNull(kubernetesParameters);
+		this.securityConfig = new SecurityConfiguration(kubernetesParameters.getFlinkConfiguration());
+	}
+
+	@Override
+	public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
+		PodBuilder podBuilder = new PodBuilder(flinkPod.getPod());
+		ContainerBuilder containerBuilder = new ContainerBuilder(flinkPod.getMainContainer());
+
+		if (!StringUtils.isNullOrWhitespaceOnly(securityConfig.getKeytab()) && !StringUtils.isNullOrWhitespaceOnly(securityConfig.getPrincipal())) {
+			final File keytab = new File(securityConfig.getKeytab());
+			podBuilder = podBuilder
+				.editOrNewSpec()
+					.addNewVolume()
+						.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+						.withNewSecret()
+							.withSecretName(getKerberosKeytabSecretName(kubernetesParameters.getClusterId()))
+							.endSecret()
+					.endVolume()
+				.endSpec();
+
+			containerBuilder = containerBuilder
+				.addNewVolumeMount()
+					.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+					.withMountPath(Constants.KERBEROS_KEYTAB_MOUNT_POINT)
+				.endVolumeMount()
+				.addNewEnv()
+					.withName(Constants.ENV_KERBEROS_KEYTAB_PATH)
+					.withValue(String.format("%s/%s", Constants.KERBEROS_KEYTAB_MOUNT_POINT, keytab.getName()))

Review comment:
       Instead of decorating the keytab path as an environment variable, I think we can write it to the configuration directly.
   See `InternalServiceDecorator#buildAccompanyingKubernetesResources` for an example.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * 0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "",
       "status" : "CANCELED",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   *  Unknown: [CANCELED](TBD) 
   * 0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KarmaGYZ commented on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
KarmaGYZ commented on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-712541465


   @xintongsong Thanks for the review. Comments addressed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KarmaGYZ commented on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
KarmaGYZ commented on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-711796852


   @flinkbot run azure


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d314aaa9e779d3177e50a91edbfe07baa64691dc Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] xintongsong closed pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
xintongsong closed pull request #13255:
URL: https://github.com/apache/flink/pull/13255


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84207192f4434ad4f6f16dadb0a3df227c2bc628",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7999",
       "triggerID" : "84207192f4434ad4f6f16dadb0a3df227c2bc628",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844) 
   * 84207192f4434ad4f6f16dadb0a3df227c2bc628 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7999) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d314aaa9e779d3177e50a91edbfe07baa64691dc Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "CANCELED",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   *  Unknown: [CANCELED](TBD) 
   * 0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681309844


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit d314aaa9e779d3177e50a91edbfe07baa64691dc (Thu Aug 27 02:42:32 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84207192f4434ad4f6f16dadb0a3df227c2bc628",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "84207192f4434ad4f6f16dadb0a3df227c2bc628",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844) 
   * 84207192f4434ad4f6f16dadb0a3df227c2bc628 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5905",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7844",
       "triggerID" : "0ccd6a8eb72ebeadd49913d6afbc0d35e913f9e5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "711796852",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84207192f4434ad4f6f16dadb0a3df227c2bc628",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7999",
       "triggerID" : "84207192f4434ad4f6f16dadb0a3df227c2bc628",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 84207192f4434ad4f6f16dadb0a3df227c2bc628 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7999) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13255:
URL: https://github.com/apache/flink/pull/13255#issuecomment-681311805


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d314aaa9e779d3177e50a91edbfe07baa64691dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d314aaa9e779d3177e50a91edbfe07baa64691dc UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] xintongsong commented on a change in pull request #13255: [FLINK-18971] Support to mount kerberos conf as ConfigMap and Keytab …

Posted by GitBox <gi...@apache.org>.
xintongsong commented on a change in pull request #13255:
URL: https://github.com/apache/flink/pull/13255#discussion_r491805839



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
##########
@@ -220,6 +220,13 @@
 			.withDescription("The user-specified annotations that are set to the rest Service. The value should be " +
 				"in the form of a1:v1,a2:v2");
 
+	public static final ConfigOption<String> KERBEROS_KRB5_PATH =
+		key("kubernetes.kerberos.krb5-conf.path")
+			.stringType()
+			.noDefaultValue()
+			.withDescription("Specify the local location of the krb5.conf file to be mounted on the JobManager and " +
+				"TaskManager for Kerberos. Note: The KDC defined needs to be visible from inside the containers.");

Review comment:
       Why is this configuration option only needed for the Kubernetes deployment? My gut feeling is that this should be a common feature for all the deployments. Why does the Kubernetes deployment needs a configuration option that other deployments don't need?

##########
File path: flink-kubernetes/src/test/java/org/apache/flink/kubernetes/kubeclient/decorators/KerberosMountDecoratorTest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.kubeclient.decorators;
+
+import org.apache.flink.configuration.SecurityOptions;
+import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
+import org.apache.flink.kubernetes.kubeclient.FlinkPod;
+import org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase;
+import org.apache.flink.kubernetes.utils.Constants;
+
+import io.fabric8.kubernetes.api.model.ConfigMap;
+import io.fabric8.kubernetes.api.model.Container;
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.api.model.KeyToPathBuilder;
+import io.fabric8.kubernetes.api.model.Volume;
+import io.fabric8.kubernetes.api.model.VolumeBuilder;
+import io.fabric8.kubernetes.api.model.VolumeMount;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+/**
+ * General tests for the {@link KerberosMountDecoratorTest}.
+ */
+public class KerberosMountDecoratorTest extends KubernetesJobManagerTestBase {

Review comment:
       Why is this class extends `KubernetesJobManagerTestBase`? It seems this test class can extends either `KubernetesJobManagerTestBase` or `KubernetesTaskManagerTestBase`, but cannot extends `KubernetesTestBase`. I think this is an indicator of bad abstraction. We may have another common base class for jobmanager/taskmanager test bases.

##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/KerberosMountDecorator.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.kubeclient.decorators;
+
+import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
+import org.apache.flink.kubernetes.kubeclient.FlinkPod;
+import org.apache.flink.kubernetes.kubeclient.parameters.AbstractKubernetesParameters;
+import org.apache.flink.kubernetes.utils.Constants;
+import org.apache.flink.runtime.security.SecurityConfiguration;
+import org.apache.flink.util.StringUtils;
+
+import org.apache.flink.shaded.guava18.com.google.common.io.Files;
+
+import io.fabric8.kubernetes.api.model.ConfigMapBuilder;
+import io.fabric8.kubernetes.api.model.ContainerBuilder;
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.api.model.KeyToPathBuilder;
+import io.fabric8.kubernetes.api.model.PodBuilder;
+import io.fabric8.kubernetes.api.model.SecretBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * Mount the custom Kerberos Configuration and Credential to the JobManager(s)/TaskManagers.
+ */
+public class KerberosMountDecorator extends AbstractKubernetesStepDecorator {
+	private static final Logger LOG = LoggerFactory.getLogger(KerberosMountDecorator.class);
+
+	private final AbstractKubernetesParameters kubernetesParameters;
+	private final SecurityConfiguration securityConfig;
+
+	public KerberosMountDecorator(AbstractKubernetesParameters kubernetesParameters) {
+		this.kubernetesParameters = checkNotNull(kubernetesParameters);
+		this.securityConfig = new SecurityConfiguration(kubernetesParameters.getFlinkConfiguration());
+	}
+
+	@Override
+	public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
+		PodBuilder podBuilder = new PodBuilder(flinkPod.getPod());
+		ContainerBuilder containerBuilder = new ContainerBuilder(flinkPod.getMainContainer());
+
+		if (!StringUtils.isNullOrWhitespaceOnly(securityConfig.getKeytab()) && !StringUtils.isNullOrWhitespaceOnly(securityConfig.getPrincipal())) {
+			final File keytab = new File(securityConfig.getKeytab());
+			podBuilder = podBuilder
+				.editOrNewSpec()
+					.addNewVolume()
+						.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+						.withNewSecret()
+							.withSecretName(getKerberosKeytabSecretName(kubernetesParameters.getClusterId()))
+							.endSecret()
+					.endVolume()
+				.endSpec();
+
+			containerBuilder = containerBuilder
+				.addNewVolumeMount()
+					.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+					.withMountPath(Constants.KERBEROS_KEYTAB_MOUNT_POINT)
+				.endVolumeMount()
+				.addNewEnv()
+					.withName(Constants.ENV_KERBEROS_KEYTAB_PATH)
+					.withValue(String.format("%s/%s", Constants.KERBEROS_KEYTAB_MOUNT_POINT, keytab.getName()))
+				.endEnv();
+		}
+
+		if (!StringUtils.isNullOrWhitespaceOnly(kubernetesParameters.getFlinkConfiguration().get(KubernetesConfigOptions.KERBEROS_KRB5_PATH))) {
+			final File krb5Conf = new File(kubernetesParameters.getFlinkConfiguration().get(KubernetesConfigOptions.KERBEROS_KRB5_PATH));
+			podBuilder = podBuilder
+				.editOrNewSpec()
+				.addNewVolume()
+					.withName(Constants.KERBEROS_KRB5CONF_VOLUME)
+					.withNewConfigMap()
+					.withName(getKerberosKrb5confConfigMapName(kubernetesParameters.getClusterId()))
+					.withItems(new KeyToPathBuilder()
+						.withKey(krb5Conf.getName())
+						.withPath(krb5Conf.getName())
+						.build())
+					.endConfigMap()

Review comment:
       minor: indention

##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/KerberosMountDecorator.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.kubeclient.decorators;
+
+import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
+import org.apache.flink.kubernetes.kubeclient.FlinkPod;
+import org.apache.flink.kubernetes.kubeclient.parameters.AbstractKubernetesParameters;
+import org.apache.flink.kubernetes.utils.Constants;
+import org.apache.flink.runtime.security.SecurityConfiguration;
+import org.apache.flink.util.StringUtils;
+
+import org.apache.flink.shaded.guava18.com.google.common.io.Files;
+
+import io.fabric8.kubernetes.api.model.ConfigMapBuilder;
+import io.fabric8.kubernetes.api.model.ContainerBuilder;
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.api.model.KeyToPathBuilder;
+import io.fabric8.kubernetes.api.model.PodBuilder;
+import io.fabric8.kubernetes.api.model.SecretBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/**
+ * Mount the custom Kerberos Configuration and Credential to the JobManager(s)/TaskManagers.
+ */
+public class KerberosMountDecorator extends AbstractKubernetesStepDecorator {
+	private static final Logger LOG = LoggerFactory.getLogger(KerberosMountDecorator.class);
+
+	private final AbstractKubernetesParameters kubernetesParameters;
+	private final SecurityConfiguration securityConfig;
+
+	public KerberosMountDecorator(AbstractKubernetesParameters kubernetesParameters) {
+		this.kubernetesParameters = checkNotNull(kubernetesParameters);
+		this.securityConfig = new SecurityConfiguration(kubernetesParameters.getFlinkConfiguration());
+	}
+
+	@Override
+	public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
+		PodBuilder podBuilder = new PodBuilder(flinkPod.getPod());
+		ContainerBuilder containerBuilder = new ContainerBuilder(flinkPod.getMainContainer());
+
+		if (!StringUtils.isNullOrWhitespaceOnly(securityConfig.getKeytab()) && !StringUtils.isNullOrWhitespaceOnly(securityConfig.getPrincipal())) {
+			final File keytab = new File(securityConfig.getKeytab());
+			podBuilder = podBuilder
+				.editOrNewSpec()
+					.addNewVolume()
+						.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+						.withNewSecret()
+							.withSecretName(getKerberosKeytabSecretName(kubernetesParameters.getClusterId()))
+							.endSecret()
+					.endVolume()
+				.endSpec();
+
+			containerBuilder = containerBuilder
+				.addNewVolumeMount()
+					.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+					.withMountPath(Constants.KERBEROS_KEYTAB_MOUNT_POINT)
+				.endVolumeMount()
+				.addNewEnv()
+					.withName(Constants.ENV_KERBEROS_KEYTAB_PATH)
+					.withValue(String.format("%s/%s", Constants.KERBEROS_KEYTAB_MOUNT_POINT, keytab.getName()))

Review comment:
       Instead of decorating the keytab path as an environment variable, I think we can write it to the configuration directly.
   See `FlinkConfMountDecorator#buildAccompanyingKubernetesResources` for an example.

##########
File path: flink-kubernetes/src/test/java/org/apache/flink/kubernetes/kubeclient/decorators/KerberosMountDecoratorTest.java
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.kubeclient.decorators;
+
+import org.apache.flink.configuration.SecurityOptions;
+import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
+import org.apache.flink.kubernetes.kubeclient.FlinkPod;
+import org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase;
+import org.apache.flink.kubernetes.utils.Constants;
+
+import io.fabric8.kubernetes.api.model.ConfigMap;
+import io.fabric8.kubernetes.api.model.Container;
+import io.fabric8.kubernetes.api.model.HasMetadata;
+import io.fabric8.kubernetes.api.model.KeyToPathBuilder;
+import io.fabric8.kubernetes.api.model.Volume;
+import io.fabric8.kubernetes.api.model.VolumeBuilder;
+import io.fabric8.kubernetes.api.model.VolumeMount;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+/**
+ * General tests for the {@link KerberosMountDecoratorTest}.
+ */
+public class KerberosMountDecoratorTest extends KubernetesJobManagerTestBase {
+
+	private KerberosMountDecorator kerberosMountDecorator;
+
+	@Override
+	protected void setupFlinkConfig() {
+		super.setupFlinkConfig();
+
+		flinkConfig.set(SecurityOptions.KERBEROS_LOGIN_KEYTAB, kerberosDir.toString() + "/" + KEYTAB_FILE);
+		flinkConfig.set(SecurityOptions.KERBEROS_LOGIN_PRINCIPAL, "test");
+		flinkConfig.set(KubernetesConfigOptions.KERBEROS_KRB5_PATH, kerberosDir.toString() + "/" + KRB5_CONF_FILE);
+	}
+
+	@Override
+	protected void onSetup() throws Exception {
+		super.onSetup();
+
+		generateKerberosFileItems();
+
+		this.kerberosMountDecorator = new KerberosMountDecorator(kubernetesJobManagerParameters);
+	}
+
+	@Test
+	public void testWhetherPodOrContainerIsDecorated() {
+		final FlinkPod resultFlinkPod = kerberosMountDecorator.decorateFlinkPod(baseFlinkPod);
+		assertNotEquals(baseFlinkPod.getPod(), resultFlinkPod.getPod());
+		assertNotEquals(baseFlinkPod.getMainContainer(), resultFlinkPod.getMainContainer());
+	}
+
+	@Test
+	public void testConfigMap() throws IOException {
+		final List<HasMetadata> additionalResources = kerberosMountDecorator.buildAccompanyingKubernetesResources();
+		assertEquals(2, additionalResources.size());
+
+		final ConfigMap resultConfigMap = (ConfigMap) additionalResources
+			.stream()
+			.filter(x -> x instanceof ConfigMap)
+			.collect(Collectors.toList()).get(0);
+
+		assertEquals(Constants.API_VERSION, resultConfigMap.getApiVersion());
+
+		assertEquals(KerberosMountDecorator.getKerberosKrb5confConfigMapName(CLUSTER_ID),
+			resultConfigMap.getMetadata().getName());
+
+		Map<String, String> resultDatas = resultConfigMap.getData();
+		assertThat(resultDatas.size(), is(1));
+		assertEquals("some conf", resultDatas.get(KRB5_CONF_FILE));
+	}
+
+	@Test
+	public void testDecoratedFlinkPod() {
+		final FlinkPod resultFlinkPod = kerberosMountDecorator.decorateFlinkPod(baseFlinkPod);
+		assertEquals(2, resultFlinkPod.getPod().getSpec().getVolumes().size());
+
+		final List<Volume> expectedVolumes = Arrays.asList(
+			new VolumeBuilder()
+				.withName(Constants.KERBEROS_KEYTAB_VOLUME)
+				.withNewSecret()
+				.withSecretName(KerberosMountDecorator.getKerberosKeytabSecretName(CLUSTER_ID))
+				.endSecret()
+				.build(),
+			new VolumeBuilder()
+				.withName(Constants.KERBEROS_KRB5CONF_VOLUME)
+				.withNewConfigMap()
+				.withName(KerberosMountDecorator.getKerberosKrb5confConfigMapName(CLUSTER_ID))
+				.withItems(new KeyToPathBuilder()
+					.withKey(KRB5_CONF_FILE)
+					.withPath(KRB5_CONF_FILE)
+					.build())
+				.endConfigMap()
+				.build());
+		assertEquals(expectedVolumes, resultFlinkPod.getPod().getSpec().getVolumes());
+	}

Review comment:
       I think this test case is not needed. It is already covered by `testDecoratedFlinkContainer`. Despite it is required to mount the volumes on the pods before mounting them on the containers, from the contract we only cares about accessing the resources in container.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org