bridgezone

package
v8.0.0-rc1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExecution

func IsExecution(err error) bool

IsExecution asserts executionError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Config

type Config struct {
	HostAWSConfig clientaws.Config
	K8sClient     kubernetes.Interface
	Logger        micrologger.Logger

	Route53Enabled bool
}

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

Resource is bridgezone resource making sure we have fallback delegation in old DNS structure. TODO This is only for the migration period. TODO When we delete the "intermediate" zone this resource becomes noop and we do not need it anymore.

Old structure looks like:

installation.eu-central-1.aws.gigantic.io (control plane account)
└── NS k8s.installation.eu-central-1.aws.gigantic.io (default control plane account)

k8s.installation.eu-central-1.aws.gigantic.io (default control plane account)
├── A api.old_cluster_a.k8s.installation.eu-central-1.aws.gigantic.io
├── A ingress.old_cluster_a.k8s.installation.eu-central-1.aws.gigantic.io
├── A api.old_cluster_b.k8s.installation.eu-central-1.aws.gigantic.io
└── A ingress.old_cluster_b.k8s.installation.eu-central-1.aws.gigantic.io

New structure looks like:

installation.eu-central-1.aws.gigantic.io (control plane account)
└── NS new_cluster_a.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)
└── NS new_cluster_b.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)

new_cluster_a.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)
├── A api.new_cluster_a.k8s.installation.eu-central-1.aws.gigantic.io
└── A ingress.new_cluster_a.k8s.installation.eu-central-1.aws.gigantic.io

new_cluster_b.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)
├── A api.new_cluster_b.k8s.installation.eu-central-1.aws.gigantic.io
└── A ingress.new_cluster_b.k8s.installation.eu-central-1.aws.gigantic.io

For the migration period for new clusters we need also to add delegation to k8s.installation.eu-central-1.aws.gigantic.io because of the AWS DNS caching issues.

installation.eu-central-1.aws.gigantic.io (control plane account)
├── NS k8s.installation.eu-central-1.aws.gigantic.io (default tenant account)
└── NS cluster_id.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)

k8s.installation.eu-central-1.aws.gigantic.io (default tenant account)
├── NS cluster_id.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)
├── A api.old_cluster.k8s.installation.eu-central-1.aws.gigantic.io
└── A ingress.old_cluster.k8s.installation.eu-central-1.aws.gigantic.io

cluster_id.k8s.installation.eu-central-1.aws.gigantic.io (byoc tenant account)
├── A api.cluster_id.k8s.installation.eu-central-1.aws.gigantic.io
└── A ingress.cluster_id.k8s.installation.eu-central-1.aws.gigantic.io

NOTE: In the code below k8s.installation.eu-central-1.aws.gigantic.io zone is called "intermediate" and cluster_id.k8s.installation.eu-central-1.aws.gigantic.io zone is called "final". This resource *only* ensures we have delegation from the intermediate zone to the final zone, but only if the intermediate zone exists.

After everything is fully migrated the DNS layout should look like:

installation.eu-central-1.aws.gigantic.io (control plane account)
├── NS k8s.installation.eu-central-1.aws.gigantic.io (default guest account)
└── NS cluster_id.k8s.installation.eu-central-1.aws.gigantic.io (byoc guest account)

k8s.installation.eu-central-1.aws.gigantic.io (default guest account)
└── NS cluster_id.k8s.installation.eu-central-1.aws.gigantic.io (byoc guest account)

cluster_id.k8s.installation.eu-central-1.aws.gigantic.io (byoc guest account)
├── A api.cluster_id.k8s.installation.eu-central-1.aws.gigantic.io
└── A ingress.cluster_id.k8s.installation.eu-central-1.aws.gigantic.io

At this point we should be fine with removing k8s.installation.eu-central-1.aws.gigantic.io NS record from installation.eu-central-1.aws.gigantic.io zone. Then after a couple of days when delegation propagates and DNS caches are refreshed we can delete k8s.installation.eu-central-1.aws.gigantic.io zone from the default guest account.

NOTE: To complete full migration we need to start reconciling "hostpost" CloudFormation stack. This stack is responsible for creating cluster_id.k8s.installation.eu-central-1.aws.gigantic.io delegation in the installation.eu-central-1.aws.gigantic.io. Till this happens this resource cannot be deleted.

See https://github.com/giantswarm/aws-operator/pull/1373.

func New

func New(config Config) (*Resource, error)

func (*Resource) EnsureCreated

func (r *Resource) EnsureCreated(ctx context.Context, obj interface{}) error

func (*Resource) EnsureDeleted

func (r *Resource) EnsureDeleted(ctx context.Context, obj interface{}) error

func (*Resource) Name

func (r *Resource) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL