Giter Club home page Giter Club logo

Comments (6)

morgante avatar morgante commented on July 17, 2024 1
  1. For basic auth, I think we should go with enable_basic_auth = false as the default going forward. This will generate a diff for existing module users, but that is acceptable as they can choose to either explicitly encode the desire to enable basic auth or require the new version.

  2. Client certificates sound slightly more destructive and we use them internally, so let's start by adding an enable_client_certificate variable with a default of true.

Also, as per the docs it does seem to be possible to enable cluster cert but disable basic auth so we need to support that scenario: https://www.terraform.io/docs/providers/google/r/container_cluster.html#client_certificate_config

from terraform-google-kubernetes-engine.

morgante avatar morgante commented on July 17, 2024

Yes, I think it's a good idea to add this. Do you think we would want it as a default?

from terraform-google-kubernetes-engine.

miles- avatar miles- commented on July 17, 2024

Yes I think it makes sense to disable both by default. When creating a cluster via the GCP console, both options have recommendations to disable them. Also, they will be disabled by default in 1.12.

2018-12-04-17 16 49

from terraform-google-kubernetes-engine.

coryodaniel avatar coryodaniel commented on July 17, 2024

So I looked into this a few notes/questions:

Our best practices guide says to name variables in the positive. Defaulting to disabled basic auth (enable_basic_auth = false) will be a breaking change for deployed clusters. Enabling it by default requires a username and password. The default pw for GKE is 'admin', but the password is random.

So:

  • Do we want to enable basic auth by default but, change their password using tf resource "random"
  • Do we want to name this in the negative? Default: disable_basic_auth = false to prevent breakage?

Disabling client certificates is a destructive change. My assumption is we should name this in the positive and enable it by default. This is a catch-22 since its destructive to change. If we enable client certs by default, its not destructive to current users, but opts new users into a bad practice with the chance of being destructive if they did not notice the variable. If we disable it by default, its destructive to current users, but sets the module up for best practices.

It may also be worth noting, to set the certificate explicitly, its a nested setting that also requires the username and password be set. So its technically not possible to make this non-breaking for current users, because as soon as the certificate setting is set, the username and password has to be as well.

For setting basic auth, which do you prefer?

enable_basic_auth = true
basic_auth_username = "xxx"
basic_auth_password = "xxx"
basic_auth {
  username = "xxx"
  password = "yyy"
}

The later would assume if the map is empty, it is disabled.

@morgante

from terraform-google-kubernetes-engine.

coryodaniel avatar coryodaniel commented on July 17, 2024

Yep, I got that support in my first pass! Thanks for the input, sounds like a good approach to me.

from terraform-google-kubernetes-engine.

aaron-lane avatar aaron-lane commented on July 17, 2024

Fixed by #40.

from terraform-google-kubernetes-engine.

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.