Skip to content

Commit

Permalink
Make it possible to disable service links (#4810)
Browse files Browse the repository at this point in the history
* Make it possible to disable service links - Close #4800

Signed-off-by: Jakub Scholz <www@scholzj.com>

* Review comments

Signed-off-by: Jakub Scholz <www@scholzj.com>
  • Loading branch information
scholzj committed Apr 30, 2021
1 parent 1f9d3df commit 914d644
Show file tree
Hide file tree
Showing 35 changed files with 365 additions and 69 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
Expand Up @@ -52,6 +52,7 @@ public class PodTemplate implements Serializable, UnknownPropertyPreserving {
private String priorityClassName;
private String schedulerName;
private List<HostAlias> hostAliases;
private Boolean enableServiceLinks;
private Map<String, Object> additionalProperties = new HashMap<>(0);

@Description("Metadata applied to the resource.")
Expand Down Expand Up @@ -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<HostAlias> getHostAliases() {
Expand All @@ -171,6 +172,16 @@ public void setHostAliases(List<HostAlias> 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<String, Object> getAdditionalProperties() {
return this.additionalProperties;
Expand Down
108 changes: 90 additions & 18 deletions api/src/test/resources/io/strimzi/api/kafka/model/040-Crd-kafka.yaml
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 914d644

Please sign in to comment.