portworx / terraform-ibm-portworx-enterprise

Terraform Module to manage Portworx Enterprise on IKS in IBM Cloud
Apache License 2.0
1 stars 5 forks source link

Terraform Module for Portworx Enterprise on IBM Cloud

IBM Cloud provides an option to provision Portworx Enterprise on IKS cluster through IBM Catalog. This repo hosts the terraform module which can be used in conjunction with existing terraform scripts to provision Portworx Enterprise on IKS.

Usage

Include the below module definition in a .tf file to deploy Portworx Enterprise with the default values.

Please take a look at the default values in the Input Variables section to understand the default behavior of this module.

module "portworx-enterprise" {
  source                    = "portworx/portworx-enterprise/ibm"
  region                    = "us-east"
  cluster_name              = "my-iks-cluster"
  resource_group            = "my-resource-group"
  ibmcloud_api_key          = "my-api-key"
}

Features

This terraform module provides the following features for seamless adoption:

Getting Started

Please refer to the Getting Started Guide to install Portworx Enterprise on an IKS using Cloud Drives. This guide outlines the steps to set up an environment and deploy on IBM Cloud.

Examples

The below hyperlinks guide you to understand and demonstrate the features and capabilities of this Terraform module:

Requirements

The following are requirements needed to be installed on the host machine where the terraform commands will be issued. wget, curl and jq libraries are needed as some bash scripts are required for validation checks.

Refer to the table below for more details:

Name Version
terraform 0.13 and above
kubectl 1.22.0 and above
jq 1.6 and above
curl 7.79.1 and above
wget 1.21.3 and above
tar 3.5.1 and above
ibmcloud 2.10.0 and above

Providers

Following providers are used by our modules, to manage resources on IBM Cloud:

Name Version
ibm-cloud/ibm v1.45.0 and above
hashicorp/random 3.4.3 and above
hashicorp/null 3.1.1 and above

Resources

Below resources and data sources are created to manage the resources of terraform module:

Name Type
ibm_resource_instance.portworx resource
null_resource.portworx_destroy resource
null_resource.portworx_upgrade resource
null_resource.preflight_checks resource
random_uuid.unique_id resource
ibm_container_cluster.cluster_classic data source
ibm_container_cluster_worker.worker_classic data source
ibm_container_vpc_cluster.cluster data source
ibm_container_vpc_cluster_worker.worker data source
ibm_resource_group.group data source

Input Variables

Below list of input variables can be provided to the Terraform module. There are some default values already set for this module which can be overridden otherwise. Please read through the description and default values before handling advanced scenarios of using this module.

Name Description Type Default Required
classic_infra IKS is on classic infra, true or false bool false no
cloud_drive_options cloud_drive_options = {
max_storage_node_per_zone : "Maximum number of storage nodes per zone, you can set this to the maximum worker nodes in your cluster"
num_cloud_drives : "Number of cloud drives per zone, Max: 3"
cloud_drives_sizes : "Size of Cloud Drive in GB, ex: [50, 60, 70], the number of elements should be same as the value of num_cloud_drives"
storage_classes : "Storage Classes for each cloud drive, ex: [ "ibmc-vpc-block-10iops-tier", "ibmc-vpc-block-5iops-tier", "ibmc-vpc-block-general-purpose"], the number of elements should be same as the value of num_cloud_drives"
}
object({
max_storage_node_per_zone = number
num_cloud_drives = number
cloud_drives_sizes = list(number)
storage_classes = list(string)
})
{
"cloud_drives_sizes": [
100
],
"max_storage_node_per_zone": 1,
"num_cloud_drives": 1,
"storage_classes": [
"ibmc-vpc-block-10iops-tier"
]
}
no
cluster_name Name of existing IKS cluster string n/a yes
etcd_options etcd_options = {
use_external_etcd : "Do you want to create an external_etcd? true or false"
etcd_secret_name : "The name of etcd secret certificate, required only when external etcd is used"
external_etcd_connection_url : "The connection string with port number for the etcd, required only when external etcd is used"
}
object({
use_external_etcd = bool
etcd_secret_name = string
external_etcd_connection_url = string
})
{
"etcd_secret_name": null,
"external_etcd_connection_url": null,
"use_external_etcd": false
}
no
ibmcloud_api_key Get the ibmcloud api key from https://cloud.ibm.com/iam/apikeys string n/a yes
portworx_csi Enable Portworx CSI, true or false bool false no
portworx_service_name Name to be provided to the portworx cluster to be deployed string "portworx-enterprise" no
portworx_version Image Version of Portworx Enterprise string "2.11.4" no
pwx_plan Portworx plan type string "px-enterprise" no
region The region Portworx will be installed in: us-south, us-east, eu-gb, eu-de, jp-tok, au-syd, etc. string "us-east" no
resource_group Resource group of existing IKS Cluster string n/a yes
secret_type secret type string "k8s" no
tags Optional Tags to be added, if required. list(string) [] no
upgrade_portworx Upgrade Portworx Version to the respective portworx_version, true or false bool false no
use_cloud_drives Use Cloud Drives, true or false bool true no
namespace Namespace to deploy Portworx Enterprise in the IKS string "kube-system" no
delete_strategy Delete Strategy to be used when uninstalling, use Uninstall or UninstallAndWipe string "Uninstall" no

Output Variables

Table below lists out the output variables to be read or referred after successful application/execution of the Terraform module.

Name Description
associated_iks_cluster_id The id of the IKS Cluster where Portworx-Enterprise was Installed
associated_iks_cluster_name The name of the IKS Cluster where Portworx-Enterprise was Installed
portworx_enterprise_id The ID of the Portworx-Enterprise Resource Instance
portworx_enterprise_service_name The name of the Portworx-Enterprise Resource Instance
portworx_version_installed The version of Portworx-Enterprise Deployed on the Cluster

License

Apache License 2.0 - Copyright 2022 Pure Storage, Inc.