https://github.com/ionos-cloud/cdktf-go-k8s-example
An example to deploy managed K8s with CDK for Terraform
https://github.com/ionos-cloud/cdktf-go-k8s-example
cdk-examples cdktf go golang
Last synced: 2 months ago
JSON representation
An example to deploy managed K8s with CDK for Terraform
- Host: GitHub
- URL: https://github.com/ionos-cloud/cdktf-go-k8s-example
- Owner: ionos-cloud
- License: mit
- Created: 2022-09-02T21:11:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-09T18:52:35.000Z (over 2 years ago)
- Last Synced: 2024-12-26T08:27:41.868Z (4 months ago)
- Topics: cdk-examples, cdktf, go, golang
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CDK for Terraform Go Example
[](https://github.com/ionos-cloud/event-gateway/actions/workflows/main.yml)
[](https://twitter.com/SwiftOnSecurity)
[](https://github.com/auchenberg/volkswagen)[Cloud Development Kit for Terraform](https://www.terraform.io/cdktf) (CDKTF) allows you to use familiar programming languages to define and provision infrastructure. This is a simple example of how to use CDKTF to create a [Kubernetes](https://kubernetes.io/) cluster on the IONOS Cloud using the [Go](https://go.dev/) programming language.
:warning: What is deployed is a [Managed Kubernetes Cluster](https://cloud.ionos.de/managed/kubernetes) on the IONOS Cloud :cloud:. Please be aware that this is not for free.
## Prerequisites
* [IONOS Account](https://cloud.ionos.com/)
* [Terraform](https://www.terraform.io/)
* [CDK for Terrform](https://learn.hashicorp.com/tutorials/terraform/cdktf-install?in=terraform/cdktf#install-cdktf)
* [Object Storage Bucket](https://cloud.ionos.com/storage/object-storage)Optional:
* [`ionosctl`](https://github.com/ionos-cloud/ionosctl)
## Deploy
You either have to set the `IONOS_USERNAME` and `IONOS_PASSWORD` or `IONOS_TOKEN` environment variables.
> `ionosctl token create` and `ionosctl token get --token-id` gives you a token.
Furtheremore, you have to set `ACCESS_KEY`, `SECRET_KEY` and `BUCKET_NAME` environment variables for the Terraform backend.
> This can be used in combination with a GitHub Action to deploy the cluster.
> The bucket should have versioning enabled.
```bash
cdktf deploy
```## Tests
Writing tests for CDKTF is easy with Go.
```bash
go test ./...
```If you are finished experimenting you can do a simple `cdktf destroy` to clean up.
## License
[MIT](/LICENSE)