Code Monkey home page Code Monkey logo

Comments (7)

ebensom avatar ebensom commented on June 26, 2024 1

@Disper Yes AFAIK this is expected behavior, as tokens obtained via Gardener TokenRequest are OIDC tokens with exp field. When new token is requested via API, the old tokens are not invalidated, they are still valid until the expiration.

from infrastructure-manager.

akgalwas avatar akgalwas commented on June 26, 2024

The POC code is here: kyma-project/control-plane#3017.
What needs to be done to productise the POC:

  • Code fetching the dynamic kubeconfig from Gardener
  • Kubeconfig for shoot cluster, and control plane needs to be passed
  • Tests, and code implemented as a part of POC must be reviewed, and refined.
  • Cluster CR status needs to be set when error occurs, or the operator successfully creates/rotates secret

from infrastructure-manager.

akgalwas avatar akgalwas commented on June 26, 2024

Workplan:

  • Secret creation
  • Secret deletion
  • Secret rotation functionality
    • #48 @Disper, @akgalwas
    • Setup time-based reconciliation. Note: by default Kubebuilder runs reconciliation once in 10 hours. Please see this. If kubeconfig validity time is set to 24h, we are probably safe with the default settings. We should consider this thoroughly to avoid losing events.
  • Additional stuff

from infrastructure-manager.

akgalwas avatar akgalwas commented on June 26, 2024

There is couple of things to be done as follow up:

  • Context management : we probably should pass the context from reconciliation loop everywhere
  • Getting secret : there is no need to find the secret by label, as GardenerCluster spec contains secret name

from infrastructure-manager.

Disper avatar Disper commented on June 26, 2024

Currently, the secret is rotated both periodically and if operator.kyma-project.io/force-kubeconfig-rotation is added to the GardenCluster CR. That means that secrets

  • .data.config is regenerated
  • .metadata.annotations.operator.kyma-project.io/last-sync is updated with the time of the rotation.

from infrastructure-manager.

Disper avatar Disper commented on June 26, 2024

As of now, if you will get the kubeconfig from that secret using e.g. k get secret kubeconfig-md-im -n kcp-system -ojsonpath={.data.config} | base64 -D > ~/kubeconfig.yaml, you will still be able to access the cluster with that kubeconfig after the secret is rotated. Regardless if the rotation happened periodically or was forced.

@ebensom could you help us understand whether this is acceptable behavior?

from infrastructure-manager.

Disper avatar Disper commented on June 26, 2024

We will do a tiny refactoring in the code to reflect that we're not doing the revocation, but rotation.
But it will not affect the functionality so I'm closing the issue.

from infrastructure-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.