Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8s + terraform update #5

Merged
merged 3 commits into from
Jul 29, 2024
Merged

K8s + terraform update #5

merged 3 commits into from
Jul 29, 2024

Conversation

pavelnikolov
Copy link
Owner

  • update terraform
  • add deployment pipeline

Signed-off-by: Pavel Nikolov <me@pavelnikolov.net>
Signed-off-by: Pavel Nikolov <me@pavelnikolov.net>
Copy link

github-actions bot commented Jul 29, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖success

Validation Output

Success! The configuration is valid.


Terraform Plan 📖success

Show Plan

terraform
aws_vpc.main: Refreshing state... [id=vpc-0859106471ca3a3b8]
aws_iam_policy.test-policy: Refreshing state... [id=arn:aws:iam::881752951086:policy/test-policy]
aws_eip.nat: Refreshing state... [id=eipalloc-03a608929afe7b101]
aws_iam_policy.eks_cluster_autoscaler: Refreshing state... [id=arn:aws:iam::881752951086:policy/eks-cluster-autoscaler]
aws_iam_role.demo: Refreshing state... [id=eks-cluster-demo]
aws_iam_role.nodes: Refreshing state... [id=eks-node-group-nodes]
aws_iam_role_policy_attachment.nodes-AmazonEKSWorkerNodePolicy: Refreshing state... [id=eks-node-group-nodes-20240728211039386700000002]
aws_iam_role_policy_attachment.nodes-AmazonEKS_CNI_Policy: Refreshing state... [id=eks-node-group-nodes-20240728211039437300000004]
aws_iam_role_policy_attachment.nodes-AmazonEC2ContainerRegistryReadOnly: Refreshing state... [id=eks-node-group-nodes-20240728211039409200000003]
aws_iam_role_policy_attachment.demo-AmazonEKSClusterPolicy: Refreshing state... [id=eks-cluster-demo-20240728211039334000000001]
aws_subnet.public-a: Refreshing state... [id=subnet-0b00e80b0a85fe1d2]
aws_subnet.public-b: Refreshing state... [id=subnet-0b7c18c2eda3b2391]
aws_subnet.private-b: Refreshing state... [id=subnet-06ea1e310188a5e62]
aws_internet_gateway.igw: Refreshing state... [id=igw-0b73b9612a8996377]
aws_subnet.private-a: Refreshing state... [id=subnet-02ef7359515bd80b2]
aws_eks_cluster.demo: Refreshing state... [id=demo]
aws_route_table.public: Refreshing state... [id=rtb-0afa7df18dd42ea40]
aws_nat_gateway.nat: Refreshing state... [id=nat-0ed4fd0ae6211dd64]
aws_route_table.private: Refreshing state... [id=rtb-01e8219d71f426d6a]
data.tls_certificate.eks: Reading...
data.tls_certificate.eks: Read complete after 1s [id=0fec78e2228057fe710f52c784cacb6ef0a852b4]
aws_iam_openid_connect_provider.eks: Refreshing state... [id=arn:aws:iam::881752951086:oidc-provider/oidc.eks.eu-central-1.amazonaws.com/id/7327508F107072136569AB18D5237D73]
data.aws_iam_policy_document.eks_cluster_autoscaler_assume_role_policy: Reading...
data.aws_iam_policy_document.test_oidc_assume_role_policy: Reading...
data.aws_iam_policy_document.eks_cluster_autoscaler_assume_role_policy: Read complete after 0s [id=2592728678]
data.aws_iam_policy_document.test_oidc_assume_role_policy: Read complete after 0s [id=1320951073]
aws_iam_role.eks_cluster_autoscaler: Refreshing state... [id=eks-cluster-autoscaler]
aws_iam_role.test_oidc: Refreshing state... [id=test-oidc]
aws_iam_role_policy_attachment.test_attach: Refreshing state... [id=test-oidc-20240728211857009100000007]
aws_iam_role_policy_attachment.eks_cluster_autoscaler_attach: Refreshing state... [id=eks-cluster-autoscaler-20240728211857205000000008]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_eks_node_group.private-nodes will be created
  + resource "aws_eks_node_group" "private-nodes" {
      + ami_type               = (known after apply)
      + arn                    = (known after apply)
      + capacity_type          = "ON_DEMAND"
      + cluster_name           = "demo"
      + disk_size              = (known after apply)
      + id                     = (known after apply)
      + instance_types         = [
          + "t3.micro",
        ]
      + labels                 = {
          + "role" = "general"
        }
      + node_group_name        = "private-nodes"
      + node_group_name_prefix = (known after apply)
      + node_role_arn          = "arn:aws:iam::881752951086:role/eks-node-group-nodes"
      + release_version        = (known after apply)
      + resources              = (known after apply)
      + status                 = (known after apply)
      + subnet_ids             = [
          + "subnet-02ef7359515bd80b2",
          + "subnet-06ea1e310188a5e62",
        ]
      + tags_all               = (known after apply)
      + version                = (known after apply)

      + scaling_config {
          + desired_size = 2
          + max_size     = 2
          + min_size     = 2
        }

      + update_config {
          + max_unavailable = 1
        }
    }

  # aws_route_table.private is tainted, so must be replaced
