Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1243 from HotelsDotCom/feature/Add-PersistentVolu…
Browse files Browse the repository at this point in the history
…meClaimResize-AdmissionController

Admission Controller for PersistentVolumeClaimResize
  • Loading branch information
mumoshu authored Apr 17, 2018
2 parents 1cbf1d0 + a5c03e7 commit c583606
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions core/controlplane/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func NewDefaultCluster() *Cluster {
OwnerReferencesPermissionEnforcement{
Enabled: false,
},
PersistentVolumeClaimResize{
Enabled: false,
},
},
AuditLog: AuditLog{
Enabled: false,
Expand Down Expand Up @@ -605,6 +608,7 @@ type Admission struct {
MutatingAdmissionWebhook MutatingAdmissionWebhook `yaml:"mutatingAdmissionWebhook"`
ValidatingAdmissionWebhook ValidatingAdmissionWebhook `yaml:"validatingAdmissionWebhook"`
OwnerReferencesPermissionEnforcement OwnerReferencesPermissionEnforcement `yaml:"ownerReferencesPermissionEnforcement"`
PersistentVolumeClaimResize PersistentVolumeClaimResize `yaml:"persistentVolumeClaimResize"`
}

type AlwaysPullImages struct {
Expand Down Expand Up @@ -639,6 +643,10 @@ type OwnerReferencesPermissionEnforcement struct {
Enabled bool `yaml:"enabled"`
}

type PersistentVolumeClaimResize struct {
Enabled bool `yaml:"enabled"`
}

type AuditLog struct {
Enabled bool `yaml:"enabled"`
MaxAge int `yaml:"maxage"`
Expand Down
2 changes: 1 addition & 1 deletion core/controlplane/config/templates/cloud-config-controller
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,7 @@ write_files:
- --authentication-token-webhook-cache-ttl={{ .Experimental.Authentication.Webhook.CacheTTL }}
{{ end }}
- --advertise-address=$private_ipv4
- --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass{{if .Experimental.Admission.PodSecurityPolicy.Enabled}},PodSecurityPolicy{{ end }}{{if .Experimental.Admission.AlwaysPullImages.Enabled}},AlwaysPullImages{{ end }}{{if .Experimental.NodeAuthorizer.Enabled}},NodeRestriction{{end}},ResourceQuota{{if .Experimental.Admission.DenyEscalatingExec.Enabled}},DenyEscalatingExec{{end}}{{if .Experimental.Admission.Initializers.Enabled}},Initializers{{end}}{{if .Experimental.Admission.Priority.Enabled}},Priority{{end}},DefaultTolerationSeconds{{if .Experimental.Admission.MutatingAdmissionWebhook.Enabled}},MutatingAdmissionWebhook{{end}}{{if .Experimental.Admission.ValidatingAdmissionWebhook.Enabled}},ValidatingAdmissionWebhook{{end}}
- --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass{{if .Experimental.Admission.PodSecurityPolicy.Enabled}},PodSecurityPolicy{{ end }}{{if .Experimental.Admission.AlwaysPullImages.Enabled}},AlwaysPullImages{{ end }}{{if .Experimental.NodeAuthorizer.Enabled}},NodeRestriction{{end}},ResourceQuota{{if .Experimental.Admission.DenyEscalatingExec.Enabled}},DenyEscalatingExec{{end}}{{if .Experimental.Admission.Initializers.Enabled}},Initializers{{end}}{{if .Experimental.Admission.Priority.Enabled}},Priority{{end}},DefaultTolerationSeconds{{if .Experimental.Admission.MutatingAdmissionWebhook.Enabled}},MutatingAdmissionWebhook{{end}}{{if .Experimental.Admission.ValidatingAdmissionWebhook.Enabled}},ValidatingAdmissionWebhook{{end}}{{if .Experimental.Admission.PersistentVolumeClaimResize.Enabled}},PersistentVolumeClaimResize{{end}}
- --anonymous-auth=false
{{if .Experimental.Oidc.Enabled}}
- --oidc-issuer-url={{.Experimental.Oidc.IssuerUrl}}
Expand Down
2 changes: 2 additions & 0 deletions core/controlplane/config/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,8 @@ experimental:
enabled: false
OwnerReferencesPermissionEnforcement:
enabled: false
persistentVolumeClaimResize:
enabled: false

# Used to provide `/etc/environment` env vars with values from arbitrary CloudFormation refs
awsEnvironment:
Expand Down
8 changes: 8 additions & 0 deletions test/integration/maincluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ func TestMainClusterConfig(t *testing.T) {
ValidatingAdmissionWebhook: controlplane_config.ValidatingAdmissionWebhook{
Enabled: false,
},
PersistentVolumeClaimResize: controlplane_config.PersistentVolumeClaimResize{
Enabled: false,
},
},
AuditLog: controlplane_config.AuditLog{
Enabled: false,
Expand Down Expand Up @@ -1245,6 +1248,8 @@ experimental:
enabled: true
validatingAdmissionWebhook:
enabled: true
persistentVolumeClaimResize:
enabled: true
auditLog:
enabled: true
maxage: 100
Expand Down Expand Up @@ -1326,6 +1331,9 @@ worker:
ValidatingAdmissionWebhook: controlplane_config.ValidatingAdmissionWebhook{
Enabled: true,
},
PersistentVolumeClaimResize: controlplane_config.PersistentVolumeClaimResize{
Enabled: true,
},
},
AuditLog: controlplane_config.AuditLog{
Enabled: true,
Expand Down

0 comments on commit c583606

Please sign in to comment.