-
-
Notifications
You must be signed in to change notification settings - Fork 13
Add configuring cluster domain guide #673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cfa8574
initial cluster domain docs
maltesander 85f5b12
add note in kubernetes section for cluster domain
maltesander 7a0e4f7
fix link
maltesander c95fb51
fixes
maltesander 884bc37
Apply suggestions from code review
maltesander 48798fb
rename to kubernetes-cluster-domain.adoc
maltesander e82c01f
fix typo
maltesander fa9b6f4
review comments
sbernauer 8acb55b
remove auto-dectection explanation
maltesander e8c8918
Update modules/guides/pages/kubernetes-cluster-domain.adoc
maltesander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sbernauer marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
= Configuring the Kubernetes cluster domain | ||
:description: Configure Stackable operators to use a different cluster domain other than 'cluster.local'. | ||
:dns-custom-nameservers: https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/ | ||
:dns-pod-service: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ | ||
|
||
Stackable operators allow to configure a non-default cluster domain as described in {dns-custom-nameservers}[`Customizing DNS Service`] (and more in {dns-pod-service}[`DNS for Services and Pods`]). | ||
maltesander marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The configuration is primarily done via and environment variable `KUBERNETES_CLUSTER_DOMAIN`, but there is also a mechansim to auto detect the cluster domain using the `/etc/resolv.conf` file. | ||
maltesander marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The following steps explain the use of the environment variable and the auto detection mechanism in detail. | ||
maltesander marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
== Steps | ||
|
||
=== Use environment variable | ||
|
||
The environment variable `KUBERNETES_CLUSTER_DOMAIN` takes precedence over auto detection. This means that the desired cluster domain can be configured in a Helm values file via the property `kubernetesClusterDomain` or via the install command like: | ||
maltesander marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
helm install hive-operator stackable-stable/hive-operator --set kubernetesClusterDomain="my-cluster.local" | ||
``` | ||
|
||
=== Use auto detection | ||
|
||
As a first step, the auto detection is checking the runtime environment of the operator. In most cases this is a clusterized environment like Kubernetes or Openshift. | ||
This is determined by checking if the `KUBERNETES_SERVICE_HOST` environment variable is set in the operator Pod. | ||
|
||
If clusterized, the auto detection parses the `/etc/resolv.conf` file for the last entry starting with the `search` keyword. Within that `search` entry the shortest option is selected. | ||
|
||
An example for the `/etc/resolv.conf` in a Kubelet looks like: | ||
|
||
``` | ||
nameserver 10.32.0.10 | ||
search <namespace>.svc.cluster.local svc.cluster.local cluster.local | ||
options ndots:5 | ||
``` | ||
|
||
Using this example as a base for the cluster domain auto detection, the operator would choose the `cluster.local` option. | ||
|
||
=== Running locally | ||
|
||
This section covers the case when both `KUBERNETES_CLUSTER_DOMAIN` and `KUBERNETES_SERVICE_HOST` are not set. This would be the case if the operator is not running in a clusterized environment like e.g. locally a Laptop or PC. | ||
maltesander marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Running the operator locally is mostly for development and therefore not relevant for most users. | ||
|
||
If running locally, and `KUBERNETES_CLUSTER_DOMAIN` and `KUBERNETES_SERVICE_HOST` are not set, the operator will default its cluster domain to `cluster.local`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.