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

Commit

Permalink
Implement customizing of etcd stateful sets via webhooks for AWS and GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyanr committed May 31, 2019
1 parent 3341d4c commit 0d2e94d
Show file tree
Hide file tree
Showing 63 changed files with 2,117 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,7 @@ spec:
deployment:
type: helm
providerConfig:
chart: H4sIAAAAAAAAA+0a227buD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Wm/1wAw4rGOuWDL98ajcLdRfpZVl7qsBFC5c5oCH1sLpdPrhmIQ3fdbQ1hRgKp8x5bOtlJpbF5kaJzn9Lt4noajcptSXVo5ZV+xhXAOVSa7fdQRj36Zr2x8RVYsQgvKLfhTf7XVZ3nhwO379qSua525Df8GRZNHA8nKUjgdNKSOAnZUP/Pac96h16X+r1D/6jTHxBSxVzhIm9BO+we0d7RwUGnP+37nQEtoSVo7clWNO9wgCj9I9r3yOBgdrgVrbuB1vdnB22viz8z0qZkVkIjsYPbTC12sBwMDp5PMeDoPqdHXsdv78bd5Nv1B37v6MhHA0Z6h209y/XndEX/tw5JbZnQmRGpSqPyz+WO2q9ZSudl4Uu49VdwzTY8bXV78FT/1/xV49IaaqihhhpqqKGGGmqooYYaaqihhhpqqOHu8H8q3+OhAFAAAA==
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 0d2e94d

Please sign in to comment.