{"id":22268574,"url":"https://github.com/azamara/terraform-ncloud-nks-example","last_synced_at":"2025-03-25T15:19:47.324Z","repository":{"id":264409004,"uuid":"893145550","full_name":"azamara/terraform-ncloud-nks-example","owner":"azamara","description":"Terraform example for deploying and managing Ncloud Kubernetes Service (NKS)","archived":false,"fork":false,"pushed_at":"2024-11-24T07:32:22.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T19:05:35.958Z","etag":null,"topics":["kubernetes","navercloud","navercloudplatform","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azamara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-23T16:49:56.000Z","updated_at":"2024-11-24T07:32:26.000Z","dependencies_parsed_at":"2024-11-24T06:00:06.224Z","dependency_job_id":null,"html_url":"https://github.com/azamara/terraform-ncloud-nks-example","commit_stats":null,"previous_names":["azamara/terraform-ncloud-nks-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azamara%2Fterraform-ncloud-nks-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azamara%2Fterraform-ncloud-nks-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azamara%2Fterraform-ncloud-nks-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azamara%2Fterraform-ncloud-nks-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azamara","download_url":"https://codeload.github.com/azamara/terraform-ncloud-nks-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245486358,"owners_count":20623244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","navercloud","navercloudplatform","terraform"],"created_at":"2024-12-03T11:13:16.021Z","updated_at":"2025-03-25T15:19:47.302Z","avatar_url":"https://github.com/azamara.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Ncloud NKS Example\n\nAn example repository for managing Naver Cloud Platform infrastructure using Terraform. This project demonstrates how to provision and manage Ncloud Kubernetes clusters (NKS).\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- **Terraform**: Version `1.0.0` or higher is required.\n- **Homebrew** (for macOS users): To install Terraform via Homebrew.\n\n### Install Terraform CLI\n\n#### Using Homebrew (macOS)\n\n```bash\nbrew tap hashicorp/tap\nbrew install hashicorp/tap/terraform\n```\n\nFor other installation methods, visit the [Terraform Downloads](https://www.terraform.io/downloads.html) page.\n\n## Usage\n\n### Setup API Credentials\n\nFor security reasons, it is recommended to use API credentials from a **Sub Account** with the [`NCP_INFRA_MANAGER`](https://guide.ncloud-docs.com/docs/server-subaccount-vpc) role instead of the main account's API keys.\n\n1. **Create a Sub Account**:\n   - Navigate to the [Ncloud IAM Dashboard](https://console.ncloud.com/iam/dashboard).\n   - Create a new Sub Account and assign the `NCP_INFRA_MANAGER` role.\n\n2. **Generate API Keys**:\n   - In the Sub Account, generate a new API Access Key and Secret Key.\n   - **Keep these credentials secure** and do not share them.\n\n### Create `terraform.tfvars` File\n\nCreate a `terraform.tfvars` file with the following content:\n\n```hcl\naccess_key               = \"YOUR_ACCESS_KEY\"\nsecret_key               = \"YOUR_SECRET_KEY\"\n```\n\n**Note**: Replace the placeholder values with your actual configuration values. Ensure that `terraform.tfvars` is **not** committed to version control to protect sensitive information. Recommend to add `*.tfvars` in `.gitignore`\n\n\n### Initialize Terraform\n\nAfter configuring the provider, navigate to the root directory of the project and initialize Terraform to install necessary plugins.\n\n```bash\nterraform init\n```\n\n### Plan Infrastructure\n\nReview the changes that Terraform will make to your infrastructure.\n\n```bash\nterraform plan\n```\n\n### Apply Infrastructure\n\nApply the planned changes to provision the infrastructure.\n\n```bash\nterraform apply\n```\n\nType `yes` when prompted to confirm the changes.\n\n### Destroy Infrastructure\n\nIf you need to remove all resources created by this configuration, use the following command:\n\n```bash\nterraform destroy\n```\n\nType `yes` when prompted to confirm the destruction.\n\n## Project Structure\n\nThe project is organized into separate directories for better modularity and maintainability.\n\n```\n/\n├── modules\n│   ├── common\n│   ├── network\n│   └── kubernetes\n└── README.md\n```\n\n### Description\n\n- **modules/**: Contains reusable Terraform modules for different components\n  - **common/**: Login Key\n  - **network/**: VPC, subnets, NAT gateways, and networking configurations\n  - **kubernetes/**: NKS cluster setup and configurations\n\n## Additional Information\n\n### Storage Performance Recommendations\n\nWhen configuring CB1 storage on KVM hypervisor, consider the following:\n\n- **CB1 Storage**:\n  - **IOPS Performance** varies based on storage size.\n  - It is recommended to use a minimum of **200GB** to achieve at least **600 IOPS**.\n    - For example, **10GB** provides **100 IOPS**.\n\nRefer to the [Ncloud KVM Storage Specifications](https://guide.ncloud-docs.com/docs/server-spec-vpc#%EC%8A%A4%ED%86%A0%EB%A6%AC%EC%A7%80-%EC%82%AC%EC%96%91) for more details.\n\n## Notes\n\n- **API Credentials Security**:\n  - Always use Sub Account API keys with limited permissions for Terraform operations to minimize security risks.\n  - Avoid using main account API keys.\n\n- **State Management**:\n  - Terraform state files (`terraform.tfstate`) are critical for tracking infrastructure.\n  - Use remote state storage (e.g., Ncloud Object Storage, Terraform Cloud) to manage state securely and facilitate team collaboration.\n\n- **Module Reusability**:\n  - The project is modularized to promote reusability and maintainability.\n  - Customize modules as needed for additional services.\n\n- **Kubernetes Provider Configuration**:\n  - The Kubernetes provider is dynamically configured based on the NKS cluster details.\n  - Ensure that the NKS cluster is successfully created before attempting to manage Kubernetes resources.\n\n- **Terraform Commands**:\n  - **`terraform init`**: Initializes the Terraform working directory and installs necessary plugins.\n  - **`terraform plan`**: Generates an execution plan, showing what actions Terraform will take.\n  - **`terraform apply`**: Applies the changes required to reach the desired state of the configuration.\n  - **`terraform destroy`**: Destroys all resources managed by the Terraform configuration.\n\n## Troubleshooting\n\n### ERROR - `5001183 - You are not using the Cloud Log Analytics service.`\n\n```log\n│ Status: 400 Bad Request, Body: {\n│   \"responseError\": {\n│     \"returnCode\": \"5001183\",\n│     \"returnMessage\": \"You are not using the Cloud Log Analytics service.\"\n│   }\n│ }\n```\n\n- Accept the Terms of Use of [Cloud Log Analytics](https://console.ncloud.com/cla/home)\n\n### ERROR - `5001183 - Subnet CIDR cannot be duplicated within VPC.`\n\n```log\n│ Status: 400 Bad Request, Body: {\n│   \"responseError\": {\n│     \"returnCode\": \"5001183\",\n│     \"returnMessage\": \"Subnet CIDR cannot be duplicated within VPC.\"\n│   }\n│ }\n```\n\n- Retry\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazamara%2Fterraform-ncloud-nks-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazamara%2Fterraform-ncloud-nks-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazamara%2Fterraform-ncloud-nks-example/lists"}