docs: add guide to retrieve outgoing ske ip-address (#476)
Co-authored-by: Mauritz Uphoff <mauritz.uphoff@mail.schwarz>
This commit is contained in:
parent
2810545ef7
commit
3c530797b4
2 changed files with 116 additions and 0 deletions
58
docs/guides/outgoing_ske_ip.md
Normal file
58
docs/guides/outgoing_ske_ip.md
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
---
|
||||||
|
page_title: "Retrieving SKE outgoing IP address with Terraform"
|
||||||
|
---
|
||||||
|
# Retrieving SKE outgoing IP address with Terraform
|
||||||
|
|
||||||
|
To retrieve the outgoing IP address of your STACKIT Kubernetes Engine (SKE) cluster, you have two options based on your initial SKE setup.
|
||||||
|
|
||||||
|
## Default Setup
|
||||||
|
|
||||||
|
If you haven't configured any organisational network settings, you can use the default setup. It is necessary to use the Terraform OpenStack provider in conjunction with the STACKIT provider.
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
resource "stackit_ske_cluster" "ske_cluster_01" {
|
||||||
|
project_id = var.project_id
|
||||||
|
name = var.cluster_name
|
||||||
|
kubernetes_version_min = "1.29.6"
|
||||||
|
node_pools = [...]
|
||||||
|
}
|
||||||
|
|
||||||
|
data "openstack_networking_router_v2" "router" {
|
||||||
|
name = "shoot--${substr(sha256(var.project_id), 0, 10)}--${var.cluster_name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
cluster_outgoing_ip = data.openstack_networking_router_v2.router.external_fixed_ip.0.ip_address
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Organizational SNA Setup
|
||||||
|
|
||||||
|
If your project is within an organizational STACKIT Network Area (SNA), you can attach a `stackit_network` to the SKE cluster:
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
resource "stackit_network" "ske_network" {
|
||||||
|
project_id = var.project_id
|
||||||
|
name = "ske-network"
|
||||||
|
nameservers = ["1.1.1.1", "8.8.8.8"]
|
||||||
|
ipv4_prefix_length = 24
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "stackit_ske_cluster" "ske_cluster_01" {
|
||||||
|
project_id = var.project_id
|
||||||
|
name = var.cluster_name
|
||||||
|
kubernetes_version_min = "1.29.6"
|
||||||
|
node_pools = [...]
|
||||||
|
|
||||||
|
network = {
|
||||||
|
id = stackit_network.ske_network.network_id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
cluster_outgoing_ip = stackit_network.ske_network.public_ip
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In both examples, the attribute `cluster_outgoing_ip` will provide the outgoing IP address of your cluster.
|
||||||
|
The specific configuration depends on whether your setup is within an organizational SNA or a default setup.
|
||||||
58
templates/guides/outgoing_ske_ip.md.tmpl
Normal file
58
templates/guides/outgoing_ske_ip.md.tmpl
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
---
|
||||||
|
page_title: "Retrieving SKE outgoing IP address with Terraform"
|
||||||
|
---
|
||||||
|
# Retrieving SKE outgoing IP address with Terraform
|
||||||
|
|
||||||
|
To retrieve the outgoing IP address of your STACKIT Kubernetes Engine (SKE) cluster, you have two options based on your initial SKE setup.
|
||||||
|
|
||||||
|
## Default Setup
|
||||||
|
|
||||||
|
If you haven't configured any organisational network settings, you can use the default setup. It is necessary to use the Terraform OpenStack provider in conjunction with the STACKIT provider.
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
resource "stackit_ske_cluster" "ske_cluster_01" {
|
||||||
|
project_id = var.project_id
|
||||||
|
name = var.cluster_name
|
||||||
|
kubernetes_version_min = "1.29.6"
|
||||||
|
node_pools = [...]
|
||||||
|
}
|
||||||
|
|
||||||
|
data "openstack_networking_router_v2" "router" {
|
||||||
|
name = "shoot--${substr(sha256(var.project_id), 0, 10)}--${var.cluster_name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
cluster_outgoing_ip = data.openstack_networking_router_v2.router.external_fixed_ip.0.ip_address
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Organizational SNA Setup
|
||||||
|
|
||||||
|
If your project is within an organizational STACKIT Network Area (SNA), you can attach a `stackit_network` to the SKE cluster:
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
resource "stackit_network" "ske_network" {
|
||||||
|
project_id = var.project_id
|
||||||
|
name = "ske-network"
|
||||||
|
nameservers = ["1.1.1.1", "8.8.8.8"]
|
||||||
|
ipv4_prefix_length = 24
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "stackit_ske_cluster" "ske_cluster_01" {
|
||||||
|
project_id = var.project_id
|
||||||
|
name = var.cluster_name
|
||||||
|
kubernetes_version_min = "1.29.6"
|
||||||
|
node_pools = [...]
|
||||||
|
|
||||||
|
network = {
|
||||||
|
id = stackit_network.ske_network.network_id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
cluster_outgoing_ip = stackit_network.ske_network.public_ip
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In both examples, the attribute `cluster_outgoing_ip` will provide the outgoing IP address of your cluster.
|
||||||
|
The specific configuration depends on whether your setup is within an organizational SNA or a default setup.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue