Skip to content

Commit bb31033

Browse files
authored
(DOCSP-29355): Add externalAccess steps for standalone and sharded clusters (#1313)
* Add externalAccess procedure for standalone and sharded clusters * small fixes * tech review feedback * additional fixes * tech review feedback * copy review feedback * copy review 2 * small update to release notes
1 parent 1f6247a commit bb31033

21 files changed

+252
-365
lines changed

source/includes/code-examples/yaml-files/example-sharded-cluster.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ spec:
470470
credentials: my-secret
471471
type: ShardedCluster
472472
persistent: true
473-
exposedExternally: true
473+
externalAccess: {}
474474
...
475475
END-exposed-sharded-full
476476

@@ -496,7 +496,7 @@ spec:
496496
END-exposed-sharded-upper
497497

498498
START-exposed-sharded-lower
499-
exposedExternally: true
499+
externalAccess: {}
500500
...
501501
END-exposed-sharded-lower
502502

@@ -518,13 +518,12 @@ spec:
518518
configServerCount: 3
519519
credentials: my-secret
520520
type: ShardedCluster
521-
persistent: true
522-
exposedExternally: true
521+
externalAccess: {}
523522
security:
524523
tls:
525-
enabled: true
524+
certsSecretPrefix: <prefix>
526525
additionalCertificateDomains:
527-
- "additional-cert-test.com"
526+
- "<external-domain>"
528527
...
529528
END-exposed-sharded-tls-full
530529

@@ -550,7 +549,7 @@ spec:
550549
END-exposed-sharded-tls-upper
551550

552551
START-exposed-sharded-tls-lower
553-
exposedExternally: true
552+
externalAccess: {}
554553
security:
555554
tls:
556555
enabled: true

source/includes/code-examples/yaml-files/example-standalone.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ spec:
3030
# Must match metadata.name in ConfigMap file
3131
credentials: <mycredentials>
3232
type: Standalone
33-
persistent: true
34-
exposedExternally: true
3533
...
3634
END-standalone-exposed-full
3735

@@ -49,10 +47,9 @@ spec:
4947
# Must match metadata.name in ConfigMap file
5048
credentials: <mycredentials>
5149
type: Standalone
52-
persistent: true
5350
END-standalone-exposed-upper
5451

5552
START-standalone-exposed-lower
56-
exposedExternally: true
53+
externalAccess: {}
5754
...
5855
END-standalone-exposed-lower

source/includes/facts/fact-external-access-spec.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
If you add ``spec.externalAccess``, the |k8s-op-short| creates an external service
22
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
3+
for each MongoDB database Pod in a cluster. Each external service has
4+
:k8sdocs:`selectors </concepts/overview/working-with-objects/labels/>`
45
that match the external service to a specific Pod.
56

67
If you add this setting without any values, the |k8s-op-short| creates

source/includes/facts/fact-external-service-spec.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
When you set the :setting:`spec.externalAccess` setting, the |k8s-op-short|
2-
automatically creates an external load balancer service with preset values.
1+
When you set the |external-access| setting, the |k8s-op-short|
2+
automatically creates an external load balancer service with |default-values|.
33
You can override certain values or add new values depending on your needs.
44
For example, if you intend to create :k8sdocs:`NodePort services
55
</concepts/services-networking/service/#type-nodeport>`

source/includes/list-tables/external-service-default.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
* - ``Port``
1919
- ``<Port Number>``
20-
- A port for |mongod|. If you set |external-domain|,
21-
the external service adds another port (``Port Number + 1``) for backups.
20+
- A port for |mongod|.
2221

2322
* - ``publishNotReadyAddress``
2423
- ``true``

source/includes/list-tables/resource-keys-external-access-sharded.rst

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
- Description
99
- Example
1010

11-
* - :setting:`spec.exposedExternally`
12-
- Boolean
13-
- Optional
14-
- Set this value to ``true`` to allow external services to connect
15-
to the MongoDB deployment. This results in |k8s| creating a
16-
:k8sdocs:`NodePort service </concepts/services-networking/service/#nodeport>`.
17-
- ``true``
11+
* - | ``spec.security``
12+
| :setting:`.certsSecretPrefix<spec.security.certsSecretPrefix>`
13+
- string
14+
- Required
15+
- Add the ``<prefix>`` of the secret
16+
name that contains your MongoDB deployment's |tls| certificates.
17+
- ``devDb``
1818

1919
* - | ``spec.security.tls``
2020
| :setting:`.additionalCertificateDomains<spec.security.tls.additionalCertificateDomains>`
@@ -25,12 +25,4 @@
2525
every |csr| that the |k8s-op-short| transforms into a |tls|
2626
certificate includes a |san-dns| in the form ``<pod
2727
name>.<additional cert domain>``.
28-
- ``true``
29-
30-
* - | ``spec.security``
31-
| :setting:`.certsSecretPrefix<spec.security.certsSecretPrefix>`
32-
- string
33-
- Required
34-
- Add the ``<prefix>`` of the secret
35-
name that contains your MongoDB deployment's |tls| certificates.
36-
- ``devDb``
28+
- ``example.com``

source/includes/list-tables/resource-keys-external-access-standalone.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

source/includes/steps-create-external-services.yaml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
stepnum: 0
33
level: 4
44
ref: create-external-services
5-
title: "Create an external service for each of the Pods."
5+
title: Create an external service for {{podType}}.
66
content: |
77
To connect to your {{k8sResource}} from an external resource, configure the
88
:ref:`spec.externalAccess <multi-spec-externalaccess>` setting:
@@ -12,7 +12,7 @@ content: |
1212
externalAccess: {}
1313
1414
This setting instructs the |k8s-op-short| to create an external :k8sdocs:`LoadBalancer
15-
</concepts/services-networking/service/#loadbalancer>` service for each Pod in your
15+
</concepts/services-networking/service/#loadbalancer>` service for {{podType}} in your
1616
{{k8sResource}}. The external service provides an entry point for external connections.
1717
Adding this setting with no values creates an external service with the following default
1818
values:
@@ -27,8 +27,8 @@ content: |
2727
- Overrides for the service specification, in {{overrides}}.
2828
2929
For example, the following settings override the default values for the external service
30-
to configure your {{k8sResource}} to create a :k8sdocs:`NodePort service
31-
</concepts/services-networking/service/#type-nodeport>` that exposes the {{k8sResource}}:
30+
to configure your {{k8sResource}} to create :k8sdocs:`NodePort services
31+
</concepts/services-networking/service/#type-nodeport>` that expose {{podType}}:
3232
3333
.. code-block:: yaml
3434
@@ -52,24 +52,48 @@ content: |
5252
stepnum: 0
5353
level: 4
5454
ref: verify-external-services
55-
title: "Verify the external services."
55+
title: Verify the external services.
5656
content: |
57-
In {{deployment}}, run the following command to verify that the external services
58-
have been created.
57+
In {{deployment}}, run the following command to verify that the
58+
|k8s-op-short| created the external service for your deployment.
5959
6060
.. code-block:: sh
6161
6262
$ kubectl get services
6363
6464
The command returns a list of services similar to the following output.
6565
For each database Pod in the cluster, the |k8s-op-short| creates an external service
66-
named ``<pod-name>-svc-external``. This service is configured according to the values
67-
and overrides you provide in the :ref:`external service specification <k8s-specification>`.
66+
named ``{{format}}``. This service is configured according to the values
67+
and overrides you provide in the {{spec}}.
6868
6969
.. code-block:: sh
7070
:copyable: false
7171
7272
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
73-
{{example}} LoadBalancer 10.102.27.116 1.2.3.4 27017:27017/TCP 8m30s
73+
{{example}} LoadBalancer 10.102.27.116 <lb-ip-or-fqdn> 27017:27017/TCP 8m30s
74+
75+
Depending on your cluster configuration or cloud provider,
76+
the IP address of the LoadBalancer service is an externally
77+
accessible IP address or |fqdn|. You can use the IP address or |fqdn|
78+
to route traffic from your external domain.
79+
---
80+
stepnum: 0
81+
level: 4
82+
ref: test-connection-external-services
83+
title: Test the connection to the {{k8sResource}}.
84+
content: |
85+
To connect to your deployment from outside of the |k8s| cluster,
86+
use the MongoDB Shell (``mongosh``) and specify the {{podType}}
87+
that you've exposed through the external domain.
88+
89+
.. example::
90+
91+
If you have {{addressExample}}, you can
92+
connect to this sharded cluster instance from outside of the |k8s|
93+
cluster by using the following command:
94+
95+
.. code-block:: sh
96+
97+
mongosh "{{addressCommand}}"
7498
7599
...

0 commit comments

Comments
 (0)