Skip to content

Commit 9acbe00

Browse files
DOCSP-7918: externalConnectivity for OM in k8s (#152)
* (DOCSP-7918): initial om external connectivity commit * (DOCSP-7918): internal and external access to om in k8s * (DOCSP-7918): typo * (DOCSP-7918): copy review edits * (DOCSP-7918): tech review feedback * (DOCSP-7918): typo * (DOCSP-7918): tech review feedback pt 2 * (DOCSP-7918): fix merge conflicts
1 parent f6a5738 commit 9acbe00

File tree

2 files changed

+180
-31
lines changed

2 files changed

+180
-31
lines changed

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

Lines changed: 83 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,48 @@ content: |
214214
.. include:: /includes/k8s/k8s-persistent-volumes-om.rst
215215
216216
- ``true``
217+
---
218+
title: "Allow external traffic to reach the |onprem| application."
219+
stepnum: 4
220+
level: 4
221+
ref: om-external-connectivity
222+
content: |
223+
224+
By default, the |k8s-op-short| does not create a |k8s| service to
225+
route traffic originating from outside of the |k8s| cluster to the
226+
|onprem| application.
227+
228+
To access the |onprem| application, you can:
229+
230+
- Configure the |k8s-op-short| to create a |k8s| service.
231+
- Create a |k8s| service manually. MongoDB recommends using a
232+
``LoadBalancer`` |k8s| service if your cloud provider supports it.
233+
- If you're using OpenShift, use
234+
`Routes <https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/routes.html>`__.
235+
- Use a third-party service, such as Istio.
236+
237+
The simplest method is to configure the |k8s-op-short| to create a
238+
|k8s| service to route external traffic to the |onprem| application:
239+
240+
a. Add the ``spec.``:opsmgrkube:`~spec.externalConnectivity` setting
241+
to the |k8s-obj| specification.
242+
243+
#. Add the following settings to the |k8s-obj| specification
244+
to configure the |k8s| service that routes external traffic to the
245+
|onprem| application:
246+
247+
- ``spec.externalConnectivity.``:opsmgrkube:`~spec.externalConnectivity.type`
248+
- (optional) ``spec.externalConnectivity.``:opsmgrkube:`~spec.externalConnectivity.port`
249+
250+
To learn how to create a |k8s| :k8sdocs:`service </concepts/services-networking/service/>`
251+
manually, see the |k8s| documentation.
252+
253+
To learn how to route external traffic to the |onprem| application
254+
using a different method, refer to the documentation for your solution.
217255
218256
---
219257
title: "(Optional) Configure any additional settings for an |onprem| deployment."
220-
stepnum: 4
258+
stepnum: 5
221259
level: 4
222260
ref: add-k8s-values
223261
content: |
@@ -251,13 +289,13 @@ content: |
251289
252290
---
253291
title: "Save this file with a ``.yaml`` file extension."
254-
stepnum: 5
292+
stepnum: 6
255293
level: 4
256294
ref: save-object-spec
257295

258296
---
259297
title: "Create your |onprem| instance."
260-
stepnum: 6
298+
stepnum: 7
261299
level: 4
262300
ref: start-k8s-instance
263301
content: |
@@ -271,7 +309,7 @@ content: |
271309
272310
---
273311
title: "Track the status of your |onprem| instance."
274-
stepnum: 7
312+
stepnum: 8
275313
level: 4
276314
ref: track-k8s-instance
277315
content: |
@@ -333,45 +371,60 @@ content: |
333371
ConfigMap <create-k8s-project>`.
334372
335373
---
336-
title: "Access your |onprem| instance from a browser."
337-
stepnum: 8
374+
title: "Access the |onprem| application."
375+
stepnum: 9
338376
level: 4
339377
ref: access-opsmgr-instance
340378
content: |
341-
342-
a. After the resource deploys successfully, find the external port to
343-
your |onprem| instance.
344-
345-
Invoke the following ``kubectl`` command on
346-
``<metadata.name>-svc-external : <metadata.name>`` :
347379
348-
.. code-block:: sh
380+
The steps you take differ based on how you are routing traffic to the
381+
|onprem| application in |k8s|. If you configured the |k8s-op-short| to
382+
create a |k8s| service for you, or you created a |k8s| service
383+
manually, use one of the following methods to access the |onprem|
384+
application:
349385
350-
kubectl get svc <metadata.name>-svc-external -n <namespace>
386+
.. tabs::
351387
352-
The command returns the external port in the ``PORT(S)`` column. In
353-
the following example output, the external port is ``30036``:
388+
.. tab:: External Traffic Routes Using LoadBalancer Service
389+
:tabid: om-loadbalancer-svc-access
354390
355-
.. code-block:: sh
356-
:copyable: false
391+
a. Query your cloud provider to get the |fqdn| of the load
392+
balancer service. See your cloud provider's documentation
393+
for details.
357394
358-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
359-
<metadata.name>-svc-external NodePort 100.66.92.110 <none> 8080:30036/TCP 1d
395+
#. Open a browser window and navigate to the |onprem|
396+
application using the |fqdn| and port number of your load
397+
balancer service.
398+
399+
.. code-block:: sh
400+
:copyable: false
401+
402+
http://ops.example.com:8080
360403
361-
#. Set your firewall rules to allow access from the Internet to the
362-
external port on the host.
404+
#. Log in to |onprem| using the :ref:`admin user credentials
405+
<om-rsrc-prereqs>`.
406+
407+
.. tab:: External Traffic Routed Using NodePort Service
408+
:tabid: om-nodeport-svc-access
363409
364-
#. Open a browser window and navigate to the |onprem| application
365-
using the |fqdn| and port number.
410+
a. Set your firewall rules to allow access from the Internet to
411+
the ``spec.externalConnectivity.``:opsmgrkube:`~spec.externalConnectivity.port`
412+
on the host on which your |k8s| cluster is running.
413+
414+
#. Open a browser window and navigate to the |onprem|
415+
application using the |fqdn| and the
416+
``spec.externalConnectivity.``:opsmgrkube:`~spec.externalConnectivity.port`.
366417
367-
.. code-block:: sh
368-
:copyable: false
418+
.. code-block:: sh
419+
:copyable: false
369420
370-
http://ops.example.com:30036
371-
372-
#. Log in to |onprem| using the :ref:`admin user credentials
373-
<om-rsrc-prereqs>`.
421+
http://ops.example.com:30036
422+
423+
#. Log in to |onprem| using the :ref:`admin user credentials <om-rsrc-prereqs>`.
374424
425+
To learn how to access the |onprem| application using a different
426+
traffic routing method, refer to the documentation for your solution.
427+
375428
---
376429
title: "Create credentials for the Kubernetes Operator."
377430
stepnum: 9

source/reference/k8s-operator-om-specification.txt

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,103 @@ Optional |onprem| Resource Settings
371371
</reference/configuration/>` for property names and descriptions.
372372
Each property takes a value of type ``string``.
373373

374+
.. opsmgrkube:: spec.externalConnectivity
375+
376+
*Type*: collection
377+
378+
Configuration object that enables external connectivity to |onprem|.
379+
If provided, the |k8s-op-short| creates a |k8s| :k8sdocs:`service
380+
</concepts/services-networking/service/>` that allows traffic
381+
originating from outside of the |k8s| cluster to reach the |onprem|
382+
application.
383+
384+
If not provided, the |k8s-op-short| does not create a |k8s| service.
385+
You must create one manually or use a third-party solution that
386+
enables you to route external traffic to the |onprem| application in
387+
your |k8s| cluster.
388+
389+
.. opsmgrkube:: spec.externalConnectivity.type
390+
391+
*Type*: string
392+
393+
The |k8s| service :k8sdocs:`ServiceType
394+
</concepts/services-networking/service/#publishing-services-service-types>`
395+
that exposes |onprem| outside of |k8s|.
396+
397+
*Required* if :opsmgrkube:`spec.externalConnectivity.type` is
398+
present.
399+
400+
Accepted values are: ``LoadBalancer`` and ``NodePort``.
401+
``LoadBalancer`` is recommended if your cloud provider supports it.
402+
Use ``NodePort`` for local deployments.
403+
404+
.. opsmgrkube:: spec.externalConnectivity.port
405+
406+
*Type*: integer
407+
408+
If :opsmgrkube:`spec.externalConnectivity.type` is ``NodePort``, the
409+
port on the |k8s| service from which external traffic is routed to
410+
the |onprem| application.
411+
412+
.. note::
413+
414+
You must configure your network's firewall to allow traffic over
415+
this port.
416+
417+
If :opsmgrkube:`spec.externalConnectivity.type` is ``LoadBalancer``,
418+
the load balancer resource that your cloud provider creates routes
419+
traffic to this port on the |k8s| service. You don't need to provide
420+
this value. |k8s| uses an open port within the default range and
421+
handles internal traffic routing appropriately.
422+
423+
In both cases, if this value is not provided, the |k8s| service
424+
routes traffic from an available port within the following default
425+
range to the |onprem| application: ``30000``-``32767``.
426+
427+
.. opsmgrkube:: spec.externalConnectivity.loadBalancerIP
428+
429+
*Type*: string
430+
431+
The IP address the ``LoadBalancer`` |k8s| service uses when the
432+
|k8s-op-short| creates it.
433+
434+
This setting can only be used if your cloud provider supports it and
435+
:opsmgrkube:`spec.externalConnectivity.type` is ``LoadBalancer``. To
436+
learn more about the
437+
:k8sdocs:`Type LoadBalancer
438+
</concepts/services-networking/service/#loadbalancer>`, see the
439+
|k8s| documentation.
440+
441+
.. opsmgrkube:: spec.externalConnectivity.externalTrafficPolicy
442+
443+
*Type*: string
444+
445+
Routing policy for external traffic to the |onprem| |k8s| service.
446+
The service routes external traffic to node-local or cluster-wide
447+
endpoints depending the value of this setting.
448+
449+
Accepted values are: ``Cluster`` and ``Local``. To learn which of
450+
values meet your requirements, see :k8sdocs:`Source IPs in Kubernetes
451+
</tutorials/services/source-ip/>` in the |k8s| documentation.
452+
453+
.. note::
454+
If you select ``Cluster``, the ``Source-IP`` of your clients are
455+
lost during the network hops that happen at the |k8s|
456+
network boundary.
457+
458+
.. opsmgrkube:: spec.externalConnectivity.annotations
459+
460+
*Type*: collection
461+
462+
Key-value pairs that allow you to provide cloud provider-specific
463+
configuration settings.
464+
465+
To learn more about :k8sdocs:`Annotations
466+
</concepts/overview/working-with-objects/annotations/>` and
467+
:k8sdocs:`TLS support on AWS
468+
</concepts/services-networking/service/#ssl-support-on-aws>`, see the
469+
|k8s| documentation.
470+
374471
.. opsmgrkube:: spec.applicationDatabase.passwordSecretKeyRef.name
375472

376473
*Type*: string
@@ -380,7 +477,6 @@ Optional |onprem| Resource Settings
380477
|onprem| uses this password to :ref:`authenticate to the Application
381478
Database <app-db-auth>`.
382479

383-
384480
.. opsmgrkube:: spec.applicationDatabase.passwordSecretKeyRef.key
385481

386482
*Type*: string

0 commit comments

Comments
 (0)