Skip to content

Commit 90bf204

Browse files
davidhou17jwilliams-mongo
authored andcommitted
Add externalAccess spec, guidance for acme certs (#1263)
Add externalAccess spec, guidance for acme certs reconcile changes against multi-cluster spec reconcile changes against multi-cluster spec copy and tech review feedback 1 tech review feedback 2 copy review 2 add includes for externalAccess copy review 2 (cont.) copy and tech review 3 final copy review final tech review final updates
1 parent 9da6720 commit 90bf204

18 files changed

+309
-55
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
'.. |copy| unicode:: U+000A9',
8585
'.. |year| replace:: {0}'.format(datetime.date.today().year),
8686
'.. |a-application| replace:: an Ops Manager Application',
87+
'.. |acme| replace:: :abbr:`ACME (Automatic Certificate Management Environment)`',
8788
'.. |a-mms| replace:: an Ops Manager',
8889
'.. |A-mms| replace:: An Ops Manager',
8990
'.. |application-s| replace:: Ops Manager Applications',
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
If you're using an |acme| based service provider such as `Let's Encrypt
2+
<https://letsencrypt.org>`_ to issue |tls| certificates, the provider
3+
might prohibit you from adding the Pod's default |fqdn|\s (``*.svc.cluster.local``)
4+
to |san-dns|\s in the certificate.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
If you add ``spec.externalAccess``, the |k8s-op-short| creates an external service
2+
for each Pod in a replica set. External services provide an external entry point
3+
for each MongoDB database Pod in a cluster. Each external service has selectors
4+
that match the external service to a specific Pod.
5+
6+
If you add this setting without any values, the |k8s-op-short| creates
7+
an external service with the following default values:
8+
9+
.. list-table::
10+
:header-rows: 1
11+
:widths: 30 25 45
12+
13+
* - Field
14+
- Value
15+
- Description
16+
17+
* - ``Name``
18+
- ``<pod-name>-svc-external``
19+
- Name of the external service. You can't change this value.
20+
21+
* - ``Type``
22+
- ``LoadBalancer``
23+
- Creates an external :k8sdocs:`LoadBalancer
24+
</concepts/services-networking/service/#loadbalancer>` service.
25+
26+
* - ``Port``
27+
- ``<Port Number>``
28+
- A port for |mongod|. If you set |external-domain|,
29+
the external service adds another port (``Port Number + 1``) for backups.
30+
31+
* - ``publishNotReadyAddress``
32+
- ``true``
33+
- Specifies that :k8sdocs:`DNS records </concepts/services-networking/dns-pod-service/>`
34+
are created even if the Pod isn't ready.
35+
Do not set to ``false`` for any database Pod.
36+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
An external domain used to externally expose your replica set deployment.
2+
3+
By default, each replica set member uses the |k8s| Pod's |fqdn|
4+
(``*.svc.cluster.local``) as the default hostname. However, if you add a
5+
external domain to this setting, the replica set uses a hostname that is a
6+
subdomain of the specified domain instead. This hostname uses the following
7+
format:
8+
9+
|hostname-format|
10+
11+
For example:
12+
13+
|hostname-example|
14+
15+
After you deploy the replica set with this setting, the
16+
|k8s-op-short| uses the hostname with the external domain to override
17+
the ``processes[n].hostname`` field in the |onprem| :opsmgr:`automation configuration
18+
</reference/cluster-configuration>`. Then, the {+mdbagent+} uses this hostname to
19+
connect to |mongod|.
20+
21+
To specify other hostnames for connecting to the replica set, you can use the
22+
:setting:`spec.connectivity.replicaSetHorizons` setting. However, the following
23+
connections still use the hostname with the external domain:
24+
25+
- The {+mdbagent+} to connect to |mongod|.
26+
- |mongod| to connect to other |mongod| instances.
27+
28+
.. warning::
29+
30+
Specifying this field changes how |onprem| registers |mongod| processes.
31+
You can specify this field only for new replica set deployments starting in |k8s-op-short|
32+
version 1.19. You can't change the value of this field or any ``processes[n].hostname`` fields
33+
in the |onprem| :opsmgr:`automation configuration </reference/cluster-configuration>` for a running
34+
replica set deployment.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Key-value pairs that let you add cloud provider-specific
2+
configuration settings to all clusters in your deployment.
3+
4+
To learn more about annotations, see the
5+
:k8sdocs:`Kubernetes documentation </concepts/overview/working-with-objects/annotations/>`
6+
and the documentation for your |k8s| cloud provider.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
When you set the :setting:`spec.externalAccess` setting, the |k8s-op-short|
2+
automatically creates an external load balancer service with preset values.
3+
You can override certain values or add new values depending on your needs.
4+
For example, if you intend to create :k8sdocs:`NodePort services
5+
</concepts/services-networking/service/#type-nodeport>`
6+
and don't need a load balancer, you must configure overrides in your
7+
|k8s| specification:
8+
9+
.. code-block:: yaml
10+
11+
externalAccess:
12+
externalService:
13+
annotations:
14+
# cloud-specific annotations for the service
15+
spec:
16+
type: NodePort # default is LoadBalancer
17+
# you can specify other spec overrides if necessary
18+
19+
For more information about the |k8s| specification, see :k8sdocs:`ServiceSpec
20+
</reference/kubernetes-api/service-resources/service-v1/#ServiceSpec>`
21+
in the |k8s| documentation.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. list-table::
2+
:widths: 25 10 10 55
3+
:header-rows: 1
4+
5+
* - Key
6+
- Type
7+
- Necessity
8+
- Description
9+
10+
* - | ``spec.externalAccess``
11+
| :setting:`.externalDomain<spec.externalAccess.externalDomain>`
12+
- string
13+
- Required
14+
- .. include:: /includes/facts/fact-external-domain-spec.rst
15+
16+
* - | ``spec.externalAccess``
17+
| :setting:`.externalService.spec<spec.externalAccess.externalService.spec>`
18+
- collection
19+
- Optional
20+
- Configuration for the :k8sdocs:`ServiceSpec </reference/kubernetes-api/service-resources/service-v1/#ServiceSpec>`.
21+
22+
.. include:: /includes/facts/fact-external-service-spec.rst
23+
24+
* - | ``spec.externalAccess``
25+
| :setting:`.externalService.annotations<spec.externalAccess.externalService.annotations>`
26+
- collection
27+
- Optional
28+
- .. include:: /includes/facts/fact-external-service-annotation-spec.rst

source/includes/options-k8s-shared.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,8 @@ description: |
630630
631631
.. important::
632632
633-
:setting:`spec.security.tls.enabled` is deprecated and will be
634-
removed in a future release. To enable |tls|, provide a value for
633+
:setting:`spec.security.tls.enabled` is deprecated starting in |k8s-op-short| version 1.19.
634+
To enable |tls|, provide a value for
635635
the :setting:`spec.security.certsSecretPrefix` setting.
636636
637637
Encrypts communications using TLS certificates between:
@@ -1341,9 +1341,16 @@ optional: true
13411341
default: "false"
13421342
description: |
13431343
1344-
Determines whether the MongoDB deployment is exposed outside of the
1345-
Kubernetes cluster. This results in |k8s| creating a
1346-
:k8sdocs:`NodePort service </concepts/services-networking/service/#nodeport>`.
1344+
.. important::
1345+
1346+
``spec.exposedExternally`` is deprecated starting in |k8s-op-short| version 1.19
1347+
and will be removed in a future |k8s-op-short| release. To configure how your deployment
1348+
should be exposed externally, use the :setting:`spec.externalAccess` settings.
1349+
1350+
Determines whether a |multi-cluster| is exposed outside the |k8s| clusters.
1351+
Setting ``spec.exposedExternally: true`` is equivalent to setting ``spec.externalAccess: {}``.
1352+
See :setting:`spec.externalAccess` for details.
1353+
13471354
---
13481355
program: _shared
13491356
name: spec.podSpec.podTemplate
@@ -1353,7 +1360,7 @@ optional: true
13531360
description: |
13541361
13551362
:k8sdocs:`Template </concepts/workloads/pods/pod-overview/#pod-templates>`
1356-
for the |k8s| pods that the |k8s-op| creates for {{component}}.
1363+
for the |k8s| Pods that the |k8s-op| creates for {{component}}.
13571364
13581365
Template values take precedence over values specified in {{podSpec}}.
13591366
@@ -1370,7 +1377,7 @@ directive: setting
13701377
optional: true
13711378
description: |
13721379
1373-
Metadata for the |k8s| pods that the |k8s-op| creates for
1380+
Metadata for the |k8s| Pods that the |k8s-op| creates for
13741381
{{component}}.
13751382
13761383
To review which fields you can add to {{podTemplate_metadata}}, see
@@ -1384,7 +1391,7 @@ directive: setting
13841391
optional: true
13851392
description: |
13861393
1387-
Specifications of the |k8s| pods that the |k8s-op| creates for
1394+
Specifications of the |k8s| Pods that the |k8s-op| creates for
13881395
{{component}}.
13891396
13901397
To review which fields you can add to {{podTemplate_spec}}, see the
@@ -1497,5 +1504,4 @@ description: |
14971504
deployed with the |k8s-op-short|.
14981505
14991506
{{example}}
1500-
15011507
...

source/includes/prereqs/custom-ca-prereqs-rs-tls-only.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88

99
.. include:: /includes/prereqs/san-format.rst
1010

11+
.. important::
12+
13+
.. include:: /includes/facts/fact-acme-provider-certs.rst
14+
15+
To use an |acme| based certificate, you must configure
16+
the certificate for your replica set resource.
17+
To learn more, see the step about |acme| based |tls|
18+
certificates in the :ref:`procedure <tls-for-replica-set>`.
19+
1120
.. include:: /includes/prereqs/mdbagent-reqs.rst
1221

1322
- You must possess the |certauth| certificate and the key that you used to

source/includes/steps-deploy-k8s-replica-set-with-tls.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,30 @@ replacement:
7272
k8sResource: :term:`replica set`
7373
---
7474
stepnum: 9
75+
ref: k8s-add-external-access
76+
source:
77+
file: steps-source-deploy-k8s-resource.yaml
78+
ref: add-k8s-external-access
79+
replacement:
80+
k8sResource: :term:`replica set`
81+
---
82+
stepnum: 10
7583
ref: add-other-spec-rs
7684
source:
7785
file: steps-source-deploy-k8s-resource.yaml
7886
ref: add-k8s-rs-values
7987
replacement:
8088
k8sResource: :term:`replica set`
8189
---
82-
stepnum: 10
90+
stepnum: 11
8391
ref: save-object-spec-rs
8492
source:
8593
file: steps-source-deploy-k8s-resource.yaml
8694
ref: save-object-spec
8795
replacement:
8896
k8sResource: :term:`replica set`
8997
---
90-
stepnum: 11
98+
stepnum: 12
9199
ref: start-k8s-deployment-rs
92100
source:
93101
file: steps-source-deploy-k8s-resource.yaml
@@ -96,7 +104,7 @@ replacement:
96104
k8sResource: :term:`replica set`
97105
k8sResourceType: replica-set
98106
---
99-
stepnum: 12
107+
stepnum: 13
100108
ref: track-k8s-deployment-rs
101109
source:
102110
file: steps-source-deploy-k8s-resource.yaml

source/includes/steps-source-deploy-k8s-resource.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,38 @@ content: |
227227
228228
.. include:: /includes/list-tables/resource-keys-internal-x509.rst
229229
230+
---
231+
title: "Configure |acme| based |tls| certificates for your {{k8sResource}} resource."
232+
stepnum: 0
233+
level: 4
234+
optional: true
235+
ref: add-k8s-external-access
236+
content: |
237+
238+
.. include:: /includes/facts/fact-acme-provider-certs.rst
239+
240+
To configure a certificate that doesn't contain the pod's |fqdn|\s:
241+
242+
a. Issue the certificate for an external domain. For more information, see the
243+
`Let's Encrypt documentation <https://letsencrypt.org/how-it-works/>`_ or
244+
the documentation for your provider.
245+
246+
#. Ensure that your certificate contains all hostnames that you plan to deploy in the
247+
replica set. Alternatively, you can issue a wildcard certificate for ``*.<externalDomain>``.
248+
249+
#. To use a certificate containing only external domains for your replica set deployment,
250+
you must change the default hostname used by the replica set:
251+
252+
- If you prefer to configure the hostname while creating your |k8s| cluster, change the
253+
:k8sdocs:`default domain </concepts/services-networking/dns-pod-service#what-things-get-dns-names>`
254+
from ``cluster.local`` to the external domain when creating or recreating your |k8s| cluster.
255+
Then, set this domain in your MongoDB resource by using the :setting:`spec.clusterDomain` setting.
256+
257+
- Otherwise, create your MongoDB deployment with the following settings configured in your |k8s|
258+
object:
259+
260+
.. include:: /includes/list-tables/configure-acme-based-certs.rst
261+
230262
---
231263
title: "Add any additional accepted settings for a {{k8sResource}} deployment."
232264
stepnum: 0

source/reference/k8s-op-exclusive-settings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The following list of settings are exclusive to |k8s|. This list may
2525
change at a later date.
2626

2727
These settings can be found on the
28-
:opsmgr:`Automation Configuration </reference/cluster-configuration>`
28+
:opsmgr:`automation configuration </reference/cluster-configuration>`
2929
page:
3030

3131
- ``auth.autoAuthMechanisms``

0 commit comments

Comments
 (0)