|
4 | 4 |
|
5 | 5 | :_mod-docs-content-type: PROCEDURE
|
6 | 6 | [id="private-clusters-setting-dns-private_{context}"]
|
7 |
| -= Setting DNS to private |
| 7 | += Configuring DNS records to be published in a private zone |
8 | 8 |
|
9 |
| -After you deploy a cluster, you can modify its DNS to use only a private zone. |
| 9 | +For all {product-title} clusters, whether public or private, DNS records are published in a public zone by default. |
| 10 | + |
| 11 | +You can remove the public zone from the cluster DNS configuration to avoid exposing DNS records to the public. You might want to avoid exposing sensitive information, such as internal domain names, internal IP addresses, or the number of clusters at an organization, or you might simply have no need to publish records publicly. If all the clients that should be able to connect to services within the cluster use a private DNS service that has the DNS records from the private zone, then there is no need to have a public DNS record for the cluster. |
| 12 | + |
| 13 | +After you deploy a cluster, you can modify its DNS to use only a private zone by modifying the `DNS` custom resource (CR). |
| 14 | +Modifying the `DNS` CR in this way means that any DNS records that are subsequently created are not published to public DNS servers, which keeps knowledge of the DNS records isolated to internal users. This can be done when you configure the cluster to be private, or if you never want DNS records to be publicly resolvable. |
| 15 | + |
| 16 | +Alternatively, even in a private cluster, you might keep the public zone for DNS records because it allows clients to resolve DNS names for applications running on that cluster. For example, an organization can have machines that connect to the public internet and then establish VPN connections for certain private IP ranges in order to connect to private IP addresses. The DNS lookups from these machines use the public DNS to determine the private addresses of those services, and then connect to the private addresses over the VPN. |
10 | 17 |
|
11 | 18 | .Procedure
|
12 | 19 |
|
13 |
| -. Review the `DNS` custom resource for your cluster: |
| 20 | +. Review the `DNS` CR for your cluster by running the following command and observing the output: |
14 | 21 | +
|
15 | 22 | [source,terminal]
|
16 | 23 | ----
|
@@ -42,22 +49,29 @@ status: {}
|
42 | 49 | +
|
43 | 50 | Note that the `spec` section contains both a private and a public zone.
|
44 | 51 |
|
45 |
| -. Patch the `DNS` custom resource to remove the public zone: |
| 52 | +. Patch the `DNS` CR to remove the public zone by running the following command: |
46 | 53 | +
|
47 | 54 | [source,terminal]
|
48 | 55 | ----
|
49 | 56 | $ oc patch dnses.config.openshift.io/cluster --type=merge --patch='{"spec": {"publicZone": null}}'
|
| 57 | +---- |
| 58 | ++ |
| 59 | +.Example output |
| 60 | +[source,yaml] |
| 61 | +---- |
50 | 62 | dns.config.openshift.io/cluster patched
|
51 | 63 | ----
|
52 | 64 | +
|
53 |
| -Because the Ingress Controller consults the `DNS` definition when it creates `Ingress` objects, when you create or modify `Ingress` objects, only private records are created. |
| 65 | +The Ingress Operator consults the `DNS` CR definition when it creates DNS records for `IngressController` objects. If only private zones are specified, only private records are created. |
54 | 66 | +
|
55 | 67 | [IMPORTANT]
|
56 | 68 | ====
|
57 |
| -DNS records for the existing Ingress objects are not modified when you remove the public zone. |
| 69 | +Existing DNS records are not modified when you remove the public zone. You must manually delete previously published public DNS records if you no longer want them to be published publicly. |
58 | 70 | ====
|
59 | 71 |
|
60 |
| -. Optional: Review the `DNS` custom resource for your cluster and confirm that the public zone was removed: |
| 72 | +.Verification |
| 73 | + |
| 74 | +* Review the `DNS` CR for your cluster and confirm that the public zone was removed, by running the following command and observing the output: |
61 | 75 | +
|
62 | 76 | [source,terminal]
|
63 | 77 | ----
|
|
0 commit comments