-/+ resource "aws_route_table" "private" {
      ~ arn              = "arn:aws:ec2:eu-central-1:881752951086:route-table/rtb-01e8219d71f426d6a" -> (known after apply)
      ~ id               = "rtb-01e8219d71f426d6a" -> (known after apply)
      ~ owner_id         = "881752951086" -> (known after apply)
      ~ propagating_vgws = [] -> (known after apply)
      ~ route            = [
          + {
              + cidr_block                 = "0.0.0.0/0"
              + ipv6_cidr_block            = "::/0"
              + nat_gateway_id             = "nat-0ed4fd0ae6211dd64"
                # (10 unchanged attributes hidden)
            },
        ]
        tags             = {
            "Name" = "private"
        }
        # (2 unchanged attributes hidden)
    }

  # aws_route_table.public is tainted, so must be replaced
-/+ resource "aws_route_table" "public" {
      ~ arn              = "arn:aws:ec2:eu-central-1:881752951086:route-table/rtb-0afa7df18dd42ea40" -> (known after apply)
      ~ id               = "rtb-0afa7df18dd42ea40" -> (known after apply)
      ~ owner_id         = "881752951086" -> (known after apply)
      ~ propagating_vgws = [] -> (known after apply)
      ~ route            = [
          + {
              + cidr_block                 = "0.0.0.0/0"
              + gateway_id                 = "igw-0b73b9612a8996377"
              + ipv6_cidr_block            = "::/0"
                # (10 unchanged attributes hidden)
            },
        ]
        tags             = {
            "Name" = "public"
        }
        # (2 unchanged attributes hidden)
    }

  # aws_route_table_association.private-a will be created
  + resource "aws_route_table_association" "private-a" {
      + id             = (known after apply)
      + route_table_id = (known after apply)
      + subnet_id      = "subnet-02ef7359515bd80b2"
    }

  # aws_route_table_association.private-b will be created
  + resource "aws_route_table_association" "private-b" {
      + id             = (known after apply)
      + route_table_id = (known after apply)
      + subnet_id      = "subnet-06ea1e310188a5e62"
    }

  # aws_route_table_association.public-a will be created
  + resource "aws_route_table_association" "public-a" {
      + id             = (known after apply)
      + route_table_id = (known after apply)
      + subnet_id      = "subnet-0b00e80b0a85fe1d2"
    }

  # aws_route_table_association.public-b will be created
  + resource "aws_route_table_association" "public-b" {
      + id             = (known after apply)
      + route_table_id = (known after apply)
      + subnet_id      = "subnet-0b7c18c2eda3b2391"
    }

Plan: 7 to add, 0 to change, 2 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pusher: @pavelnikolov, Action: pull_request, Working Directory: ./terraform, Workflow: Terraform Plan

@pavelnikolov pavelnikolov changed the title K8s2 K8s + terraform update Jul 29, 2024
@pavelnikolov pavelnikolov merged commit 8d5f406 into main Jul 29, 2024
2 checks passed
@pavelnikolov pavelnikolov deleted the k8s2 branch July 29, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant