Skip to content

Commit

Permalink
FFixes bug for passing custom helmchart values (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: pragrawal10 <[email protected]>

Signed-off-by: pragrawal10 <[email protected]>
  • Loading branch information
pragrawal-px authored Oct 21, 2022
1 parent c933370 commit baa4e78
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 140 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export TF_VAR_aws_secret_access_key=<access-key-secret>
portworx_helm_config = {
set_sensitive = [
{
name = "awsAccessKeyId"
name = "aws.accessKeyId"
value = var.aws_access_key_id
},
{
name = "awsSecretAccessKey"
name = "aws.secretAccessKey"
value = var.aws_secret_access_key
}
]
Expand Down Expand Up @@ -144,17 +144,17 @@ module "eks_blueprints_kubernetes_addons" {
#Add this line to enable Portworx
enable_portworx = true
enable_portworx = true
}
```

To customize Portworx installation, pass the configuration parameter as an list of objects as shown below:

```
enable_portworx = true
enable_portworx = true
portworx_helm_config = {
set_sensitive = [
set = [
{
name = "clusterName"
value = "testCluster"
Expand Down
14 changes: 7 additions & 7 deletions blueprint/getting_started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,26 @@ The following table lists the configurable parameters of the Portworx chart and
| Parameter | Description | Default |
|-----------|-------------| --------|
| `imageVersion` | The image tag to pull | "2.11.0" |
| `useAWSMarketplace` | Set this variable to true if you intend to use AWS marketplace license for Portworx | "false" |
| `aws.marketplace` | Set this variable to true if you intend to use AWS marketplace license for Portworx | "false" |
| `clusterName` | Portworx Cluster Name| mycluster |
| `drives` | Semicolon separated list of drives to be used for storage. (example: "/dev/sda;/dev/sdb" or "type=gp2,size=200;type=gp3,size=500") | "type=gp2,size=200"|
| `useInternalKVDB` | Boolean variable to set internal KVDB on/off | true |
| `internalKVDB` | Boolean variable to set internal KVDB on/off | true |
| `kvdbDevice` | specify a separate device to store KVDB data, only used when internalKVDB is set to true | type=gp2,size=150 |
| `envVars` | Semicolon separated list of environment variables that are going to be exported to portworx. (example: MYENV1=val1;MYENV2=val2) | "" |
| `maxStorageNodesPerZone` | The maximum number of storage nodes desired per zone| 3 |
| `useOpenshiftInstall` | boolean variable to install Portworx on Openshift .| false |
| `openshiftInstall` | boolean variable to install Portworx on Openshift .| false |
| `etcdEndPoint` | The ETCD endpoint. Should be in the format etcd:http://(your-etcd-endpoint):2379. If there are multiple etcd endpoints they need to be semicolon separated. | "" |
| `dataInterface` | Name of the interface ```<ethX>```.| none |
| `managementInterface` | Name of the interface ```<ethX>```.| none |
| `useStork` | [Storage Orchestration for Hyperconvergence](https://github.com/libopenstorage/stork).| true |
| `stork` | Boolean variable to enable Stork. [Storage Orchestration for Hyperconvergence](https://github.com/libopenstorage/stork).| true |
| `storkVersion` | Optional: version of Stork. For example: 2.11.0, when it's empty Portworx operator picks up the version based on the Portworx version. | "2.11.0" |
| `customRegistryURL` | URL where to pull Portworx image from | "" |
| `registrySecret` | Image registry credentials to pull Portworx Images from a secure registry | "" |
| `licenseSecret` | Kubernetes secret name that has Portworx licensing information | "" |
| `monitoring` | Enable Monitoring on Portworx cluster | false |
| `enableCSI` | Enable CSI | false |
| `enableAutopilot` | Enable Autopilot | false |
| `KVDBauthSecretName` | Refer https://docs.portworx.com/reference/etcd/securing-with-certificates-in-kubernetes to create a kvdb secret and specify the name of the secret here| none |
| `csi` | Boolen variable to enable CSI | false |
| `aut` | Boolen variable to enable Autopilot | false |
| `kvdb.authSecretName` | Refer https://docs.portworx.com/reference/etcd/securing-with-certificates-in-kubernetes to create a kvdb secret and specify the name of the secret here| none |
| `deleteType` | Specify which strategy to use while Uninstalling Portworx. "Uninstall" values only removes Portworx but with "UninstallAndWipe" value all data from your disks including the Portworx metadata is also wiped permanently | UninstallAndWipe |


Expand Down
7 changes: 3 additions & 4 deletions blueprint/getting_started/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ module "eks_blueprints" {
node_group_name = "eksblueprint_nodegroup_med_1"
instance_types = ["t2.medium"]
min_size = 3
desired_size = 3
max_size = 3
subnet_ids = module.vpc.private_subnets
}
Expand All @@ -121,18 +122,16 @@ module "eks_blueprints_kubernetes_addons" {
eks_oidc_provider = module.eks_blueprints.oidc_provider
eks_cluster_version = module.eks_blueprints.eks_cluster_version



enable_portworx = true

portworx_helm_config = {
set_sensitive = [
{
name = "awsAccessKeyId"
name = "aws.accessKeyId"
value = var.aws_access_key_id
},
{
name = "awsSecretAccessKey"
name = "aws.secretAccessKey"
value = var.aws_secret_access_key
}
]
Expand Down
40 changes: 0 additions & 40 deletions blueprint/getting_started/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# output "vpc_private_subnet_cidr" {
# description = "VPC private subnet CIDR"
# value = module.vpc.private_subnets_cidr_blocks
# }

# output "vpc_public_subnet_cidr" {
# description = "VPC public subnet CIDR"
# value = module.vpc.public_subnets_cidr_blocks
# }

# output "vpc_cidr" {
# description = "VPC CIDR"
# value = module.vpc.vpc_cidr_block
# }

output "eks_cluster_id" {
description = "EKS cluster ID"
value = module.eks_blueprints.eks_cluster_id
Expand All @@ -29,28 +14,3 @@ output "region" {
description = "AWS region"
}

# output "eks_managed_nodegroups" {
# description = "EKS managed node groups"
# value = module.eks_blueprints.managed_node_groups
# }

# output "eks_managed_nodegroup_ids" {
# description = "EKS managed node group ids"
# value = module.eks_blueprints.managed_node_groups_id
# }

# output "eks_managed_nodegroup_arns" {
# description = "EKS managed node group arns"
# value = module.eks_blueprints.managed_node_group_arn
# }

# output "eks_managed_nodegroup_role_name" {
# description = "EKS managed node group role name"
# value = module.eks_blueprints.managed_node_group_iam_role_names
# }

# output "eks_managed_nodegroup_status" {
# description = "EKS managed node group status"
# value = module.eks_blueprints.managed_node_groups_status
# }

7 changes: 0 additions & 7 deletions blueprint/getting_started/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,4 @@ terraform {
version = ">= 2.4.1"
}
}

# ## Used for end-to-end testing on project; update to suit your needs
# backend "s3" {
# bucket = "terraform-ssp-github-actions-state"
# region = "us-west-2"
# key = "e2e/eks-cluster-with-new-vpc/terraform.tfstate"
# }
}
34 changes: 16 additions & 18 deletions blueprint/portworx_with_iam_policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,32 @@ Result: A storage cluster with set name becomes active which implies Portworx cl

## Portworx Configuration

The following tables lists the configurable parameters of the Portworx chart and their default values.


| Parameter | Description | Default |
|-----------|-------------| --------|
| `imageVersion` | The image tag to pull | "2.11.0" |
| `useAWSMarketplace` | Set this variable to true if you wish to use AWS marketplace license for Portworx | "false" |
| `aws.marketplace` | Set this variable to true if you intend to use AWS marketplace license for Portworx | "false" |
| `clusterName` | Portworx Cluster Name| mycluster |
| `drives` | Semi-colon seperated list of drives to be used for storage. (example: "/dev/sda;/dev/sdb" or "type=gp2,size=200;type=gp3,size=500") | "type=gp2,size=200"|
| `useInternalKVDB` | boolen variable to set internal KVDB on/off | true |
| `kvdbDevice` | specify a separate device to store KVDB data, only used when internalKVDB is set to true | type=gp2,size=150 |
| `envVars` | semi-colon-separated list of environment variables that will be exported to portworx. (example: MYENV1=val1;MYENV2=val2) | "" |
| `drives` | Semicolon separated list of drives to be used for storage. (example: "/dev/sda;/dev/sdb" or "type=gp2,size=200;type=gp3,size=500") | "type=gp2,size=200"|
| `internalKVDB` | Boolean variable to set internal KVDB on/off | true |
| `kvdbDevice` | specify a separate device to store KVDB data, only used when internalKVDB is set to true | type=gp2;size=150 |
| `envVars` | Semicolon separated list of environment variables that are going to be exported to Portworx. (example: MYENV1=val1;MYENV2=val2) | "" |
| `maxStorageNodesPerZone` | The maximum number of storage nodes desired per zone| 3 |
| `useOpenshiftInstall` | boolen variable to install Portworx on Openshift .| false |
| `etcdEndPoint` | The ETCD endpoint. Should be in the format etcd:http://(your-etcd-endpoint):2379. If there are multiple etcd endpoints they need to be ";" seperated. | "" |
| `dataInterface` | Name of the interface <ethX>.| none |
| `managementInterface` | Name of the interface <ethX>.| none |
| `useStork` | [Storage Orchestration for Hyperconvergence](https://github.com/libopenstorage/stork).| true |
| `storkVersion` | Optional: version of Stork. For eg: 2.11.0, when it's empty Portworx operator will pick up version according to Portworx version. | "2.11.0" |
| `openshiftInstall` | boolean variable to install Portworx on Openshift .| false |
| `etcdEndPoint` | The ETCD endpoint. Should be in the format etcd:http://(your-etcd-endpoint):2379. If there are multiple etcd endpoints they need to be semicolon separated. | "" |
| `dataInterface` | Name of the interface ```<ethX>```.| none |
| `managementInterface` | Name of the interface ```<ethX>```.| none |
| `stork` | Boolean variable to enable Stork. [Storage Orchestration for Hyperconvergence](https://github.com/libopenstorage/stork).| true |
| `storkVersion` | Optional: version of Stork. For example: 2.11.0, when it's empty Portworx operator picks up the version based on the Portworx version. | "2.11.0" |
| `customRegistryURL` | URL where to pull Portworx image from | "" |
| `registrySecret` | Image registery credentials to pull Portworx Images from a secure registry | "" |
| `registrySecret` | Image registry credentials to pull Portworx Images from a secure registry | "" |
| `licenseSecret` | Kubernetes secret name that has Portworx licensing information | "" |
| `monitoring` | Enable Monitoring on Portworx cluster | false |
| `enableCSI` | Enable CSI | false |
| `enableAutopilot` | Enable Autopilot | false |
| `KVDBauthSecretName` | Refer https://docs.portworx.com/reference/etcd/securing-with-certificates-in-kubernetes to create a kvdb secret and specify the name of the secret here| none |
| `csi` | Boolen variable to enable CSI | false |
| `aut` | Boolen variable to enable Autopilot | false |
| `kvdb.authSecretName` | Refer https://docs.portworx.com/reference/etcd/securing-with-certificates-in-kubernetes to create a kvdb secret and specify the name of the secret here| none |
| `deleteType` | Specify which strategy to use while Uninstalling Portworx. "Uninstall" values only removes Portworx but with "UninstallAndWipe" value all data from your disks including the Portworx metadata is also wiped permanently | UninstallAndWipe |


## Uninstalling Portworx:

This section describes how to uninstall Portworx and remove its Kubernetes specs. When uninstalling, you may choose to either keep the the data on your drives, or wipe them completely.
Expand Down
42 changes: 0 additions & 42 deletions blueprint/portworx_with_iam_policy/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,3 @@ output "region" {
value = local.region
description = "AWS region"
}

# output "vpc_private_subnet_cidr" {
# description = "VPC private subnet CIDR"
# value = module.vpc.private_subnets_cidr_blocks
# }

# output "vpc_public_subnet_cidr" {
# description = "VPC public subnet CIDR"
# value = module.vpc.public_subnets_cidr_blocks
# }

# output "vpc_cidr" {
# description = "VPC CIDR"
# value = module.vpc.vpc_cidr_block
# }


# output "eks_managed_nodegroups" {
# description = "EKS managed node groups"
# value = module.eks_blueprints.managed_node_groups
# }

# output "eks_managed_nodegroup_ids" {
# description = "EKS managed node group ids"
# value = module.eks_blueprints.managed_node_groups_id
# }

# output "eks_managed_nodegroup_arns" {
# description = "EKS managed node group arns"
# value = module.eks_blueprints.managed_node_group_arn
# }

# output "eks_managed_nodegroup_role_name" {
# description = "EKS managed node group role name"
# value = module.eks_blueprints.managed_node_group_iam_role_names
# }

# output "eks_managed_nodegroup_status" {
# description = "EKS managed node group status"
# value = module.eks_blueprints.managed_node_groups_status
# }

7 changes: 0 additions & 7 deletions blueprint/portworx_with_iam_policy/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,4 @@ terraform {
version = ">= 2.4.1"
}
}

# ## Used for end-to-end testing on project; update to suit your needs
# backend "s3" {
# bucket = "terraform-ssp-github-actions-state"
# region = "us-west-2"
# key = "e2e/eks-cluster-with-new-vpc/terraform.tfstate"
# }
}
10 changes: 1 addition & 9 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@ locals {
namespace = "kube-system"
service_account_name = "${local.name}-sa-${random_string.id.result}"

aws_marketplace_config = try(var.helm_config["set"][index(var.helm_config.set.*.name, "useAWSMarketplace")], null)
aws_marketplace_config = try(var.helm_config["set"][index(var.helm_config.set.*.name, "aws.marketplace")], null)
use_aws_marketplace = local.aws_marketplace_config != null ? local.aws_marketplace_config["value"] : false

set_values = [
{
name = "useAWSMarketplace"
value = local.use_aws_marketplace
}
]


default_helm_config = {
name = local.name
description = "A Helm chart for portworx"
Expand Down
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module "helm_addon" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons/helm-addon"

addon_context = var.addon_context
set_values = local.set_values
helm_config = local.helm_config
irsa_config = local.irsa_config
}

0 comments on commit baa4e78

Please sign in to comment.