Skip to content

Commit

Permalink
Merge pull request #8005 from cPu1/zonal-shift
Browse files Browse the repository at this point in the history
Support EKS zonal shift config
  • Loading branch information
cPu1 authored Oct 22, 2024
2 parents 18344d8 + ba7bfae commit b1f9f93
Show file tree
Hide file tree
Showing 13 changed files with 218 additions and 21 deletions.
11 changes: 11 additions & 0 deletions examples/41-zonal-shift.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# An example ClusterConfig that uses EKS Zonal Shift.

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
name: highly-available-cluster
region: us-west-2

zonalShiftConfig:
enabled: true
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20230601180523-74e721cb8c1e
github.com/aws/aws-sdk-go v1.51.16
github.com/aws/aws-sdk-go-v2 v1.30.4
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.27.11
github.com/aws/aws-sdk-go-v2/credentials v1.17.11
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5
Expand All @@ -20,15 +20,15 @@ require (
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.35.1
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3
github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0
github.com/aws/aws-sdk-go-v2/service/eks v1.48.1
github.com/aws/aws-sdk-go-v2/service/eks v1.51.0
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.24.4
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.30.5
github.com/aws/aws-sdk-go-v2/service/iam v1.32.0
github.com/aws/aws-sdk-go-v2/service/kms v1.27.5
github.com/aws/aws-sdk-go-v2/service/outposts v1.38.0
github.com/aws/aws-sdk-go-v2/service/ssm v1.49.5
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6
github.com/aws/smithy-go v1.20.4
github.com/aws/smithy-go v1.22.0
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5
github.com/benjamintf1/unmarshalledmatchers v1.0.0
github.com/blang/semver v3.5.1+incompatible
Expand Down Expand Up @@ -68,7 +68,7 @@ require (
github.com/tj/assert v0.0.3
github.com/vburenin/ifacemaker v1.2.1
github.com/vektra/mockery/v2 v2.38.0
github.com/weaveworks/goformation/v4 v4.10.2-0.20240626091647-67263f64f317
github.com/weaveworks/goformation/v4 v4.10.2-0.20241022124128-4be25b69f5e0
github.com/weaveworks/schemer v0.0.0-20230525114451-47139fe25848
github.com/xgfone/netaddr v0.5.1
golang.org/x/crypto v0.22.0
Expand Down Expand Up @@ -127,8 +127,8 @@ require (
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20230601180523-74e721cb8
github.com/aws/aws-sdk-go v1.51.16 h1:vnWKK8KjbftEkuPX8bRj3WHsLy1uhotn0eXptpvrxJI=
github.com/aws/aws-sdk-go v1.51.16/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8=
github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0=
github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI=
github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA=
Expand All @@ -727,11 +727,11 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22/go.mod h1:/vNv5Al0bpiF8YdX2Ov6Xy05VTiXsql94yUqJMYaj0w=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16/go.mod h1:2DwJF39FlNAUiX5pAc0UNeiz16lK2t7IaFcm0LFHEgc=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16/go.mod h1:62dsXI0BqTIGomDl8Hpm33dv0OntGaVblri3ZRParVQ=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 h1:jYfy8UPmd+6kJW5YhY0L1/KftReOGxI/4NtVSTh9O/I=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16/go.mod h1:7ZfEPZxkW42Afq4uQB8H2E2e6ebh6mXTueEpYzjCzcs=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.5 h1:vhdJymxlWS2qftzLiuCjSswjXBRLGfzo/BEE9LDveBA=
Expand All @@ -746,8 +746,8 @@ github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3 h1:JNWpkjIm
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3/go.mod h1:TiLZ2/+WAEyG2PnuAYj/un46UJ7qBf5BWWTAKgaHP8I=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0 h1:FDZVMxzXB13cRmHs3t3tH9gme8GhvmjsQXeXFI37OHU=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0/go.mod h1:Wv7N3iFOKVsZNIaw9MOBUmwCkX6VMmQQRFhMrHtNGno=
github.com/aws/aws-sdk-go-v2/service/eks v1.48.1 h1:KZ1GkevaklMvPxcqivG4UDwar3lqMSpbK9RpZowjMec=
github.com/aws/aws-sdk-go-v2/service/eks v1.48.1/go.mod h1:fff5mmwLCVxyXCojYjPY34sUGvWtXCD325yRL5qHAVs=
github.com/aws/aws-sdk-go-v2/service/eks v1.51.0 h1:BYyB+byjQ7oyupe3v+YjTp1yfmfNEwChYA2naCc85xI=
github.com/aws/aws-sdk-go-v2/service/eks v1.51.0/go.mod h1:oaPCqTzAe8C5RQZJGRD4RENcV7A4n99uGxbD4rULbNg=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.24.4 h1:V5YvSMQwZklktzYeOOhYdptx7rP650XP3RnxwNu1UEQ=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.24.4/go.mod h1:aYygRYqRxmLGrxRxAisgNarwo4x8bcJG14rh4r57VqE=
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.30.5 h1:/x2u/TOx+n17U+gz98TOw1HKJom0EOqrhL4SjrHr0cQ=
Expand All @@ -773,8 +773,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4/go.mod h1:mUYPBhaF2lGiukDEj
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU=
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw=
github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4=
github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM=
github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5 h1:F80UWAvCDH3PgWIkMhwhKN7FRlkn9MhI+nBHFq739ZM=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5/go.mod h1:wLKtvVfT0IdSJ3Pf6QoeLN+UTUeU28CmSAnoja6/l5s=
github.com/awslabs/goformation/v4 v4.19.5 h1:Y+Tzh01tWg8gf//AgGKUamaja7Wx9NPiJf1FpZu4/iU=
Expand Down Expand Up @@ -1813,8 +1813,8 @@ github.com/vektra/mockery/v2 v2.38.0 h1:I0LBuUzZHqAU4d1DknW0DTFBPO6n8TaD38WL2KJf
github.com/vektra/mockery/v2 v2.38.0/go.mod h1:diB13hxXG6QrTR0ol2Rk8s2dRMftzvExSvPDKr+IYKk=
github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 h1:txplJASvd6b/hrE0s/Ixfpp2cuwH9IO9oZBAN9iYa4A=
github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2/go.mod h1:DGCIhurYgnLz8J9ga1fMV/fbLDyUvTyrWXVWUIyJon4=
github.com/weaveworks/goformation/v4 v4.10.2-0.20240626091647-67263f64f317 h1:efLcD8csEtX1RO0444Wa4RQjO34pYuojsdPABc5QC3s=
github.com/weaveworks/goformation/v4 v4.10.2-0.20240626091647-67263f64f317/go.mod h1:3c2tyJmoge5qTS4PXS0niVJxR0YzroIBsts3dQI3EdI=
github.com/weaveworks/goformation/v4 v4.10.2-0.20241022124128-4be25b69f5e0 h1:wLOxc4ZnbvJdc7d7b+u4LqgPO5DJrumSXi7Ezo/lYvI=
github.com/weaveworks/goformation/v4 v4.10.2-0.20241022124128-4be25b69f5e0/go.mod h1:3c2tyJmoge5qTS4PXS0niVJxR0YzroIBsts3dQI3EdI=
github.com/weaveworks/schemer v0.0.0-20230525114451-47139fe25848 h1:I7S+IHZIU49skVgTNArf9bIdy07mCn1Z0zv1r07ROws=
github.com/weaveworks/schemer v0.0.0-20230525114451-47139fe25848/go.mod h1:y8Luzq6JDsYVoIV0QAlnvIiq8bSaap0myMjWKyzVFTY=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ type ClusterConfig struct {
// Outpost specifies the Outpost configuration.
// +optional
Outpost *Outpost `json:"outpost,omitempty"`

// ZonalShiftConfig specifies the zonal shift configuration.
ZonalShiftConfig *ZonalShiftConfig `json:"zonalShiftConfig,omitempty"`
}

// Outpost holds the Outpost configuration.
Expand Down Expand Up @@ -986,6 +989,12 @@ func (o *Outpost) HasPlacementGroup() bool {
return o.ControlPlanePlacement != nil
}

// ZonalShiftConfig holds the zonal shift configuration.
type ZonalShiftConfig struct {
// Enabled enables or disables zonal shift.
Enabled *bool `json:"enabled,omitempty"`
}

// OutpostInfo describes the Outpost info.
type OutpostInfo interface {
// IsControlPlaneOnOutposts returns true if the control plane is on Outposts.
Expand Down
5 changes: 5 additions & 0 deletions pkg/cfn/builder/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ func (c *ClusterResourceSet) addResourcesForControlPlane(subnetDetails *SubnetDe
kubernetesNetworkConfig.IpFamily = gfnt.NewString(strings.ToLower(ipFamily))
}
cluster.KubernetesNetworkConfig = kubernetesNetworkConfig
if c.spec.ZonalShiftConfig != nil && api.IsEnabled(c.spec.ZonalShiftConfig.Enabled) {
cluster.ZonalShiftConfig = &gfneks.Cluster_ZonalShift{
Enabled: gfnt.NewBoolean(true),
}
}

c.newResource("ControlPlane", &cluster)

Expand Down
33 changes: 33 additions & 0 deletions pkg/ctl/cmdutils/zonal_shift_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cmdutils

import (
"errors"
"fmt"
)

// NewZonalShiftConfigLoader creates a new loader for zonal shift config.
func NewZonalShiftConfigLoader(cmd *Cmd) ClusterConfigLoader {
l := newCommonClusterConfigLoader(cmd)
l.flagsIncompatibleWithConfigFile.Insert(
"enable-zonal-shift",
"cluster",
)

l.validateWithConfigFile = func() error {
if cmd.NameArg != "" {
return fmt.Errorf("config file and enable-zonal-shift %s", IncompatibleFlags)
}
if l.ClusterConfig.ZonalShiftConfig == nil || l.ClusterConfig.ZonalShiftConfig.Enabled == nil {
return errors.New("field zonalShiftConfig.enabled is required")
}
return nil
}

l.validateWithoutConfigFile = func() error {
if !cmd.CobraCommand.Flag("enable-zonal-shift").Changed {
return errors.New("--enable-zonal-shift is required when a config file is not specified")
}
return nil
}
return l
}
84 changes: 84 additions & 0 deletions pkg/ctl/utils/update_zonal_shift_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package utils

import (
"context"
"fmt"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/eks"
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"

"github.com/kris-nova/logger"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
"github.com/weaveworks/eksctl/pkg/ctl/cmdutils"
)

func updateZonalShiftConfig(cmd *cmdutils.Cmd, handler func(*cmdutils.Cmd) error) {
cfg := api.NewClusterConfig()
cmd.ClusterConfig = cfg

cmd.SetDescription("update-zonal-shift-config", "update zonal shift config", "update zonal shift config on a cluster")

var enableZonalShift bool
cmd.CobraCommand.RunE = func(_ *cobra.Command, args []string) error {
cmd.NameArg = cmdutils.GetNameArg(args)
if err := cmdutils.NewZonalShiftConfigLoader(cmd).Load(); err != nil {
return err
}
if cmd.ClusterConfigFile == "" {
cfg.ZonalShiftConfig = &api.ZonalShiftConfig{
Enabled: &enableZonalShift,
}
}
return handler(cmd)
}

cmdutils.AddCommonFlagsForAWS(cmd, &cmd.ProviderConfig, false)

cmd.FlagSetGroup.InFlagSet("General", func(fs *pflag.FlagSet) {
cmdutils.AddClusterFlag(fs, cfg.Metadata)
cmdutils.AddRegionFlag(fs, &cmd.ProviderConfig)
cmdutils.AddConfigFileFlag(fs, &cmd.ClusterConfigFile)
fs.BoolVar(&enableZonalShift, "enable-zonal-shift", true, "Enable zonal shift on a cluster")
})

}

func updateZonalShiftConfigCmd(cmd *cmdutils.Cmd) {
updateZonalShiftConfig(cmd, doUpdateZonalShiftConfig)
}

func doUpdateZonalShiftConfig(cmd *cmdutils.Cmd) error {
cfg := cmd.ClusterConfig
ctx := context.Background()
if cfg.Metadata.Name == "" {
return cmdutils.ErrMustBeSet(cmdutils.ClusterNameFlag(cmd))
}
ctl, err := cmd.NewProviderForExistingCluster(ctx)
if err != nil {
return err
}
makeZonalShiftStatus := func(enabled *bool) string {
if api.IsEnabled(enabled) {
return "enabled"
}
return "disabled"
}
if zsc := ctl.Status.ClusterInfo.Cluster.ZonalShiftConfig; zsc != nil && *zsc.Enabled == api.IsEnabled(cfg.ZonalShiftConfig.Enabled) {
logger.Info("zonal shift is already %s", makeZonalShiftStatus(zsc.Enabled))
return nil
}
if err := ctl.UpdateClusterConfig(ctx, &eks.UpdateClusterConfigInput{
Name: aws.String(cfg.Metadata.Name),
ZonalShiftConfig: &ekstypes.ZonalShiftConfigRequest{
Enabled: cfg.ZonalShiftConfig.Enabled,
},
}); err != nil {
return fmt.Errorf("updating zonal shift config: %w", err)
}
logger.Info("zonal shift %s successfully", makeZonalShiftStatus(cfg.ZonalShiftConfig.Enabled))
return nil
}
1 change: 1 addition & 0 deletions pkg/ctl/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func Command(flagGrouping *cmdutils.FlagGrouping) *cobra.Command {
cmdutils.AddResourceCmd(flagGrouping, verbCmd, describeAddonConfigurationCmd)
cmdutils.AddResourceCmd(flagGrouping, verbCmd, migrateToPodIdentityCmd)
cmdutils.AddResourceCmd(flagGrouping, verbCmd, migrateAccessEntryCmd)
cmdutils.AddResourceCmd(flagGrouping, verbCmd, updateZonalShiftConfigCmd)

return verbCmd
}
6 changes: 4 additions & 2 deletions pkg/printers/testdata/jsontest_2clusters.golden
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"Status": "ACTIVE",
"Tags": null,
"Version": null,
"UpgradePolicy": null
"UpgradePolicy": null,
"ZonalShiftConfig": null
},
{
"Id": null,
Expand Down Expand Up @@ -75,6 +76,7 @@
"Status": "ACTIVE",
"Tags": null,
"Version": null,
"UpgradePolicy": null
"UpgradePolicy": null,
"ZonalShiftConfig": null
}
]
3 changes: 2 additions & 1 deletion pkg/printers/testdata/jsontest_single.golden
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"Status": "ACTIVE",
"Tags": null,
"Version": null,
"UpgradePolicy": null
"UpgradePolicy": null,
"ZonalShiftConfig": null
}
]
2 changes: 2 additions & 0 deletions pkg/printers/testdata/yamltest_2clusters.golden
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Tags: null
Version: null
UpgradePolicy: null
ZonalShiftConfig: null
- Id: null
Arn: arn-87654321
CertificateAuthority: null
Expand Down Expand Up @@ -64,3 +65,4 @@
Tags: null
Version: null
UpgradePolicy: null
ZonalShiftConfig: null
1 change: 1 addition & 0 deletions pkg/printers/testdata/yamltest_single.golden
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
Tags: null
Version: null
UpgradePolicy: null
ZonalShiftConfig: null
48 changes: 48 additions & 0 deletions userdocs/src/usage/zonal-shift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Support for Zonal Shift in EKS clusters

EKS now supports Amazon Application Recovery Controller (ARC) zonal shift and zonal autoshift that enhances the
resiliency of multi-AZ cluster environments. With AWS Zonal Shift, customers can shift in-cluster traffic away
from an impaired availability zone, ensuring new Kubernetes pods and nodes are launched in healthy availability zones only.

## Creating a cluster with zonal shift enabled

```yaml
# zonal-shift-cluster.yaml
---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
name: highly-available-cluster
region: us-west-2


zonalShiftConfig:
enabled: true

```

```shell
$ eksctl create cluster -f zonal-shift-cluster.yaml
```


## Enabling zonal shift on an existing cluster

To enable or disable zonal shift on an existing cluster, run

```shell
$ eksctl utils update-zonal-shift-config -f zonal-shift-cluster.yaml
```

or without a config file:

```shell
$ eksctl utils update-zonal-shift-config --cluster=zonal-shift-cluster --enabled
```

## Further information

- [EKS Zonal Shift][eks-user-guide]

[eks-user-guide]: https://docs.aws.amazon.com/eks/latest/userguide/zone-shift.html

0 comments on commit b1f9f93

Please sign in to comment.