Get information on a IonosCloud K8s Cluster
The k8s cluster data source can be used to search for and return existing k8s clusters.
name
- (Optional) Name or an existing cluster that you want to search for.
id
- (Optional) ID of the cluster you want to search for.
Either name
or id
must be provided. If none, or both are provided, the datasource will return an error.
The following attributes are returned by the datasource:
id
- id of the cluster
name
- name of the cluster
maintenance_window
- A maintenance window comprise of a day of the week and a time for maintenance to be allowed
time
- A clock time in the day when maintenance is allowed
day_of_the_week
- Day of the week when maintenance is allowed
state
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
k8s_version
- Kubernetes version. The provider will ignore changes of patch level.
available_upgrade_versions
- list of available versions for upgrading the cluster
viable_node_pool_versions
- list of versions that may be used for node pools under this cluster
node_pools
- list of the IDs of the node pools in this cluster
kube_config
- Raw Kubernetes configuration; use yamlencode
or jsonencode
when dumping this to a file
api_subnet_allow_list
- access to the K8s API server is restricted to these CIDRs
s3_buckets
- list of S3 bucket configured for K8s usage
config
- structured kubernetes config consisting of a list with 1 item with the following fields:
api_version - Kubernetes API Version
kind - "Config"
current-context - string
clusters - list of
name - name of cluster
cluster - map of
certificate-authority-data - base64 decoded cluster CA data
server - server address in the form https://host:port
contexts - list of
name - context name
context - map of
cluster - cluster name
user - cluster user
users - list of
name - user name
user - map of
token - user token used for authentication
user_tokens
- a convenience map to search the token of a specific user
key - is the user name
value - is the token
server
- cluster server (same as config[0].clusters[0].cluster.server
but provided as an attribute for ease of use)
ca_crt
- base64 decoded cluster certificate authority data (provided as an attribute for direct use)
NOTE: The whole config
node is marked as sensitive.
NOTE: Dumping kube_config
data into files poses a security risk.
Creates and manages IonosCloud Kubernetes Node Pools.
Manages a Kubernetes Node Pool, part of a managed Kubernetes cluster on IonosCloud.
The following arguments are supported:
name
- (Required)[string] The name of the Kubernetes Cluster. This attribute is immutable.
k8s_version
- (Optional)[string] The desired Kubernetes Version. for supported values, please check the API documentation. The provider will ignore changes of patch level.
auto_scaling
- (Optional)[string] Wether the Node Pool should autoscale. For more details, please check the API documentation
min_node_count
- (Required)[int] The minimum number of worker nodes the node pool can scale down to. Should be less than max_node_count
max_node_count
- (Required)[int] The maximum number of worker nodes that the node pool can scale to. Should be greater than min_node_count
lans
- (Optional)[list] A list of numeric LAN id's you want this node pool to be part of. For more details, please check the API documentation, as well as the example above
maintenance_window
- (Optional) See the maintenance_window section in the example above
time
- (Required)[string] A clock time in the day when maintenance is allowed
day_of_the_week
- (Required)[string] Day of the week when maintenance is allowed
datacenter_id
- (Required)[string] A Datacenter's UUID
k8s_cluster_id
- (Required)[string] A k8s cluster's UUID
cpu_family
- (Required)[string] The desired CPU Family - See the API documentation for more information. This attribute is immutable.
availability_zone
- (Required)[string] - The desired Compute availability zone - See the API documentation for more information. This attribute is immutable.
storage_type
-(Required)[string] - The desired storage type - SSD/HDD. This attribute is immutable.
node_count
-(Required)[int] - The desired number of nodes in the node pool
cores_count
-(Required)[int] - The CPU cores count for each node of the node pool. This attribute is immutable.
ram_size
-(Required)[int] - The desired amount of RAM, in MB. This attribute is immutable.
storage_size
-(Required)[int] - The desired amount of storage for each node, in GB. This attribute is immutable.
public_ips
- (Optional)[list] A list of public IPs associated with the node pool; must have at least node_count + 1
elements;
labels
- (Optional)[map] A key/value map of labels
annotations
- (Optional)[map] A key/value map of annotations
A Kubernetes Node Pool resource can be imported using its Kubernetes cluster's uuid as well as its own UUID, both of which you can retreive from the cloud API: resource id
, e.g.:
This can be helpful when you want to import kubernetes node pools which you have already created manually or using other means, outside of terraform, towards the goal of managing them via Terraform
Creates and manages IonosCloud Kubernetes Clusters.
Manages a Managed Kubernetes cluster on IonosCloud.
The following arguments are supported:
name
- (Required)[string] The name of the Kubernetes Cluster.
k8s_version
- (Optional)[string] The desired Kubernetes Version. For supported values, please check the API documentation. The provider will ignore changes of patch level.
maintenance_window
- (Optional) See the maintenance_window section in the example above
time
- (Required)[string] A clock time in the day when maintenance is allowed
day_of_the_week
- (Required)[string] Day of the week when maintenance is allowed
viable_node_pool_versions
- (Computed) List of versions that may be used for node pools under this cluster
api_subnet_allow_list
- (Optional) Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6.
s3_buckets
- (Optional) List of S3 bucket configured for K8s usage. For now it contains only an S3 bucket used to store K8s API audit logs.
A Kubernetes Cluster resource can be imported using its resource id
, e.g.
This can be helpful when you want to import kubernetes clusters which you have already created manually or using other means, outside of terraform.
Please note that every ionoscloud_datacenter
resource you plan to add kubernetes node pools for the cluster to needs to also be specified as a dependency of the Kubernetes cluster by using the depends_on
meta-property (For more details, please see https://www.terraform.io/docs/configuration/resources.html#resource-dependencies). This will ensure that resources are destroyed in the right order. In case you do not do this, you might encounter problems when deleting the Virtual Datacenter. In return, this will give you the ability to keep the data in your PersistentVolumeClaims across NodePools created in the same Virtual Datacenter ionoscloud_datacenter
Get information on a IonosCloud K8s Node Pool
The k8s node pool data source can be used to search for and return existing k8s node pools.
name
- (Optional) Name of an existing node pool that you want to search for.
id
- (Optional) ID of the node pool you want to search for.
Either name
or id
must be provided. If none, or both are provided, the datasource will return an error.
The following attributes are returned by the datasource:
id
- id of the node pool
name
- name of the node pool
k8s_cluster_id
- ID of the cluster this node pool is part of
datacenter_id
- The UUID of the VDC
node_count
- The number of nodes in this node pool
cpu_family
- CPU Family
cores_count
- CPU cores count
ram_size
- The amount of RAM in MB
availability_zone
- The compute availability zone in which the nodes should exist
storage_type
- HDD or SDD
storage_size
- Size of storage
k8s_version
- The kubernetes version
maintenance_window
- A maintenance window comprise of a day of the week and a time for maintenance to be allowed
time
- A clock time in the day when maintenance is allowed
day_of_the_week
- Day of the week when maintenance is allowed
auto_scaling
- The range defining the minimum and maximum number of worker nodes that the managed node group can scale in
min_node_count
- The minimum number of worker nodes the node pool can scale down to
max_node_count
- The maximum number of worker nodes that the node pool can scale to
lans
- A list of Local Area Networks the node pool is a part of
labels
- A map of labels in the form of key -> value
annotations
- A map of annotations in the form of key -> value
available_upgrade_versions
- A list of kubernetes versions available for upgrade
public_ips
- The list of fixed IPs associated with this node pool
state
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"