Skip to content

Commit

Permalink
Merge pull request #9334 from hakman/docker-selinux
Browse files Browse the repository at this point in the history
Add "--selinux-enabled" flag for Docker
  • Loading branch information
k8s-ci-robot authored Jun 16, 2020
2 parents dc0c219 + d888b1f commit 2a73c9d
Show file tree
Hide file tree
Showing 101 changed files with 138 additions and 115 deletions.
3 changes: 3 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,9 @@ spec:
items:
type: string
type: array
selinuxEnabled:
description: SelinuxEnabled enables SELinux support
type: boolean
skipInstall:
description: SkipInstall when set to true will prevent kops from
installing and modifying Docker in any way
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/dockerconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type DockerConfig struct {
MTU *int32 `json:"mtu,omitempty" flag:"mtu"`
// RegistryMirrors is a referred list of docker registry mirror
RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"`
// SelinuxEnabled enables SELinux support
SelinuxEnabled *bool `json:"selinuxEnabled,omitempty" flag:"selinux-enabled"`
// SkipInstall when set to true will prevent kops from installing and modifying Docker in any way
SkipInstall bool `json:"skipInstall,omitempty"`
// Storage is the docker storage driver to use
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/dockerconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type DockerConfig struct {
MTU *int32 `json:"mtu,omitempty" flag:"mtu"`
// RegistryMirrors is a referred list of docker registry mirror
RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"`
// SelinuxEnabled enables SELinux support
SelinuxEnabled *bool `json:"selinuxEnabled,omitempty" flag:"selinux-enabled"`
// SkipInstall when set to true will prevent kops from installing and modifying Docker in any way
SkipInstall bool `json:"skipInstall,omitempty"`
// Storage is the docker storage driver to use
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.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

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

5 changes: 5 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

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

8 changes: 6 additions & 2 deletions pkg/commands/set_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ func SetClusterFields(fields []string, cluster *api.Cluster, instanceGroups []*a
cluster.Spec.Kubelet.AuthenticationTokenWebhook = &v
case "cluster.spec.nodePortAccess":
cluster.Spec.NodePortAccess = append(cluster.Spec.NodePortAccess, kv[1])
case "spec.docker.execOpt":
case "spec.docker.selinuxEnabled":
v, err := strconv.ParseBool(kv[1])
if err != nil {
return fmt.Errorf("unknown boolean value: %q", kv[1])
}
if cluster.Spec.Docker == nil {
cluster.Spec.Docker = &api.DockerConfig{}
}
cluster.Spec.Docker.ExecOpt = append(cluster.Spec.Docker.ExecOpt, kv[1])
cluster.Spec.Docker.SelinuxEnabled = &v
case "spec.kubernetesVersion":
cluster.Spec.KubernetesVersion = kv[1]
case "spec.masterPublicName":
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/components/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (b *DockerOptionsBuilder) BuildOptions(o interface{}) error {
clusterSpec.Docker.LogOpt = append(clusterSpec.Docker.LogOpt, "max-file=5")
}

docker.LogLevel = fi.String("warn")
docker.LogLevel = fi.String("info")
docker.IPTables = fi.Bool(false)
docker.IPMasq = fi.Bool(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1bmastersadditionalcidrexamplecom.Prop
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -453,7 +453,7 @@ Resources.AWSEC2LaunchTemplatenodesadditionalcidrexamplecom.Properties.LaunchTem
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersadditionaluserdataexamplecom.
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -482,7 +482,7 @@ Resources.AWSEC2LaunchTemplatenodesadditionaluserdataexamplecom.Properties.Launc
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1amasterscomplexexamplecom.Properties.
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -455,7 +455,7 @@ Resources.AWSEC2LaunchTemplatenodescomplexexamplecom.Properties.LaunchTemplateDa
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersminimalexamplecom.Properties.
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -453,7 +453,7 @@ Resources.AWSEC2LaunchTemplatenodesminimalexamplecom.Properties.LaunchTemplateDa
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersexternallbexamplecom.Properti
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -453,7 +453,7 @@ Resources.AWSEC2LaunchTemplatenodesexternallbexamplecom.Properties.LaunchTemplat
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amasterslaunchtemplatese
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -455,7 +455,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmasterslaunchtemplatese
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -760,7 +760,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1cmasterslaunchtemplatese
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -1065,7 +1065,7 @@ Resources.AWSAutoScalingLaunchConfigurationnodeslaunchtemplatesexamplecom.Proper
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ docker:
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersminimalexamplecom.Properties.
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down Expand Up @@ -453,7 +453,7 @@ Resources.AWSEC2LaunchTemplatenodesminimalexamplecom.Properties.LaunchTemplateDa
ipMasq: false
ipTables: false
logDriver: json-file
logLevel: warn
logLevel: info
logOpt:
- max-size=10m
- max-file=5
Expand Down
Loading

0 comments on commit 2a73c9d

Please sign in to comment.