https://github.com/a0s/terraform-elastic-cloud-on-kubernetes
Direct conversion of the ECK project's kubectl manifests to Terraform using tfk8s.
https://github.com/a0s/terraform-elastic-cloud-on-kubernetes
Last synced: 5 months ago
JSON representation
Direct conversion of the ECK project's kubectl manifests to Terraform using tfk8s.
- Host: GitHub
- URL: https://github.com/a0s/terraform-elastic-cloud-on-kubernetes
- Owner: a0s
- Created: 2023-07-11T21:46:55.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T22:14:07.000Z (about 3 years ago)
- Last Synced: 2025-04-12T06:37:53.564Z (over 1 year ago)
- Language: HCL
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elastic Cloud on Kubernetes (ECK) for Terraform
This is a direct conversion of the ECK project's kubectl manifests to Terraform using tfk8s.
Original files:
* https://download.elastic.co/downloads/eck/2.8.0/crds.yaml
* https://download.elastic.co/downloads/eck/2.8.0/operator.yaml
## Modifications from original
* Namespace name is extracted as variable `namespace` for potential adjustments.
* Removed creation of namespace inside. It should be created outside of this module. Namespace should have label `name` with their name.
## Using with CDK for Terraform (CDKTF)
Add path to module into cdktf.json
```json
{
"terraformModules": [
{
"name": "elastic-cloud-on-kubernetes",
"source": "../terraform-elastic-cloud-on-kubernetes"
}
]
}
```
Run `cdktf get` to generate content in `.gen`.
Your stack can look like:
```typescript
import {
ElasticCloudOnKubernetes,
ElasticCloudOnKubernetesConfig
} from ".gen/modules/elastic-cloud-on-kubernetes"
const eck = new ElasticCloudOnKubernetes(this, "eck", {
providers: [config.k8sProvider],
namespace: config.namespace
})
new Manifest(this, "elasticsearch", {
provider: config.k8sProvider,
dependsOn: [eck],
manifest: {
apiVersion: "elasticsearch.k8s.elastic.co/v1",
kind: "Elasticsearch",
metadata: {
namespace: config.namespace,
name: "elasticsearch",
},
spec: {
version: "8.8.2",
nodeSets: [
{
name: "default",
count: "1",
config: {
"node.store.allow_mmap": "false"
}
}
]
}
}
})
```
## Links
* https://github.com/elastic/cloud-on-k8s
* https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html