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

Process for resizing the cluster #113

Closed
ShurikAg opened this issue Jan 24, 2022 · 7 comments
Closed

Process for resizing the cluster #113

ShurikAg opened this issue Jan 24, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ShurikAg
Copy link

We bootstrapped the cluster following these docs and created the fully-functioning deployment of the app. Eventually, it appeared that we need more nodes.

If I understand correctly, all I need to do is to update main.tf with more nodes and follow the same process of applying the changes. However, when I was trying to run: terraform plan -out priz_prod_cluster.out I got an error:

╷
│ Error: Error retrieving Kubernetes cluster: GET https://api.digitalocean.com/v2/kubernetes/clusters/f9883560-f07a-4e54-9520-97f3210cb47b: 401 Unable to authenticate you
│
│   with module.doks_flux_cd.digitalocean_kubernetes_cluster.primary,
│   on .terraform/modules/doks_flux_cd/create-doks-with-terraform-flux/main.tf line 39, in resource "digitalocean_kubernetes_cluster" "primary":
│   39: resource "digitalocean_kubernetes_cluster" "primary" {

Is that expected? Am I doing anything wrong?

@ShurikAg
Copy link
Author

Looks like I had a wrong do_api_token. Fixed that, and not I am getting the following error:

│ Error: Get "http://localhost/api/v1/namespaces/flux-system": dial tcp [::1]:80: connect: connection refused
│
│   with module.doks_flux_cd.kubernetes_namespace.flux_system,
│   on .terraform/modules/doks_flux_cd/create-doks-with-terraform-flux/main.tf line 52, in resource "kubernetes_namespace" "flux_system":
│   52: resource "kubernetes_namespace" "flux_system" {

@v-ctiutiu v-ctiutiu self-assigned this Jan 25, 2022
@v-ctiutiu
Copy link
Contributor

Hi @ShurikAg

Thanks for submitting the issue.

Let me try to reproduce this scenario and get back to you. Thanks.

@v-ctiutiu
Copy link
Contributor

Hi @ShurikAg

Sorry for the late response. I managed to reproduce your issue, and I'm currently working on a fix. Seems to be a bug in our Terraform module. Will let you know when it's ready.

Thanks.

@v-ctiutiu
Copy link
Contributor

A fix is already in progress, via container-blueprints #25.

@v-ctiutiu
Copy link
Contributor

@ShurikAg

Managed to fix the issue in the upstream repository (where the custom TF module is hosted). All you have to do in your existing TF workspace is this:

  1. Fetch the updated TF module from the upstream repository:

    terraform get -update
  2. Modify the doks_cluster_pool_node_count variable to suit your needs in the main.tf file from your workspace.

  3. Create the plan:

    terraform plan -out priz_prod_cluster.out

At the end Terrraform should show you that it is going to modify the node count from the pool. Something similar to (in my tests, I changed to node count from 1 to 2):

# module.doks_flux_cd.digitalocean_kubernetes_cluster.primary will be updated in-place
  ~ resource "digitalocean_kubernetes_cluster" "primary" {
        id             = "70cbf156-9415-43ba-a7b7-4e8cdfc7dc66"
        name           = "fluxcd-demo"
        tags           = []
        # (14 unchanged attributes hidden)


      ~ node_pool {
            id                = "7131414a-05de-47b5-9396-7853ea2f3312"
            name              = "fluxcd-demo-pool"
          ~ node_count        = 1 -> 2
            tags              = []
            # (7 unchanged attributes hidden)
        }
        # (1 unchanged block hidden)
    }

Please test and let me know how it goes.

Thanks.

@bikram20
Copy link
Collaborator

bikram20 commented Feb 8, 2022

@v-ctiutiu We should mark this as resolved since the PR is already merged.

@v-ctiutiu
Copy link
Contributor

A PR containing the fix was already merged, and it was tested.

Users are encouraged to run terraform get -update, in order to update their local copy of the module.

Closing the issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants