diff --git a/CHANGELOG.md b/CHANGELOG.md index 86dec72cbf..4e5336e9e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Changed Reconciliation interval for Topic Operator from 90 to 120 seconds (to keep it the same as for other operators) * Changed Zookeeper session timeout default value to 18 seconds for Topic and User Operators (for improved resiliency) * Removed requirement for replicas and partitions KafkaTopic spec making these parameters optional +* Allow disabling service links (environment variables describing Kubernetes services) in Pod template * Update Kaniko executor to 1.6.0 ### Changes, deprecations and removals diff --git a/api/src/main/java/io/strimzi/api/kafka/model/template/PodTemplate.java b/api/src/main/java/io/strimzi/api/kafka/model/template/PodTemplate.java index 92d251bf61..6cd9855815 100644 --- a/api/src/main/java/io/strimzi/api/kafka/model/template/PodTemplate.java +++ b/api/src/main/java/io/strimzi/api/kafka/model/template/PodTemplate.java @@ -52,6 +52,7 @@ public class PodTemplate implements Serializable, UnknownPropertyPreserving { private String priorityClassName; private String schedulerName; private List hostAliases; + private Boolean enableServiceLinks; private Map additionalProperties = new HashMap<>(0); @Description("Metadata applied to the resource.") @@ -160,7 +161,7 @@ public void setSchedulerName(String schedulerName) { } @Description("The pod's HostAliases. " + - "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified.") + "HostAliases is an optional list of hosts and IPs that will be injected into the Pod's hosts file if specified.") @KubeLink(group = "core", version = "v1", kind = "HostAlias") @JsonInclude(JsonInclude.Include.NON_EMPTY) public List getHostAliases() { @@ -171,6 +172,16 @@ public void setHostAliases(List hostAliases) { this.hostAliases = hostAliases; } + @Description("Indicates whether information about services should be injected into Pod's environment variables.") + @JsonInclude(JsonInclude.Include.NON_DEFAULT) + public Boolean getEnableServiceLinks() { + return enableServiceLinks; + } + + public void setEnableServiceLinks(Boolean enableServiceLinks) { + this.enableServiceLinks = enableServiceLinks; + } + @Override public Map getAdditionalProperties() { return this.additionalProperties; diff --git a/api/src/test/resources/io/strimzi/api/kafka/model/040-Crd-kafka.yaml b/api/src/test/resources/io/strimzi/api/kafka/model/040-Crd-kafka.yaml index f71bc79da4..b4d14f225a 100644 --- a/api/src/test/resources/io/strimzi/api/kafka/model/040-Crd-kafka.yaml +++ b/api/src/test/resources/io/strimzi/api/kafka/model/040-Crd-kafka.yaml @@ -1391,7 +1391,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -2421,7 +2425,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -3426,7 +3434,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -4363,7 +4375,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -5120,7 +5136,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -5632,7 +5652,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -8541,7 +8565,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -9927,7 +9955,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -11824,7 +11856,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -12765,7 +12801,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -13526,7 +13566,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -14038,7 +14082,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -16947,7 +16995,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -18333,7 +18385,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -20230,7 +20286,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -21171,7 +21231,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -21932,7 +21996,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -22444,7 +22512,11 @@ spec: type: string description: The pod's HostAliases. HostAliases is an optional list of hosts and IPs that will be injected - into the pod's hosts file if specified. + into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: diff --git a/api/src/test/resources/io/strimzi/api/kafka/model/041-Crd-kafkaconnect.yaml b/api/src/test/resources/io/strimzi/api/kafka/model/041-Crd-kafkaconnect.yaml index 66be18808e..4d9d0af9b4 100644 --- a/api/src/test/resources/io/strimzi/api/kafka/model/041-Crd-kafkaconnect.yaml +++ b/api/src/test/resources/io/strimzi/api/kafka/model/041-Crd-kafkaconnect.yaml @@ -772,8 +772,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -1261,8 +1265,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -2782,8 +2790,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -3271,8 +3283,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -4792,8 +4808,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -5281,8 +5301,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: diff --git a/api/src/test/resources/io/strimzi/api/kafka/model/042-Crd-kafkaconnects2i.yaml b/api/src/test/resources/io/strimzi/api/kafka/model/042-Crd-kafkaconnects2i.yaml index d973bdc0c5..dbc472c2f1 100644 --- a/api/src/test/resources/io/strimzi/api/kafka/model/042-Crd-kafkaconnects2i.yaml +++ b/api/src/test/resources/io/strimzi/api/kafka/model/042-Crd-kafkaconnects2i.yaml @@ -780,8 +780,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -1269,8 +1273,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -2807,8 +2815,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -3296,8 +3308,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -4834,8 +4850,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -5323,8 +5343,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: diff --git a/api/src/test/resources/io/strimzi/api/kafka/model/045-Crd-kafkamirrormaker.yaml b/api/src/test/resources/io/strimzi/api/kafka/model/045-Crd-kafkamirrormaker.yaml index 826147b02d..84ff6ead9f 100644 --- a/api/src/test/resources/io/strimzi/api/kafka/model/045-Crd-kafkamirrormaker.yaml +++ b/api/src/test/resources/io/strimzi/api/kafka/model/045-Crd-kafkamirrormaker.yaml @@ -957,8 +957,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -2347,8 +2351,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -3737,8 +3745,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: diff --git a/api/src/test/resources/io/strimzi/api/kafka/model/046-Crd-kafkabridge.yaml b/api/src/test/resources/io/strimzi/api/kafka/model/046-Crd-kafkabridge.yaml index 3ad90df2f9..fa8b85cd58 100644 --- a/api/src/test/resources/io/strimzi/api/kafka/model/046-Crd-kafkabridge.yaml +++ b/api/src/test/resources/io/strimzi/api/kafka/model/046-Crd-kafkabridge.yaml @@ -787,8 +787,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -1752,8 +1756,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: diff --git a/api/src/test/resources/io/strimzi/api/kafka/model/048-Crd-kafkamirrormaker2.yaml b/api/src/test/resources/io/strimzi/api/kafka/model/048-Crd-kafkamirrormaker2.yaml index 5bd8be6d71..cd27c60364 100644 --- a/api/src/test/resources/io/strimzi/api/kafka/model/048-Crd-kafkamirrormaker2.yaml +++ b/api/src/test/resources/io/strimzi/api/kafka/model/048-Crd-kafkamirrormaker2.yaml @@ -885,8 +885,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -1374,8 +1378,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -2891,8 +2899,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: @@ -3380,8 +3392,12 @@ spec: ip: type: string description: The pod's HostAliases. HostAliases is an optional - list of hosts and IPs that will be injected into the pod's + list of hosts and IPs that will be injected into the Pod's hosts file if specified. + enableServiceLinks: + type: boolean + description: Indicates whether information about services + should be injected into Pod's environment variables. topologySpreadConstraints: type: array items: diff --git a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/AbstractModel.java b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/AbstractModel.java index 528dd776ef..f8ed89dfe2 100644 --- a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/AbstractModel.java +++ b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/AbstractModel.java @@ -276,6 +276,7 @@ public abstract class AbstractModel { protected List templatePodHostAliases; protected List templatePodTopologySpreadConstraints; protected PodManagementPolicy templatePodManagementPolicy = PodManagementPolicy.PARALLEL; + protected Boolean templatePodEnableServiceLinks; protected Map templateClusterRoleBindingLabels; protected Map templateClusterRoleBindingAnnotations; @@ -1028,6 +1029,7 @@ protected StatefulSet createStatefulSet( .endMetadata() .withNewSpec() .withServiceAccountName(getServiceAccountName()) + .withEnableServiceLinks(templatePodEnableServiceLinks) .withAffinity(affinity) .withInitContainers(initContainers) .withContainers(containers) @@ -1080,6 +1082,7 @@ protected Pod createPod( .withNewSpec() .withRestartPolicy("Never") .withServiceAccountName(getServiceAccountName()) + .withEnableServiceLinks(templatePodEnableServiceLinks) .withAffinity(getUserAffinity()) .withInitContainers(initContainers) .withContainers(containers) @@ -1126,6 +1129,7 @@ protected Deployment createDeployment( .withNewSpec() .withAffinity(affinity) .withServiceAccountName(getServiceAccountName()) + .withEnableServiceLinks(templatePodEnableServiceLinks) .withInitContainers(initContainers) .withContainers(containers) .withVolumes(volumes) diff --git a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaConnectS2ICluster.java b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaConnectS2ICluster.java index 5bb828358d..f7c5c53869 100644 --- a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaConnectS2ICluster.java +++ b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaConnectS2ICluster.java @@ -145,6 +145,7 @@ public DeploymentConfig generateDeploymentConfig(Map annotations .withLabels(getLabelsWithStrimziName(name, templatePodLabels).toMap()) .endMetadata() .withNewSpec() + .withEnableServiceLinks(templatePodEnableServiceLinks) .withContainers(container) .withVolumes(getVolumes(isOpenShift, true)) .withTolerations(getTolerations()) diff --git a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/ModelUtils.java b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/ModelUtils.java index 332af61522..0a5e56f510 100644 --- a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/ModelUtils.java +++ b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/ModelUtils.java @@ -258,6 +258,7 @@ public static void parsePodTemplate(AbstractModel model, PodTemplate pod) { model.templatePodSchedulerName = pod.getSchedulerName(); model.templatePodHostAliases = pod.getHostAliases(); model.templatePodTopologySpreadConstraints = pod.getTopologySpreadConstraints(); + model.templatePodEnableServiceLinks = pod.getEnableServiceLinks(); } } diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/EntityOperatorTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/EntityOperatorTest.java index e6d1202518..aec5e3b852 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/EntityOperatorTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/EntityOperatorTest.java @@ -223,6 +223,7 @@ public void testTemplate() { .withNewSchedulerName("my-scheduler") .withTolerations(singletonList(toleration)) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .endTemplate() .endEntityOperator() @@ -241,6 +242,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getMetadata().getAnnotations().entrySet().containsAll(podAnots.entrySet()), is(true)); assertThat(dep.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(dep.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); assertThat(dep.getSpec().getTemplate().getSpec().getTolerations(), is(singletonList(assertToleration))); } diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/JmxTransTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/JmxTransTest.java index 85a245ba62..f62ee5c986 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/JmxTransTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/JmxTransTest.java @@ -238,6 +238,7 @@ public void testTemplate() { .withNewSchedulerName("my-scheduler") .withAffinity(affinity) .withTolerations(tolerations) + .withEnableServiceLinks(false) .endPod() .endTemplate() .endJmxTrans() @@ -257,6 +258,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getMetadata().getLabels(), hasEntries(podLabels)); assertThat(dep.getSpec().getTemplate().getMetadata().getAnnotations(), hasEntries(podAnots)); assertThat(dep.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); } @Test diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaBridgeClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaBridgeClusterTest.java index 2c685c8244..b036eaa790 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaBridgeClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaBridgeClusterTest.java @@ -407,6 +407,7 @@ public void testTemplate() { .withAffinity(affinity) .withTolerations(tolerations) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .withNewApiService() .withNewMetadata() @@ -440,6 +441,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getSpec().getAffinity(), is(affinity)); assertThat(dep.getSpec().getTemplate().getSpec().getTolerations(), is(tolerations)); assertThat(dep.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check Service Service svc = kbc.generateService(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterTest.java index 57520c0104..d97042ffbb 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterTest.java @@ -1513,6 +1513,7 @@ image, healthDelay, healthTimeout, metricsCm, jmxMetricsConfig, configuration, e .withNewSchedulerName("my-scheduler") .withHostAliases(hostAlias1, hostAlias2) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .withNewBootstrapService() .withNewMetadata() @@ -1580,6 +1581,7 @@ image, healthDelay, healthTimeout, metricsCm, jmxMetricsConfig, configuration, e assertThat(sts.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(sts.getSpec().getTemplate().getSpec().getHostAliases(), containsInAnyOrder(hostAlias1, hostAlias2)); assertThat(sts.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(sts.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check Service Service svc = kc.generateService(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectBuildTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectBuildTest.java index 81cb5143ac..0e4c1fb451 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectBuildTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectBuildTest.java @@ -411,6 +411,7 @@ public void testTemplate() { .endMetadata() .withNewPriorityClassName("top-priority") .withNewSchedulerName("my-scheduler") + .withEnableServiceLinks(false) .endBuildPod() .withNewBuildContainer() .withEnv(new ContainerEnvVarBuilder().withName("TEST_ENV_VAR").withValue("testValue").build()) @@ -432,6 +433,7 @@ public void testTemplate() { assertThat(pod.getMetadata().getAnnotations().entrySet().containsAll(buildPodAnnos.entrySet()), is(true)); assertThat(pod.getSpec().getPriorityClassName(), is("top-priority")); assertThat(pod.getSpec().getSchedulerName(), is("my-scheduler")); + assertThat(pod.getSpec().getEnableServiceLinks(), is(false)); assertThat(pod.getSpec().getContainers().get(0).getEnv().stream().filter(env -> "TEST_ENV_VAR".equals(env.getName())).findFirst().get().getValue(), is("testValue")); KafkaConnectDockerfile dockerfile = new KafkaConnectDockerfile("my-image:latest", kc.getSpec().getBuild()); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java index e32770b683..fea08591a4 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java @@ -598,6 +598,7 @@ public void testTemplate() { .withNewSchedulerName("my-scheduler") .withHostAliases(hostAlias1, hostAlias2) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .withNewApiService() .withNewMetadata() @@ -636,6 +637,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(dep.getSpec().getTemplate().getSpec().getHostAliases(), containsInAnyOrder(hostAlias1, hostAlias2)); assertThat(dep.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check Service Service svc = kc.generateService(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectS2IClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectS2IClusterTest.java index 75b3483a5d..6771df03ab 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectS2IClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectS2IClusterTest.java @@ -577,6 +577,7 @@ public void testTemplate() { .withNewSchedulerName("my-scheduler") .withHostAliases(hostAlias1, hostAlias2) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .withNewApiService() .withNewMetadata() @@ -615,6 +616,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(dep.getSpec().getTemplate().getSpec().getHostAliases(), containsInAnyOrder(hostAlias1, hostAlias2)); assertThat(dep.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check Service Service svc = kc.generateService(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaExporterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaExporterTest.java index 69601a7edc..04ca0f5591 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaExporterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaExporterTest.java @@ -392,6 +392,7 @@ public void testTemplate() { .withAffinity(affinity) .withTolerations(tolerations) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .withNewService() .withNewMetadata() @@ -418,6 +419,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getSpec().getAffinity(), is(affinity)); assertThat(dep.getSpec().getTemplate().getSpec().getTolerations(), is(tolerations)); assertThat(dep.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); } @AfterAll diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMaker2ClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMaker2ClusterTest.java index 8df921ef6c..0f1931100e 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMaker2ClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMaker2ClusterTest.java @@ -723,6 +723,7 @@ public void testTemplate() { .withNewPriorityClassName("top-priority") .withNewSchedulerName("my-scheduler") .withHostAliases(hostAlias1, hostAlias2) + .withEnableServiceLinks(false) .endPod() .withNewApiService() .withNewMetadata() @@ -754,6 +755,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getMetadata().getAnnotations().entrySet().containsAll(podAnots.entrySet()), is(true)); assertThat(dep.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(dep.getSpec().getTemplate().getSpec().getHostAliases(), containsInAnyOrder(hostAlias1, hostAlias2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check Service Service svc = kmm2.generateService(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMakerClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMakerClusterTest.java index c3dba808b3..a0cfd2a431 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMakerClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaMirrorMakerClusterTest.java @@ -534,6 +534,7 @@ public void testTemplate() { .withNewPriorityClassName("top-priority") .withNewSchedulerName("my-scheduler") .withHostAliases(hostAlias1, hostAlias2) + .withEnableServiceLinks(false) .endPod() .withNewPodDisruptionBudget() .withNewMetadata() @@ -559,6 +560,7 @@ public void testTemplate() { assertThat(dep.getSpec().getTemplate().getMetadata().getAnnotations().entrySet().containsAll(podAnots.entrySet()), is(true)); assertThat(dep.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(dep.getSpec().getTemplate().getSpec().getHostAliases(), containsInAnyOrder(hostAlias1, hostAlias2)); + assertThat(dep.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check PodDisruptionBudget PodDisruptionBudget pdb = mmc.generatePodDisruptionBudget(); diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/ZookeeperClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/ZookeeperClusterTest.java index 69676f1ae4..bb3dba652d 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/ZookeeperClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/ZookeeperClusterTest.java @@ -437,6 +437,7 @@ image, healthDelay, healthTimeout, metricsCm, jmxMetricsConfig, configurationJso .withNewSchedulerName("my-scheduler") .withHostAliases(hostAlias1, hostAlias2) .withTopologySpreadConstraints(tsc1, tsc2) + .withEnableServiceLinks(false) .endPod() .withNewClientService() .withNewMetadata() @@ -474,6 +475,7 @@ image, healthDelay, healthTimeout, metricsCm, jmxMetricsConfig, configurationJso assertThat(sts.getSpec().getTemplate().getSpec().getSchedulerName(), is("my-scheduler")); assertThat(sts.getSpec().getTemplate().getSpec().getHostAliases(), containsInAnyOrder(hostAlias1, hostAlias2)); assertThat(sts.getSpec().getTemplate().getSpec().getTopologySpreadConstraints(), containsInAnyOrder(tsc1, tsc2)); + assertThat(sts.getSpec().getTemplate().getSpec().getEnableServiceLinks(), is(false)); // Check Service Service svc = zc.generateService(); diff --git a/documentation/modules/appendix_crds.adoc b/documentation/modules/appendix_crds.adoc index da5eb50fff..d824332bc6 100644 --- a/documentation/modules/appendix_crds.adoc +++ b/documentation/modules/appendix_crds.adoc @@ -882,10 +882,12 @@ include::../api/io.strimzi.api.kafka.model.template.PodTemplate.adoc[leveloffset |string |schedulerName 1.2+<.