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

Commit

Permalink
Merge pull request #94 from stoyanr/add-etcd-backup-controlplane-webh…
Browse files Browse the repository at this point in the history
…ooks

Implement customizing of etcd stateful sets via webhooks for AWS and GCP
  • Loading branch information
rfranzke authored Jun 3, 2019
2 parents 5faa474 + 7ce38d0 commit 52a19c8
Show file tree
Hide file tree
Showing 63 changed files with 2,309 additions and 109 deletions.
1 change: 1 addition & 0 deletions Gopkg.lock

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

4 changes: 4 additions & 0 deletions controllers/provider-aws/charts/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ images:
sourceRepository: github.com/gardener/machine-controller-manager
repository: eu.gcr.io/gardener-project/gardener/machine-controller-manager
tag: "0.18.0"
- name: etcd-backup-restore
sourceRepository: github.com/gardener/etcd-backup-restore
repository: eu.gcr.io/gardener-project/gardener/etcdbrctl
tag: "0.6.3"
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ data:
machineImages:
{{ toYaml .Values.config.machineImages | indent 4 }}
{{- end }}
etcd:
storage:
className: {{ .Values.config.etcd.storage.className }}
capacity: {{ .Values.config.etcd.storage.capacity }}
backup:
schedule: {{ .Values.config.etcd.backup.schedule }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.config.etcd.storage.className }}
provisioner: kubernetes.io/aws-ebs
allowVolumeExpansion: true
parameters:
type: gp2
7 changes: 7 additions & 0 deletions controllers/provider-aws/charts/provider-aws/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ disableControllers:
disableWebhooks:
- controlplane
- controlplaneexposure
- controlplanebackup

config:
machineImages:
Expand All @@ -37,3 +38,9 @@ config:
ami: ami-07739b17529e8c1d0
- name: ap-southeast-2
ami: ami-02d7d488d701a460e
etcd:
storage:
className: gardener.cloud-fast
capacity: 80Gi
backup:
schedule: "0 */24 * * *"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
awscontrolplane "github.com/gardener/gardener-extensions/controllers/provider-aws/pkg/controller/controlplane"
awsinfrastructure "github.com/gardener/gardener-extensions/controllers/provider-aws/pkg/controller/infrastructure"
awsworker "github.com/gardener/gardener-extensions/controllers/provider-aws/pkg/controller/worker"
awscontrolplanebackup "github.com/gardener/gardener-extensions/controllers/provider-aws/pkg/webhook/controlplanebackup"
awscontrolplaneexposure "github.com/gardener/gardener-extensions/controllers/provider-aws/pkg/webhook/controlplaneexposure"
"github.com/gardener/gardener-extensions/pkg/controller"
controllercmd "github.com/gardener/gardener-extensions/pkg/controller/cmd"
"github.com/gardener/gardener-extensions/pkg/controller/infrastructure"
Expand Down Expand Up @@ -64,8 +66,18 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
MaxConcurrentReconciles: 5,
}

controllerSwitches = awscmd.ControllerSwitchOptions()
webhookSwitches = awscmd.WebhookAddToManagerOptions()
controllerSwitches = awscmd.ControllerSwitchOptions()
webhookSwitches = awscmd.WebhookSwitchOptions()
webhookServerOptions = &webhookcmd.ServerOptions{
Port: 7890,
CertDir: "/tmp/cert",
Mode: webhookcmd.ServiceMode,
Name: "webhooks",
Namespace: os.Getenv("WEBHOOK_CONFIG_NAMESPACE"),
ServiceSelectors: "{}",
Host: "localhost",
}
webhookOptions = webhookcmd.NewAddToManagerOptions("aws-webhooks", webhookServerOptions, webhookSwitches)

aggOption = controllercmd.NewOptionAggregator(
restOpts,
Expand All @@ -75,20 +87,10 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
controllercmd.PrefixOption("worker-", workerCtrlOpts),
configFileOpts,
controllerSwitches,
webhookSwitches,
webhookOptions,
)
)

webhookSwitches.Server = webhookcmd.ServerOptions{
Port: 7890,
CertDir: "/tmp/cert",
Mode: webhookcmd.ServiceMode,
Name: "webhooks",
Namespace: os.Getenv("WEBHOOK_CONFIG_NAMESPACE"),
ServiceSelectors: "{}",
Host: "localhost",
}

cmd := &cobra.Command{
Use: fmt.Sprintf("%s-controller-manager", aws.Name),

Expand All @@ -111,6 +113,8 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
}

configFileOpts.Completed().ApplyMachineImages(&awsworker.DefaultAddOptions.MachineImagesToAMIMapping)
configFileOpts.Completed().ApplyETCDStorage(&awscontrolplaneexposure.DefaultAddOptions.ETCDStorage)
configFileOpts.Completed().ApplyETCDBackup(&awscontrolplanebackup.DefaultAddOptions.ETCDBackup)
controlPlaneCtrlOpts.Completed().Apply(&awscontrolplane.Options)
infraCtrlOpts.Completed().Apply(&awsinfrastructure.DefaultAddOptions.Controller)
infraReconcileOpts.Completed().Apply(&awsinfrastructure.DefaultAddOptions.IgnoreOperationAnnotation)
Expand All @@ -120,7 +124,7 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
controllercmd.LogErrAndExit(err, "Could not add controllers to manager")
}

