|
| 1 | +.. _atlasnetworkcontainer-custom-resource: |
| 2 | + |
| 3 | +========================================= |
| 4 | +``AtlasNetworkContainer`` Custom Resource |
| 5 | +========================================= |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 2 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +The ``AtlasNetworkContainer`` custom resource defines a :ref:`network |
| 16 | +container <ak8so-network-peering>` for a |service| |
| 17 | +project. You create |vpc| peering connections between network |
| 18 | +containers and the networks hosting your applications. |
| 19 | + |
| 20 | +.. include:: /includes/fact-ak8so-crds.rst |
| 21 | + |
| 22 | +|ak8so| does one of the following actions using the |service| |
| 23 | +:oas-atlas-tag:`Network Peering API Resource </Network-Peering>`: |
| 24 | + |
| 25 | +- Creates a new network container. |
| 26 | +- Updates an existing network container. |
| 27 | + |
| 28 | +Examples |
| 29 | +-------- |
| 30 | + |
| 31 | +The following examples illustrate configurations for |
| 32 | +``AtlasNetworkContainer`` CRDs. |
| 33 | + |
| 34 | +- The basic example configuration defines a resource that you manage |
| 35 | + with the same |ak8so| instance with which you manage its parent |
| 36 | + {+service+} project. |
| 37 | + |
| 38 | +- The :ref:`Independent CRD <ak8so-independent-crd>` example |
| 39 | + configures the same network container as the basic example, |
| 40 | + but for a {+service+} project that you manage outside of the |ak8so| |
| 41 | + instance with which you manage the network container. |
| 42 | + |
| 43 | +.. _atlasnetworkcontainer-example-basic: |
| 44 | + |
| 45 | +Basic Example |
| 46 | +~~~~~~~~~~~~~ |
| 47 | + |
| 48 | +The following shows an ``AtlasNetworkContainer`` custom resource for a |
| 49 | +container named ``my-atlas-nc`` that allows you to create a |vpc| |
| 50 | +peering connection between {+service+} and {+aws+} within the |
| 51 | +``my-project`` project. To manage this resource in the same |ak8so| |
| 52 | +instance as its parent {+service+} project, you must identify the |
| 53 | +project with ``projectRef`` instead of ``externalProjectRef``. |
| 54 | + |
| 55 | +.. code-block:: |
| 56 | + |
| 57 | + apiVersion: atlas.mongodb.com/v1 |
| 58 | + kind: AtlasNetworkContainer |
| 59 | + metadata: |
| 60 | + name: my-atlas-nc |
| 61 | + spec: |
| 62 | + projectRef: |
| 63 | + name: my-project |
| 64 | + namespace: my-operator-namespace |
| 65 | + provider: AWS |
| 66 | + id: 66e2f2b7e69a89b66b621571 |
| 67 | + cidrBlock: 10.11.0.0/16 |
| 68 | + region: US_EAST_1 |
| 69 | + |
| 70 | +Independent CRD Example |
| 71 | +~~~~~~~~~~~~~~~~~~~~~~~ |
| 72 | + |
| 73 | +The following example shows an ``AtlasNetworkContainer`` |
| 74 | +:ref:`independent CRD <ak8so-independent-crd>` that enables |vpc| |
| 75 | +peering under the same parameters enabled by the :ref:`Basic Example |
| 76 | +<atlasnetworkcontainer-example-basic>`. To enable independent |
| 77 | +operation, you must use an ``externalProjectRef`` instead of a |
| 78 | +``projectRef``, and you must supply a ``connectionSecret`` directly |
| 79 | +since this resource can't inherit API credentials from its parent |
| 80 | +project. |
| 81 | + |
| 82 | +.. code-block:: |
| 83 | + |
| 84 | + apiVersion: atlas.mongodb.com/v1 |
| 85 | + kind: AtlasNetworkContainer |
| 86 | + metadata: |
| 87 | + name: my-atlas-nc |
| 88 | + spec: |
| 89 | + externalProjectRef: |
| 90 | + projectId: 66e2f2b621571b7e69a89b66 |
| 91 | + connectionSecret: |
| 92 | + name: atlas-connection-secret |
| 93 | + provider: AWS |
| 94 | + id: 66e2f2b7e69a89b66b621571 |
| 95 | + cidrBlock: 10.11.0.0/16 |
| 96 | + region: US_EAST_1 |
| 97 | + |
| 98 | +Parameters |
| 99 | +---------- |
| 100 | + |
| 101 | +This section describes the ``AtlasNetworkContainer`` parameters |
| 102 | +available in this custom resource definition. |
| 103 | + |
| 104 | +.. setting:: metadata.name |
| 105 | + |
| 106 | + *Type*: string |
| 107 | + |
| 108 | + *Required* |
| 109 | + |
| 110 | + Name that the :ref:`atlasnetworkcontainer-custom-resource` uses to |
| 111 | + add this network container to a project. |
| 112 | + |
| 113 | +.. setting:: metadata.namespace |
| 114 | + |
| 115 | + *Type*: string |
| 116 | + |
| 117 | + *Optional* |
| 118 | + |
| 119 | + Namespace other than ``default`` that you want to contain the |
| 120 | + ``AtlasNetworkContainer`` custom resource. |
| 121 | + |
| 122 | +.. setting:: spec.connectionSecret.name |
| 123 | + |
| 124 | + *Type*: string |
| 125 | + |
| 126 | + *Conditional* |
| 127 | + |
| 128 | + Name of the opaque |k8s-secret| that contains the organization ID |
| 129 | + and :ref:`API keys <about-org-api-keys>` that |ak8so| uses to |
| 130 | + :ref:`connect <ak8so-access-to-atlas-ref>` to |service|. If |
| 131 | + unspecified, |ak8so| defaults to one of the following options: |
| 132 | + |
| 133 | + - The ``spec.connectionSecretRef.name`` parameter of the parent |
| 134 | + ``atlasProject`` |
| 135 | + - The default ``global`` secret, if you haven't defined the |
| 136 | + ``spec.connectionSecretRef.name`` for the parent ``atlasProject`` |
| 137 | + |
| 138 | + This parameter is required for :ref:`independent CRDs |
| 139 | + <ak8so-independent-crd>`. |
| 140 | + |
| 141 | + .. include:: /includes/fact-ak8so-label-secret.rst |
| 142 | + |
| 143 | +.. setting:: spec.externalProjectRef.id |
| 144 | + |
| 145 | + *Type*: string |
| 146 | + |
| 147 | + *Conditional* |
| 148 | + |
| 149 | + ID of the project to which the network container belongs. You must |
| 150 | + specify the project ID of an existing :ref:`Atlas Project |
| 151 | + <manage-projects>`. You must specify this parameter for network |
| 152 | + containers that belong to projects managed by either: |
| 153 | + |
| 154 | + - A different instance of |ak8so| |
| 155 | + - Tooling other than |ak8so| |
| 156 | + |
| 157 | + For deployments that belong to projects managed by the same |
| 158 | + instance of |ak8so|, use ``spec.projectRef.name``. These parameters |
| 159 | + are mutually exclusive with each other. |
| 160 | + |
| 161 | +.. setting:: spec.projectRef.name |
| 162 | + |
| 163 | + *Type*: string |
| 164 | + |
| 165 | + *Conditional* |
| 166 | + |
| 167 | + Name of the project to which the network container belongs. You must |
| 168 | + specify an existing :ref:`atlasproject-custom-resource`. This |
| 169 | + parameter applies only to network containers that belong to projects |
| 170 | + managed by the same instance |ak8so|. |
| 171 | + |
| 172 | + For network containers that belong to projects managed by either: |
| 173 | + |
| 174 | + - a different instance of |ak8so| |
| 175 | + - tooling other than |ak8so| |
| 176 | + |
| 177 | + use ``spec.externalProjectRef.id``. These parameters are mutually |
| 178 | + exclusive with each other. |
| 179 | + |
| 180 | +.. setting:: spec.projectRef.namespace |
| 181 | + |
| 182 | + *Type*: string |
| 183 | + |
| 184 | + *Conditional* |
| 185 | + |
| 186 | + Namespace in which the :ref:`atlasproject-custom-resource` |
| 187 | + specified in ``spec.projectRef.name`` exists. |
| 188 | + |
| 189 | + Don't set this parameter for deployments that belong to projects |
| 190 | + managed by either: |
| 191 | + |
| 192 | + - a different instance of |ak8so| |
| 193 | + - tooling other than |ak8so| |
| 194 | + |
| 195 | +.. setting:: spec.provider |
| 196 | + |
| 197 | + *Type*: string |
| 198 | + |
| 199 | + *Required* |
| 200 | + |
| 201 | + Cloud provider with which to support a |vpc| peering |
| 202 | + connection. Must be one of the following: |
| 203 | + |
| 204 | + - ``AWS`` |
| 205 | + - ``Azure`` |
| 206 | + - ``GCP`` |
| 207 | + |
| 208 | +.. setting:: spec.id |
| 209 | + |
| 210 | + *Type*: string |
| 211 | + |
| 212 | + *Conditional* |
| 213 | + |
| 214 | + Unique identifier of the existing network container within |
| 215 | + {+service+}. This parameter is required for and limited to |
| 216 | + scenarios in which |ak8so| manages a pre-existing network peering |
| 217 | + container. |
| 218 | + |
| 219 | +.. setting:: spec.cidrBlock |
| 220 | + |
| 221 | + *Type*: string |
| 222 | + |
| 223 | + *Required* |
| 224 | + |
| 225 | + CIDR block of your {+service+} network container. |
| 226 | + |
| 227 | +.. setting:: spec.region |
| 228 | + |
| 229 | + *Type*: string |
| 230 | + |
| 231 | + *Conditional* |
| 232 | + |
| 233 | + {+service+} region within which to host the network container. Must |
| 234 | + conform to the {+service+} format for hosting regions. This |
| 235 | + parameter is required for and limited to {+aws+} and |azure| |
| 236 | + network containers. |
| 237 | + |
0 commit comments