cd /root/terraform-provider-ncloud-main/examples/nks
참고
https://registry.terraform.io/providers/NaverCloudPlatform/ncloud/2.3.19/docs/resources/nks_cluster
Plan: 2 to add, 0 to change, 0 to destroy.
ncloud_nks_cluster.cluster: Creating...
╷
│ Error: Status: 400 Bad Request, Body: {"error":{"errorCode":400,"message":"Bad Request","details":"Require lbPublicSubnetNo"},"timestamp":"2024-01-04T13:44:40.804Z"}
│
│ with ncloud_nks_cluster.cluster,
│ on main.tf line 59, in resource "ncloud_nks_cluster" "cluster":
│ 59: resource "ncloud_nks_cluster" "cluster"
2
terraform init
terraform plan
terraform apply -auto-approve
╷
│ Error: Unsupported argument
│
│ on main.tf line 72, in resource "ncloud_nks_cluster" "cluster":
│ 72: auth_type = "API"
│
│ An argument named "auth_type" is not expected here.
╵
╷
│ Error: Unsupported block type
│
│ on main.tf line 73, in resource "ncloud_nks_cluster" "cluster":
│ 73: access_entries {
│
│ Blocks of type "access_entries" are not expected here.
[root@quick1 nks]# terraform apply -auto-approve
╷
│ Error: Status: 401 Unauthorized, Body: {"error":{"errorCode":"200","message":"Authentication Failed","details":"This account is not allowed."}}
│
│ with provider["registry.terraform.io/navercloudplatform/ncloud"],
│ on main.tf line 4, in provider "ncloud":
│ 4: provider "ncloud" {
│
변수에
access-key
variable nks_version {
default = "1.28"
}
1.32
login_key_name = ncloud_login_key.key_scn_02.key_name
│ on main.tf line 113, in data "ncloud_root_password" "scn_02_root_password":
│ 113: private_key = ncloud_login_key.key_scn_02.private_key
│
# VPC
resource "ncloud_vpc" "vpc_scn_02" {
name = var.name_scn02
ipv4_cidr_block = "10.0.0.0/16"
}
│ Error: Create Vpc Instance, err params={0xc0002e1658 0xc0004a0608 0xc0004a0638}
│
│ with ncloud_vpc.vpc,
│ on main.tf line 11, in resource "ncloud_vpc" "vpc":
│ 11: resource "ncloud_vpc" "vpc" {
│
│ Status: 400 Bad Request, Body: {
│ "responseError": {
│ "returnCode": "1015009",
│ "returnMessage": "You can no longer create a product."
│ }
│ }
vpc 3개 만들어짐
클러스터 16분
노드 19분
3
node 서브넷이 프라이빗으로 1개 생성됨
lb private 서브넷이 1개 생성됨
lb public 서브넷이 1개 생성됨
1
ncp-iam-authenticator create-kubeconfig --region KR --clusterUuid b01xxxxxxxxxx --output kubeconfig.yaml
2
kubectl create deployment nginx-project --image=nginx --dry-run=client -o yaml --port=80 > nginx-deploy.yaml --kubeconfig kubeconfig.yaml
kubectl apply -f nginx-deploy.yaml --kubeconfig kubeconfig.yaml
kubectl get pods --kubeconfig kubeconfig.yaml
3
참고
https://brunch.co.kr/@topasvga/3183
4
[root@sssssss ~]# vi test.yaml
[root@sssssss ~]# k apply -f test.yaml
kubectl expose deployment deployment-2048 --port=80 --type=LoadBalancer --kubeconfig kubeconfig.yaml
5
pod들을 배포 했으나 NATGW가 없어서 서비스는 안된다.
NATGW 구축하고 프라이빗 서브넷을 NATGW로 라우팅을 추가하자.
https://brunch.co.kr/@topasvga/3599
https://brunch.co.kr/@topasvga/3597