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

Add flag to disable Basic Auth. #5586

Merged
merged 1 commit into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/cluster_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,16 @@ spec:
serviceNodePortRange: 30000-33000
```

#### Disable Basic Auth

This will disable the passing of the `--basic-auth-file` flag.

```yaml
spec:
kubeAPIServer:
disableBasicAuth: true
```

#### targetRamMb

Memory limit for apiserver in MB (used to configure sizes of caches, etc.)
Expand Down
5 changes: 4 additions & 1 deletion nodeup/pkg/model/kube_apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
kubeAPIServer.ClientCAFile = filepath.Join(b.PathSrvKubernetes(), "ca.crt")
kubeAPIServer.TLSCertFile = filepath.Join(b.PathSrvKubernetes(), "server.cert")
kubeAPIServer.TLSPrivateKeyFile = filepath.Join(b.PathSrvKubernetes(), "server.key")
kubeAPIServer.BasicAuthFile = filepath.Join(b.PathSrvKubernetes(), "basic_auth.csv")
kubeAPIServer.TokenAuthFile = filepath.Join(b.PathSrvKubernetes(), "known_tokens.csv")

if !kubeAPIServer.DisableBasicAuth {
kubeAPIServer.BasicAuthFile = filepath.Join(b.PathSrvKubernetes(), "basic_auth.csv")
}

if b.UseEtcdTLS() {
kubeAPIServer.EtcdCAFile = filepath.Join(b.PathSrvKubernetes(), "ca.crt")
kubeAPIServer.EtcdCertFile = filepath.Join(b.PathSrvKubernetes(), "etcd-client.pem")
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ type KubeProxyConfig struct {
type KubeAPIServerConfig struct {
// Image is the docker container used
Image string `json:"image,omitempty"`
// DisableBasicAuth removes the --basic-auth-file flag
DisableBasicAuth bool `json:"disableBasicAuth,omitempty"`
// LogLevel is the logging level of the api
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// CloudProvider is the name of the cloudProvider we are using, aws, gce etcd
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ type KubeProxyConfig struct {
type KubeAPIServerConfig struct {
// Image is the docker container used
Image string `json:"image,omitempty"`
// DisableBasicAuth removes the --basic-auth-file flag
DisableBasicAuth bool `json:"disableBasicAuth,omitempty"`
// LogLevel is the logging level of the api
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// CloudProvider is the name of the cloudProvider we are using, aws, gce etcd
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ type KubeProxyConfig struct {
type KubeAPIServerConfig struct {
// Image is the docker container used
Image string `json:"image,omitempty"`
// DisableBasicAuth removes the --basic-auth-file flag
DisableBasicAuth bool `json:"disableBasicAuth,omitempty"`
// LogLevel is the logging level of the api
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// CloudProvider is the name of the cloudProvider we are using, aws, gce etcd
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.