if err := webhookSwitches.Completed().AddToManager(mgr); err != nil {
if err := webhookOptions.Completed().AddToManager(mgr); err != nil {
controllercmd.LogErrAndExit(err, "Could not add webhooks to manager")
}

Expand Down
6 changes: 6 additions & 0 deletions controllers/provider-aws/example/00-componentconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ machineImages:
ami: ami-07739b17529e8c1d0
- name: ap-southeast-2
ami: ami-02d7d488d701a460e
etcd:
storage:
className: gardener.cloud-fast
capacity: 80Gi
backup:
schedule: "0 */24 * * *"
11 changes: 11 additions & 0 deletions controllers/provider-aws/example/30-etcd-backup-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: etcd-backup
namespace: shoot--foo--bar
type: Opaque
data:
bucketName: YnVja2V0MTIz # bucket123
region: ZXUtd2VzdC0x # eu-west-1
accessKeyID: YWRtaW4= # admin
secretAccessKey: YWRtaW4= # admin
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14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ffwC07/uvYWfj+7/eQbc+/w8B9i7R5F/Z3eEIaOLOPaEPZe5JcZ/oUD9vuO7CT5H5CIwf0RlAXLhgPJmdcnWm/1wAw4rGOuWDL98ajcLdRfpZVl7qsBFC5c5oBANsLpdPrhmIQ3fdbY1gRgKp8x5bOtlJpbF5kaJzn9Lt4noajcptSXVo5ZV+xhXAOVSa7YdNRj36Zr2x8RVYsQgvKLfhTf7XVZ3nB0N34NqSua525Df8GRZNHA8nKUjgdNKSOAnZSP/Pac/6B16X+v0D/7AzGBJSxVzhIm9BO+ge0v5hr9cZTAd+Z0hLaAkaerIVzTsYIsrgkA48MuzNDraidTfQBv6s1/a6+DMjbUpmJTQSO7jN1GIHy+Gw93yKAUf3OT30On57N+4m364/9PuHh/6w3SH9g7ae5fpzusrHdIVP6colQ2dGZHZ7sf5g7rD9mpnG8odw68/gmm142ur24an+r/mrhqc11FBDDTXUUEMNNdRQQw011FBDDTXUUMMd4P84QBVdAFAAAA==
values:
image:
tag: 0.7.0-dev
25 changes: 25 additions & 0 deletions controllers/provider-aws/pkg/apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package config

import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -27,6 +28,8 @@ type ControllerConfiguration struct {
// MachineImages is the list of machine images that are understood by the controller. It maps
// logical names and versions to AWS-specific identifiers, i.e. AMIs.
MachineImages []MachineImage
// ETCD is the etcd configuration.
ETCD ETCD
}

// MachineImage is a mapping from logical names and versions to AWS-specific identifiers, i.e. AMIs.
Expand All @@ -46,3 +49,25 @@ type RegionAMIMapping struct {
// AMI is the AMI for the machine image.
AMI string
}

// ETCD is an etcd configuration.
type ETCD struct {
// ETCDStorage is the etcd storage configuration.
Storage ETCDStorage
// ETCDBackup is the etcd backup configuration.
Backup ETCDBackup
}

// ETCDStorage is an etcd storage configuration.
type ETCDStorage struct {
// ClassName is the name of the storage class used in etcd-main volume claims.
ClassName *string
// Capacity is the storage capacity used in etcd-main volume claims.
Capacity *resource.Quantity
}

// ETCDBackup is an etcd backup configuration.
type ETCDBackup struct {
// Schedule is the etcd backup schedule.
Schedule *string
}
28 changes: 28 additions & 0 deletions controllers/provider-aws/pkg/apis/config/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package v1alpha1

import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -27,6 +28,8 @@ type ControllerConfiguration struct {
// MachineImages is the list of machine images that are understood by the controller. It maps
// logical names and versions to AWS-specific identifiers, i.e. AMIs.
MachineImages []MachineImage `json:"machineImages,omitempty"`
// ETCD is the etcd configuration.
ETCD ETCD `json:"etcd"`
}

// MachineImage is a mapping from logical names and versions to AWS-specific identifiers, i.e. AMIs.
Expand All @@ -46,3 +49,28 @@ type RegionAMIMapping struct {
// AMI is the AMI for the machine image.
AMI string `json:"ami"`
}

// ETCD is an etcd configuration.
type ETCD struct {
// ETCDStorage is the etcd storage configuration.
Storage ETCDStorage `json:"storage"`
// ETCDBackup is the etcd backup configuration.
Backup ETCDBackup `json:"backup"`
}

// ETCDStorage is an etcd storage configuration.
type ETCDStorage struct {
// ClassName is the name of the storage class used in etcd-main volume claims.
// +optional
ClassName *string `json:"className,omitempty"`
// Capacity is the storage capacity used in etcd-main volume claims.
// +optional
Capacity *resource.Quantity `json:"capacity,omitempty"`
}

// ETCDBackup is an etcd backup configuration.
type ETCDBackup struct {
// Schedule is the etcd backup schedule.
// +optional
Schedule *string `json:"schedule,omitempty"`
}
Loading

0 comments on commit 52a19c8

Please sign in to comment.