-
Notifications
You must be signed in to change notification settings - Fork 295
Conversation
Since we'll be encrypting things that are not TLS certificates, it's time to rename the function in order to avoid any confusion.
The decryption of the token file should also happen provided it is put at the correct location. There are a couple of FIXME annotations that will be addressed in future commits.
Codecov Report
@@ Coverage Diff @@
## master #418 +/- ##
=========================================
+ Coverage 38.53% 40.2% +1.66%
=========================================
Files 30 31 +1
Lines 2351 2480 +129
=========================================
+ Hits 906 997 +91
- Misses 1324 1347 +23
- Partials 121 136 +15
Continue to review full report at Codecov.
|
The function name suffix implied it created a file, which was not the case.
@mumoshu et al: I still want to add extra validation to ensure operators can only create clusters if the provided auth tokens file is valid according to the specs, but overall I think this PR is ready for review. Please let me know if there's anything I missed. |
All done! Waiting for reviews. |
The tests are kinda flaky right now, this is the error I've been seeing:
I'll try again soon. |
Before generating the encrypted version of the auth token file, parse it as a CSV and look for problems, such as comments and unmatching number of columns. If any problem is found, an error is raised, causing the cluster not to be created.
@@ -1178,7 +1203,7 @@ func (c ControllerSettings) Valid() error { | |||
func (c Experimental) Valid() error { | |||
for _, taint := range c.Taints { | |||
if taint.Effect != "NoSchedule" && taint.Effect != "PreferNoSchedule" { | |||
return fmt.Errorf("Effect must be NoSchdule or PreferNoSchedule, but was %s", taint.Effect) | |||
return fmt.Errorf("Effect must be NoSchedule or PreferNoSchedule, but was %s", taint.Effect) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch 👍
@@ -1045,7 +1070,7 @@ func (c DeploymentSettings) Valid() (*DeploymentValidationResult, error) { | |||
return &DeploymentValidationResult{vpcNet: vpcNet}, nil | |||
} | |||
|
|||
func (c DeploymentSettings) TLSAssetsEncryptionEnabled() bool { | |||
func (c DeploymentSettings) AssetsEncryptionEnabled() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for paying attention to the naming 👍
* kubernetes-incubator/master: (29 commits) Emit errors when kube-aws sees unexpected keys in cluster.yaml Resolves kubernetes-retired#404 Tag controller nodes appropriately with `kubernetes.io/role`. Resolves kubernetes-retired#370 Make Container Linux AMI fetching a bit more reliable Stop locksmithd errors on etcd nodes Upgrade heapster to version 1.3.0 (kubernetes-retired#420) Auth token file support (kubernetes-retired#418) Update README.md Update README accordingly to the new git repo AWS China region support (kubernetes-retired#390) Conform as a Kubernetes Incubator Project Fixed typo in template upgrade aws-sdk to latest version Fix kubernetes-retired#388 Upgrade Kubernetes version to v1.5.4 Fix assumed public hostnames for EC2 instances in us-east-1 Fix assumed public hostnames for EC2 instances in us-east-1 typo fix: etcdDataVolumeEncrypted not creating encrypted volumes fixes kubernetes-retired#383 Allow disabling wait signals fixes kubernetes-retired#371 Update file paths in readme Fix an issue with glue security group documentation ...
Adds support for authentication via static token files, as documented [here](https://kubernetes.io/docs/admin/authentication/#static-token-file). The token file is a csv file with a minimum of 3 columns: token, user name, user uid, followed by optional group names. Note, if you have more than one group the column must be double quoted. Authentication via static token files, although not very flexible, is a pretty simple solution for users getting started with Kubernetes and/or want to have some mechanism to give access to different users, but do not want the complexity overhead of a more flexible solution, such as [dex](https://github.com/coreos/dex). This change will also be the foundation which kubernetes-retired#414 will be laid on. A more detailed change list follows: * Renamed function Since we'll be encrypting things that are not TLS certificates, it's time to rename the function in order to avoid any confusion. The function name suffix implied it created a file, which was not the case. * Updated test error message * Renamed systemd unit to match name changes * Defined a location in which to put the token auth file The decryption of the token file should also happen provided it is put at the correct location. * Should only attempt to decrypt tokens if the auth token file exists * Fixed typo * Added tests * Updated docs * Fixed script * Validate auth token file Before generating the encrypted version of the auth token file, parse it as a CSV and look for problems, such as comments and unmatching number of columns. If any problem is found, an error is raised, causing the cluster not to be created.
This PR adds support for authentication via static token files, as documented here.
Authentication via static token files, although not very flexible, is a pretty simple solution for users getting started with Kubernetes and/or want to have some mechanism to give access to different users, but do not want the complexity overhead of a more flexible solution, such as dex.
This PR will also be the foundation which #414 will be laid on.
Remaining TODOs:
[1] The token file is a csv file with a minimum of 3 columns: token, user name, user uid, followed by optional group names. Note, if you have more than one group the column must be double quoted