Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

apiserver default config changes #2034

Merged
merged 1 commit into from Jan 10, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/clusterdefinition.md
Expand Up @@ -276,11 +276,17 @@ Below is a list of cloud-controller-manager options that are *not* currently use

See [here](https://kubernetes.io/docs/reference/generated/kube-apiserver/) for a reference of supported apiserver options.

Below is a list of apiserver options that acs-engine will configure by default:

|apiserver option|default value|
|"--admission-control"|"NamespaceLifecycle, LimitRanger, ServiceAccount, DefaultStorageClass, ResourceQuota, DenyEscalatingExec, AlwaysPullImages, SecurityContextDeny"|
|"--authorization-mode"|"Node", "RBAC" (*the latter if enabledRbac is true*)|


Below is a list of apiserver options that are *not* currently user-configurable, either because a higher order configuration vector is available that enforces kubelet configuration, or because a static configuration is required to build a functional cluster:

|apiserver option|default value|
|---|---|
|"--admission-control"|"NamespaceLifecycle, LimitRanger, ServiceAccount, DefaultStorageClass, ResourceQuota, DenyEscalatingExec, AlwaysPullImages, SecurityContextDeny"|
|"--address"|"0.0.0.0"|
|"--advertise-address"|*calculated value that represents listening URI for API server*|
|"--allow-privileged"|"true"|
Expand Down Expand Up @@ -308,7 +314,6 @@ Below is a list of apiserver options that are *not* currently user-configurable,
|"--service-cluster-ip-range"|*see serviceCIDR*|
|"--storage-backend"|*calculated value that represents etcd version*|
|"--v"|"4"|
|"--authorization-mode"|"Node", and "RBAC" (*if enabledRbac is true*)|
|"--experimental-encryption-provider-config"|"/etc/kubernetes/encryption-config.yaml" (*if enableDataEncryptionAtRest is true*)|
|"--requestheader-client-ca-file"|"/etc/kubernetes/certs/proxy-ca.crt" (*if enableAggregatedAPIs is true*)|
|"--proxy-client-cert-file"|"/etc/kubernetes/certs/proxy.crt" (*if enableAggregatedAPIs is true*)|
Expand Down
17 changes: 9 additions & 8 deletions pkg/acsengine/defaults-apiserver.go
Expand Up @@ -10,7 +10,6 @@ import (
func setAPIServerConfig(cs *api.ContainerService) {
o := cs.Properties.OrchestratorProfile
staticLinuxAPIServerConfig := map[string]string{
"--admission-control": "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota,DenyEscalatingExec,AlwaysPullImages,SecurityContextDeny",
"--address": "0.0.0.0",
"--advertise-address": "<kubernetesAPIServerIP>",
"--allow-privileged": "true",
Expand All @@ -19,7 +18,6 @@ func setAPIServerConfig(cs *api.ContainerService) {
"--audit-log-maxbackup": "10",
"--audit-log-maxsize": "100",
"--audit-log-path": "/var/log/apiserver/audit.log",
"--authorization-mode": "Node",
"--insecure-port": "8080",
"--secure-port": "443",
"--service-account-lookup": "true",
Expand All @@ -41,11 +39,6 @@ func setAPIServerConfig(cs *api.ContainerService) {
"--v": "4",
}

// RBAC configuration
if helpers.IsTrueBoolPointer(o.KubernetesConfig.EnableRbac) {
staticLinuxAPIServerConfig["--authorization-mode"] = "Node,RBAC"
}

// Data Encryption at REST configuration
if helpers.IsTrueBoolPointer(o.KubernetesConfig.EnableDataEncryptionAtRest) {
staticLinuxAPIServerConfig["--experimental-encryption-provider-config"] = "/etc/kubernetes/encryption-config.yaml"
Expand Down Expand Up @@ -87,7 +80,15 @@ func setAPIServerConfig(cs *api.ContainerService) {
// TODO placeholder for specific config overrides for Windows clusters

// Default apiserver config
defaultAPIServerConfig := map[string]string{}
defaultAPIServerConfig := map[string]string{
"--admission-control": "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota,DenyEscalatingExec,AlwaysPullImages,SecurityContextDeny",
"--authorization-mode": "Node",
}

// RBAC configuration
if helpers.IsTrueBoolPointer(o.KubernetesConfig.EnableRbac) {
defaultAPIServerConfig["--authorization-mode"] = "Node,RBAC"
}

// If no user-configurable apiserver config values exists, use the defaults
if o.KubernetesConfig.APIServerConfig == nil {
Expand Down