|
| 1 | +.. _atlasnetworkpeering-custom-resource: |
| 2 | + |
| 3 | +======================================= |
| 4 | +``AtlasNetworkPeering`` 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 ``AtlasNetworkPeering`` custom resource defines a :ref:`network |
| 16 | +peering connection <ak8so-network-peering>` for a |service| |
| 17 | +project. Network peering connections isolate traffic from public |
| 18 | +networks for added security. |
| 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 peering connection. |
| 26 | +- Updates an existing network peering connection. |
| 27 | + |
| 28 | +.. note:: |
| 29 | + |
| 30 | + A network peering connection can belong only to one project. To |
| 31 | + define the same network peering connection for multiple projects, |
| 32 | + create custom resource definitions for each project. |
| 33 | + |
| 34 | +Examples |
| 35 | +-------- |
| 36 | + |
| 37 | +The following examples illustrate configurations for |
| 38 | +``AtlasNetworkPeering`` CRDs. |
| 39 | + |
| 40 | +- The basic example configuration defines a resource that you manage |
| 41 | + with the same |ak8so| instance with which you manage its parent |
| 42 | + {+service+} project. |
| 43 | + |
| 44 | +- The :ref:`Independent CRD <ak8so-independent-crd>` example |
| 45 | + configures the same |vpc| peering connection as the basic example, |
| 46 | + but for a {+service+} project that you manage outside of the |ak8so| |
| 47 | + instance with which you manage the |vpc| peering connection. |
| 48 | + |
| 49 | +.. _atlasnetworkpeering-example-basic: |
| 50 | + |
| 51 | +Basic Example |
| 52 | +~~~~~~~~~~~~~ |
| 53 | + |
| 54 | +The following example shows an ``AtlasNetworkPeering`` custom resource |
| 55 | +that defines the ``green-leaf-peering`` connection between the |
| 56 | +``my-project`` project |vpc| and your {+aws+} |vpc|. To manage this |
| 57 | +resource in the same |ak8so| instance as its parent {+service+} |
| 58 | +project, you must identify the project with ``projectRef`` instead of |
| 59 | +``externalProjectRef``. |
| 60 | + |
| 61 | +.. code-block:: |
| 62 | + |
| 63 | + apiVersion: atlas.mongodb.com/v1 |
| 64 | + kind: AtlasNetworkPeering |
| 65 | + metadata: |
| 66 | + name: green-leaf-peering |
| 67 | + spec: |
| 68 | + projectRef: |
| 69 | + name: my-project |
| 70 | + namespace: my-operator-namespace |
| 71 | + containerRef: |
| 72 | + id: 72a6d2a69388ba121943ae27 |
| 73 | + id: 72a6d2a69388ba121943ae27 |
| 74 | + provider: AWS |
| 75 | + awsConfiguration: |
| 76 | + accepterRegionName: us-east-1 |
| 77 | + awsAccountId: 389226183042 |
| 78 | + routeTableCiderBlock: 10.0.0.0/21 |
| 79 | + vpcId: vpc-abc |
| 80 | + |
| 81 | +Independent CRD Example |
| 82 | +~~~~~~~~~~~~~~~~~~~~~~~ |
| 83 | + |
| 84 | +The following example shows an ``AtlasNetworkPeering`` |
| 85 | +:ref:`independent CRD <ak8so-independent-crd>` that configures the |
| 86 | +same |vpc| peering connection defined by the :ref:`Basic Example |
| 87 | +<atlasnetworkpeering-example-basic>`. To enable resource management |
| 88 | +independent of the parent project, you must use an |
| 89 | +``externalProjectRef`` instead of a ``projectRef``, and you must |
| 90 | +supply a ``connectionSecret`` directly since this resource can't |
| 91 | +inherit API credentials from its parent project. |
| 92 | + |
| 93 | +.. code-block:: |
| 94 | + |
| 95 | + apiVersion: atlas.mongodb.com/v1 |
| 96 | + kind: AtlasNetworkPeering |
| 97 | + metadata: |
| 98 | + name: green-leaf-peering |
| 99 | + spec: |
| 100 | + externalProjectRef: |
| 101 | + projectId: 66e2f2b621571b7e69a89b66 |
| 102 | + connectionSecret: |
| 103 | + name: atlas-connection-secret |
| 104 | + containerRef: |
| 105 | + id: 72a6d2a69388ba121943ae27 |
| 106 | + id: 72a6d2a69388ba121943ae27 |
| 107 | + provider: AWS |
| 108 | + awsConfiguration: |
| 109 | + accepterRegionName: us-east-1 |
| 110 | + awsAccountId: 389226183042 |
| 111 | + routeTableCiderBlock: 10.0.0.0/21 |
| 112 | + vpcId: vpc-abc |
| 113 | + |
| 114 | +Parameters |
| 115 | +---------- |
| 116 | + |
| 117 | +This section describes the ``AtlasNetworkPeering`` parameters |
| 118 | +available in this custom resource definition. |
| 119 | + |
| 120 | +.. setting:: metadata.name |
| 121 | + |
| 122 | + *Type*: string |
| 123 | + |
| 124 | + *Required* |
| 125 | + |
| 126 | + Name that the :ref:`atlasnetworkpeering-custom-resource` uses to add |
| 127 | + this network peering connection to a project. |
| 128 | + |
| 129 | +.. setting:: metadata.namespace |
| 130 | + |
| 131 | + *Type*: string |
| 132 | + |
| 133 | + *Optional* |
| 134 | + |
| 135 | + Namespace other than ``default`` that you want to contain the |
| 136 | + ``AtlasNetworkPeering`` custom resource. |
| 137 | + |
| 138 | +.. setting:: spec.connectionSecret.name |
| 139 | + |
| 140 | + *Type*: string |
| 141 | + |
| 142 | + *Conditional* |
| 143 | + |
| 144 | + Name of the opaque |k8s-secret| that contains the organization ID |
| 145 | + and :ref:`API keys <about-org-api-keys>` that |ak8so| uses to |
| 146 | + :ref:`connect <ak8so-access-to-atlas-ref>` to |service|. If |
| 147 | + unspecified, |ak8so| defaults to one of the following options: |
| 148 | + |
| 149 | + - The ``spec.connectionSecretRef.name`` parameter of the parent |
| 150 | + ``atlasProject`` |
| 151 | + - The default ``global`` secret, if you haven't defined the |
| 152 | + ``spec.connectionSecretRef.name`` for the parent ``atlasProject`` |
| 153 | + |
| 154 | + This parameter is required for :ref:`independent CRDs |
| 155 | + <ak8so-independent-crd>`. |
| 156 | + |
| 157 | + .. include:: /includes/fact-ak8so-label-secret.rst |
| 158 | + |
| 159 | +.. setting:: spec.containerRef.id |
| 160 | + |
| 161 | + *Type*: string |
| 162 | + |
| 163 | + *Conditional* |
| 164 | + |
| 165 | + If this resource represents a new network peering connection, omit |
| 166 | + this parameter. |
| 167 | + |
| 168 | + ID of the existing network peering container. Provide this field |
| 169 | + only if you want this resource to manage an existing network |
| 170 | + peering connection within |ak8so|. If you prefer that this resource |
| 171 | + starts managing a |k8s| local resource, use the |
| 172 | + ``spec.containerRef.name`` parameter. |
| 173 | + |
| 174 | +.. setting:: spec.containerRef.name |
| 175 | + |
| 176 | + *Type*: string |
| 177 | + |
| 178 | + *Conditional* |
| 179 | + |
| 180 | + Name of an existing network peering container which you manage with |
| 181 | + a |k8s| local resource in your project namespace. Provide this |
| 182 | + field only if you want this resource to manage a |k8s| local |
| 183 | + resource. If you prefer that this resource starts managing a network |
| 184 | + peering connection already managed by |ak8so|, use the |
| 185 | + ``spec.containerRef.id`` parameter. If this resource represents a |
| 186 | + new network peering connection, omit this field. |
| 187 | + |
| 188 | +.. setting:: spec.externalProjectRef.id |
| 189 | + |
| 190 | + *Type*: string |
| 191 | + |
| 192 | + *Conditional* |
| 193 | + |
| 194 | + ID of the project to which the network peering connection |
| 195 | + belongs. You must specify the project ID of an existing :ref:`Atlas |
| 196 | + Project <manage-projects>`. You must specify this parameter for network |
| 197 | + peering connections that belong to projects managed by either: |
| 198 | + |
| 199 | + - A different instance of |ak8so| |
| 200 | + - Tooling other than |ak8so| |
| 201 | + |
| 202 | + For deployments that belong to projects managed by |
| 203 | + the same instance of |ak8so|, use ``spec.projectRef.name``. These |
| 204 | + parameters are mutually exclusive with each other. |
| 205 | + |
| 206 | + A network peering connection can belong to only one project. To |
| 207 | + define the same network peering connection for multiple projects, |
| 208 | + create custom resource definitions for each project. |
| 209 | + |
| 210 | +.. setting:: spec.projectRef.name |
| 211 | + |
| 212 | + *Type*: string |
| 213 | + |
| 214 | + *Conditional* |
| 215 | + |
| 216 | + Name of the project to which the network peering connection |
| 217 | + belongs. You must specify an existing |
| 218 | + :ref:`atlasproject-custom-resource`. This parameter applies only to |
| 219 | + network peering connections that belong to projects managed by the |
| 220 | + same instance |ak8so|. |
| 221 | + |
| 222 | + For deployments that belong to projects managed by either: |
| 223 | + |
| 224 | + - a different instance of |ak8so| |
| 225 | + - tooling other than |ak8so| |
| 226 | + |
| 227 | + use ``spec.externalProjectRef.id``. These parameters are mutually |
| 228 | + exclusive with each other. |
| 229 | + |
| 230 | + A network peering connection can belong only to one project. To |
| 231 | + define the same network peering connection for multiple projects, |
| 232 | + create custom resource definitions for each project. |
| 233 | + |
| 234 | +.. setting:: spec.projectRef.namespace |
| 235 | + |
| 236 | + *Type*: string |
| 237 | + |
| 238 | + *Conditional* |
| 239 | + |
| 240 | + Namespace in which the :ref:`atlasproject-custom-resource` |
| 241 | + specified in ``spec.projectRef.name`` exists. |
| 242 | + |
| 243 | + Do not set this parameter for deployments that belong to projects |
| 244 | + managed by either: |
| 245 | + |
| 246 | + - a different instance of |ak8so| |
| 247 | + - tooling other than |ak8so| |
| 248 | + |
| 249 | +.. setting:: spec.id |
| 250 | + |
| 251 | + *Type*: string |
| 252 | + |
| 253 | + *Conditional* |
| 254 | + |
| 255 | + Unique identifier of the existing network peering connection within |
| 256 | + {+service+}. This parameter is required for and limited to |
| 257 | + scenarios in which |ak8so| assumes management of a pre-existing |
| 258 | + network peering connection. |
| 259 | + |
| 260 | +.. setting:: spec.provider |
| 261 | + |
| 262 | + *Type*: string |
| 263 | + |
| 264 | + *Required* |
| 265 | + |
| 266 | + Cloud provider with which to establish a |vpc| peering |
| 267 | + connection. Must be one of the following: |
| 268 | + |
| 269 | + - ``AWS`` |
| 270 | + - ``Azure`` |
| 271 | + - ``GCP`` |
| 272 | + |
| 273 | +.. setting:: spec.awsConfiguration.accepterRegionName |
| 274 | + |
| 275 | + *Type*: string |
| 276 | + |
| 277 | + *Conditional* |
| 278 | + |
| 279 | + {+aws+} region to which to establish a |vpc| peering |
| 280 | + connection. Required for and limited to {+aws+} connections. |
| 281 | + |
| 282 | +.. setting:: spec.awsConfiguration.awsAccountId |
| 283 | + |
| 284 | + *Type*: string |
| 285 | + |
| 286 | + *Conditional* |
| 287 | + |
| 288 | + Unique identifier of the {+aws+} account to which the connection |
| 289 | + belongs. Required for and limited to {+aws+} connections. |
| 290 | + |
| 291 | +.. setting:: spec.awsConfiguration.routeTableCidrBlock |
| 292 | + |
| 293 | + *Type*: string |
| 294 | + |
| 295 | + *Conditional* |
| 296 | + |
| 297 | + CIDR block of your {+aws+} |vpc|. Required for and limited to |
| 298 | + {+aws+} connections. |
| 299 | + |
| 300 | +.. setting:: spec.awsConfiguration.vpcId |
| 301 | + |
| 302 | + *Type*: string |
| 303 | + |
| 304 | + *Conditional* |
| 305 | + |
| 306 | + Unique identifier of your {+aws+} |vpc|. Required for and limited to |
| 307 | + {+aws+} connections. |
| 308 | + |
| 309 | +.. setting:: spec.azureConfiguration.azureDirectoryId |
| 310 | + |
| 311 | + *Type*: string |
| 312 | + |
| 313 | + *Conditional* |
| 314 | + |
| 315 | + Unique identifier of your |azure| directory. Required for and |
| 316 | + limited to |azure| connections. |
| 317 | + |
| 318 | +.. setting:: spec.azureConfiguration.azureSubscriptionId |
| 319 | + |
| 320 | + *Type*: string |
| 321 | + |
| 322 | + *Conditional* |
| 323 | + |
| 324 | + Unique identifier of your |azure| subscription. Required for and |
| 325 | + limited to |azure| connections. |
| 326 | + |
| 327 | +.. setting:: spec.azureConfiguration.resourceGroupName |
| 328 | + |
| 329 | + *Type*: string |
| 330 | + |
| 331 | + *Conditional* |
| 332 | + |
| 333 | + Name of the |azure| Resource Group to which the connection |
| 334 | + belongs. Required for and limited to |azure| connections. |
| 335 | + |
| 336 | +.. setting:: spec.azureConfiguration.vNetName |
| 337 | + |
| 338 | + *Type*: string |
| 339 | + |
| 340 | + *Conditional* |
| 341 | + |
| 342 | + Name of your |azure| Virtual Network. Required for and limited to |
| 343 | + |azure| connections. |
| 344 | + |
| 345 | +.. setting:: spec.gcpConfiguration.gcpProjectId |
| 346 | + |
| 347 | + *Type*: string |
| 348 | + |
| 349 | + *Conditional* |
| 350 | + |
| 351 | + Name of your {+gcp+} Google project. Required for and limited to |
| 352 | + {+gcp+} connections. |
| 353 | + |
| 354 | +.. setting:: spec.gcpConfiguration.networkName |
| 355 | + |
| 356 | + *Type*: string |
| 357 | + |
| 358 | + *Conditional* |
| 359 | + |
| 360 | + Name of your {+gcp+} network. Required for and limited to |
| 361 | + {+gcp+} connections. |
0 commit comments