-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add local copy of Ondat due to Ondat repository migration (#1523)
- Loading branch information
1 parent
d72de41
commit 12e4395
Showing
9 changed files
with
374 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Ondat add-on for EKS Blueprints | ||
|
||
## Introduction | ||
|
||
[Ondat](https://ondat.io) is a highly scalable Kubernetes data plane that | ||
provides stateful storage for applications. This blueprint installs Ondat | ||
on Amazon Elastic Kubernetes Service (AWS EKS). | ||
|
||
## Key features | ||
|
||
1. Hyperconverged (all nodes have storage) or centralised (some nodes | ||
have storage), Kubernetes-native storage on any infrastructure - use the | ||
same code and storage features in-cloud and on-premises! | ||
1. Best-in-class performance, availability and security - individually | ||
encrypted volumes, performs better than competitors and synchronizes replicas | ||
quickly and efficiently. | ||
1. NFS (RWX) support allowing for performant sharing of volumes across multiple | ||
workloads. | ||
1. Free tier with 1TiB of storage under management plus unlimited replicas | ||
1. Larger storage capacity and business support available in paid product | ||
|
||
Find out more in our [documentation](https://docs.ondat.io/docs/concepts/)! | ||
|
||
## Examples | ||
|
||
See [blueprints](blueprints/). | ||
|
||
<!--- BEGIN_TF_DOCS ---> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.15.1 | | ||
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.11.0 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_helm_addon"></a> [helm\_addon](#module\_helm\_addon) | github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons/helm-addon | v4.1.0 | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [kubernetes_namespace.ondat](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | ||
| [kubernetes_namespace.storageos](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | | ||
| [kubernetes_secret.etcd](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | | ||
| [kubernetes_storage_class.etcd](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/storage_class) | resource | | ||
| [aws_eks_cluster.eks](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster) | data source | | ||
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_addon_context"></a> [addon\_context](#input\_addon\_context) | Input configuration for the addon | <pre>object({<br> aws_caller_identity_account_id = string<br> aws_caller_identity_arn = string<br> aws_eks_cluster_endpoint = string<br> aws_partition_id = string<br> aws_region_name = string<br> eks_cluster_id = string<br> eks_oidc_issuer_url = string<br> eks_oidc_provider_arn = string<br> tags = map(string)<br> irsa_iam_role_path = optional(string)<br> irsa_iam_permissions_boundary = optional(string)<br> })</pre> | n/a | yes | | ||
| <a name="input_admin_password"></a> [admin\_password](#input\_admin\_password) | Password for the Ondat admin user | `string` | `"storageos"` | no | | ||
| <a name="input_admin_username"></a> [admin\_username](#input\_admin\_username) | Username for the Ondat admin user | `string` | `"storageos"` | no | | ||
| <a name="input_create_cluster"></a> [create\_cluster](#input\_create\_cluster) | Determines if the StorageOSCluster and secrets should be created | `bool` | `true` | no | | ||
| <a name="input_etcd_ca"></a> [etcd\_ca](#input\_etcd\_ca) | The PEM encoded CA for Ondat's etcd | `string` | `null` | no | | ||
| <a name="input_etcd_cert"></a> [etcd\_cert](#input\_etcd\_cert) | The PEM encoded client certificate for Ondat's etcd | `string` | `null` | no | | ||
| <a name="input_etcd_endpoints"></a> [etcd\_endpoints](#input\_etcd\_endpoints) | A list of etcd endpoints for Ondat | `list(string)` | `[]` | no | | ||
| <a name="input_etcd_key"></a> [etcd\_key](#input\_etcd\_key) | The PEM encoded client key for Ondat's etcd | `string` | `null` | no | | ||
| <a name="input_helm_config"></a> [helm\_config](#input\_helm\_config) | Helm provider config for the ondat addon | `any` | `{}` | no | | ||
| <a name="input_irsa_permissions_boundary"></a> [irsa\_permissions\_boundary](#input\_irsa\_permissions\_boundary) | IAM Policy ARN for IRSA IAM role permissions boundary | `string` | `""` | no | | ||
| <a name="input_irsa_policies"></a> [irsa\_policies](#input\_irsa\_policies) | IAM policy ARNs for Ondat IRSA | `list(string)` | `[]` | no | | ||
| <a name="input_manage_via_gitops"></a> [manage\_via\_gitops](#input\_manage\_via\_gitops) | Determines if the add-on should be managed via GitOps. | `bool` | `false` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_argocd_gitops_config"></a> [argocd\_gitops\_config](#output\_argocd\_gitops\_config) | Configuration used for managing the add-on with ArgoCD | | ||
<!--- END_TF_DOCS ---> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
locals { | ||
name = "ondat" | ||
service_account_name = "storageos-operator" | ||
|
||
ondat_etcd_endpoints = length(var.etcd_endpoints) == 0 ? "storageos-etcd.storageos-etcd:2379" : join(",", var.etcd_endpoints) | ||
|
||
argocd_gitops_config = { | ||
enable = true | ||
etcdClusterCreate = length(var.etcd_endpoints) == 0 | ||
serviceAccountName = local.service_account_name | ||
clusterSecretRefName = "storageos-api" | ||
clusterAdminUsername = "storageos" | ||
clusterAdminPassword = "storageos" | ||
clusterKvBackendAddress = local.ondat_etcd_endpoints | ||
clusterKvBackendTLSSecretName = length(kubernetes_secret.etcd) > 0 ? kubernetes_secret.etcd[0].metadata[0].name : "storageos-etcd-secret" | ||
clusterKvBackendTLSSecretNamespace = length(kubernetes_secret.etcd) > 0 ? kubernetes_secret.etcd[0].metadata[0].namespace : "storageos" | ||
clusterNodeSelectorTermKey = "storageos-node" | ||
clusterNodeSelectorTermValue = "1" | ||
etcdNodeSelectorTermKey = "storageos-etcd" | ||
etcdNodeSelectorTermValue = "1" | ||
} | ||
|
||
default_helm_values = [templatefile("${path.module}/values.yaml", | ||
{ | ||
ondat_service_account_name = local.service_account_name, | ||
ondat_nodeselectorterm_key = "storageos-node" | ||
ondat_nodeselectorterm_value = "1" | ||
etcd_nodeselectorterm_key = "storageos-etcd" | ||
etcd_nodeselectorterm_value = "1" | ||
ondat_admin_username = "storageos", | ||
ondat_admin_password = "storageos", | ||
ondat_credential_secret_name = "storageos-api", | ||
etcd_address = local.ondat_etcd_endpoints, | ||
}, | ||
)] | ||
} | ||
|
||
module "helm_addon" { | ||
source = "../helm-addon" | ||
|
||
manage_via_gitops = var.manage_via_gitops | ||
|
||
helm_config = merge( | ||
{ | ||
name = local.name | ||
chart = "ondat" | ||
repository = "https://ondat.github.io/charts" | ||
version = "0.2.5" | ||
namespace = kubernetes_namespace.ondat.metadata[0].name | ||
timeout = "1500" | ||
create_namespace = false | ||
values = local.default_helm_values | ||
description = "Ondat Helm Chart for storage" | ||
}, | ||
var.helm_config | ||
) | ||
|
||
set_values = [ | ||
{ | ||
name = "ondat-operator.serviceAccount.name" | ||
value = local.service_account_name | ||
}, | ||
{ | ||
name = "ondat-operator.cluster.create" | ||
value = var.create_cluster | ||
}, | ||
{ | ||
name = "ondat-operator.cluster.secretRefName" | ||
value = "storageos-api" | ||
}, | ||
{ | ||
name = "ondat-operator.cluster.kvBackend.address" | ||
value = local.ondat_etcd_endpoints | ||
}, | ||
{ | ||
name = "ondat-operator.cluster.kvBackend.tlsSecretName" | ||
value = length(kubernetes_secret.etcd) > 0 ? kubernetes_secret.etcd[0].metadata[0].name : "storageos-etcd-secret" | ||
}, | ||
{ | ||
name = "ondat-operator.cluster.kvBackend.tlsSecretNamespace" | ||
value = length(kubernetes_secret.etcd) > 0 ? kubernetes_secret.etcd[0].metadata[0].namespace : "storageos" | ||
}, | ||
{ | ||
name = "etcd-cluster-operator.cluster.create" | ||
value = length(var.etcd_endpoints) == 0 | ||
}, | ||
] | ||
|
||
set_sensitive_values = [ | ||
{ | ||
name = "cluster.admin.username", | ||
value = var.admin_username | ||
}, | ||
{ | ||
name = "cluster.admin.password", | ||
value = var.admin_password | ||
}, | ||
] | ||
|
||
irsa_config = { | ||
create_kubernetes_namespace = false | ||
kubernetes_namespace = kubernetes_namespace.ondat.metadata[0].name | ||
|
||
create_kubernetes_service_account = true | ||
kubernetes_service_account = local.service_account_name | ||
|
||
iam_role_path = "/" | ||
tags = var.addon_context.tags | ||
eks_cluster_id = var.addon_context.eks_cluster_id | ||
irsa_iam_policies = var.irsa_policies | ||
irsa_iam_permissions_boundary = var.irsa_permissions_boundary | ||
} | ||
|
||
addon_context = var.addon_context | ||
} | ||
|
||
resource "kubernetes_namespace" "ondat" { | ||
metadata { | ||
name = "ondat" | ||
labels = { | ||
app = local.name | ||
} | ||
} | ||
} | ||
|
||
################################################################################ | ||
# Secrets | ||
################################################################################ | ||
|
||
resource "kubernetes_namespace" "storageos" { | ||
count = length(var.etcd_endpoints) == 0 ? 0 : 1 | ||
|
||
metadata { | ||
name = "storageos" | ||
labels = { | ||
app = local.name | ||
} | ||
} | ||
} | ||
|
||
resource "kubernetes_secret" "etcd" { | ||
count = length(var.etcd_endpoints) == 0 ? 0 : 1 | ||
|
||
metadata { | ||
name = "storageos-etcd" | ||
namespace = kubernetes_namespace.storageos[0].metadata[0].name | ||
labels = { | ||
app = local.name | ||
} | ||
} | ||
|
||
data = { | ||
"etcd-client-ca.crt" = var.etcd_ca | ||
"etcd-client.crt" = var.etcd_cert | ||
"etcd-client.key" = var.etcd_key | ||
} | ||
|
||
type = "kubernetes.io/storageos" | ||
} | ||
|
||
################################################################################ | ||
# Storage Class | ||
################################################################################ | ||
|
||
resource "kubernetes_storage_class" "etcd" { | ||
count = length(var.etcd_endpoints) == 0 ? 1 : 0 | ||
|
||
metadata { | ||
name = "etcd" | ||
} | ||
|
||
storage_provisioner = "ebs.csi.aws.com" | ||
reclaim_policy = "Retain" | ||
volume_binding_mode = "WaitForFirstConsumer" | ||
|
||
parameters = { | ||
type = "gp3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "argocd_gitops_config" { | ||
description = "Configuration used for managing the add-on with ArgoCD" | ||
value = var.manage_via_gitops ? local.argocd_gitops_config : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ondat-operator: | ||
serviceAccount: | ||
create: false | ||
name: ${ondat_service_account_name} | ||
cluster: | ||
create: true | ||
secretRefName: ${ondat_credential_secret_name} | ||
admin: | ||
username: ${ondat_admin_username} | ||
password: ${ondat_admin_password} | ||
kvBackend: | ||
address: ${etcd_address} | ||
nodeSelectorTerm: | ||
key: ${ondat_nodeselectorterm_key} | ||
value: ${ondat_nodeselectorterm_value} | ||
etcd-cluster-operator: | ||
cluster: | ||
replicas: 5 | ||
storage: 15Gi | ||
storageclass: etcd | ||
nodeSelectorTerm: | ||
key: ${etcd_nodeselectorterm_key} | ||
value: ${etcd_nodeselectorterm_value} | ||
ondat: | ||
namespace: storageos |
Oops, something went wrong.
12e4395
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
╷
│ Error: Failed to download module
│
│ Could not download module "ondat" (infra/modules/kubernetes-addons/main.tf:364) source code from "git::https://github.com/ondat/terraform-eksblueprints-ondat-addon?ref=0.1.2": error downloading
│ 'https://github.com/ondat/terraform-eksblueprints-ondat-addon?ref=0.1.2': /usr/bin/git exited with 128: Cloning into '.terraform/modules/kubernetes_addons.ondat'...
│ remote: Repository `ondat/terraform-eksblueprints-ondat-addon' is disabled.
│ remote: Please ask the owner to check their account.
│ fatal: unable to access 'https://github.com/ondat/terraform-eksblueprints-ondat-addon/': The requested URL returned error: 403