Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 feat: add EKS controlplane provider #3685

Merged
merged 1 commit into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/clusterctl/client/config/providers_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ const (
// Bootstrap providers
KubeadmBootstrapProviderName = "kubeadm"
TalosBootstrapProviderName = "talos"
EKSBootstrapProviderName = "eks"
AWSEKSBootstrapProviderName = "aws-eks"
richardcase marked this conversation as resolved.
Show resolved Hide resolved

// ControlPlane providers
KubeadmControlPlaneProviderName = "kubeadm"
TalosControlPlaneProviderName = "talos"
AWSEKSControlPlaneProviderName = "aws-eks"

// Other
ProvidersConfigKey = "providers"
Expand Down Expand Up @@ -154,7 +155,7 @@ func (p *providersClient) defaults() []Provider {
providerType: clusterctlv1.BootstrapProviderType,
},
&provider{
name: EKSBootstrapProviderName,
name: AWSEKSBootstrapProviderName,
url: "https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/eks-bootstrap-components.yaml",
providerType: clusterctlv1.BootstrapProviderType,
},
Expand All @@ -169,6 +170,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/talos-systems/cluster-api-control-plane-provider-talos/releases/latest/control-plane-components.yaml",
providerType: clusterctlv1.ControlPlaneProviderType,
},
&provider{
name: AWSEKSControlPlaneProviderName,
url: "https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/eks-controlplane-components.yaml",
providerType: clusterctlv1.ControlPlaneProviderType,
},
}

return defaults
Expand Down
6 changes: 4 additions & 2 deletions cmd/clusterctl/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
// note: these will be sorted by name by the Providers() call, so be sure they are in alphabetical order here too
wantProviders: []string{
config.ClusterAPIProviderName,
config.EKSBootstrapProviderName,
config.AWSEKSBootstrapProviderName,
config.KubeadmBootstrapProviderName,
config.TalosBootstrapProviderName,
config.AWSEKSControlPlaneProviderName,
config.KubeadmControlPlaneProviderName,
config.TalosControlPlaneProviderName,
config.AWSProviderName,
Expand All @@ -80,10 +81,11 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
// note: these will be sorted by name by the Providers() call, so be sure they are in alphabetical order here too
wantProviders: []string{
config.ClusterAPIProviderName,
config.AWSEKSBootstrapProviderName,
customProviderConfig.Name(),
config.EKSBootstrapProviderName,
config.KubeadmBootstrapProviderName,
config.TalosBootstrapProviderName,
config.AWSEKSControlPlaneProviderName,
config.KubeadmControlPlaneProviderName,
config.TalosControlPlaneProviderName,
config.AWSProviderName,
Expand Down
12 changes: 11 additions & 1 deletion cmd/clusterctl/client/repository/metadata_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (f *metadataClient) getEmbeddedMetadata() *clusterctlv1.Metadata {
// older version are not supported by clusterctl
},
}
case config.EKSBootstrapProviderName:
case config.AWSEKSBootstrapProviderName:
return &clusterctlv1.Metadata{
TypeMeta: metav1.TypeMeta{
APIVersion: clusterctlv1.GroupVersion.String(),
Expand Down Expand Up @@ -196,6 +196,16 @@ func (f *metadataClient) getEmbeddedMetadata() *clusterctlv1.Metadata {
// there are no older version for Talos controlplane
},
}
case config.AWSEKSControlPlaneProviderName:
return &clusterctlv1.Metadata{
TypeMeta: metav1.TypeMeta{
APIVersion: clusterctlv1.GroupVersion.String(),
Kind: "Metadata",
},
ReleaseSeries: []clusterctlv1.ReleaseSeries{
{Major: 0, Minor: 6, Contract: "v1alpha3"},
},
}
default:
return nil
}
Expand Down
9 changes: 7 additions & 2 deletions cmd/clusterctl/cmd/config_repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ providers:
var expectedOutputText = `NAME TYPE URL FILE
cluster-api CoreProvider https://github.com/myorg/myforkofclusterapi/releases/latest/ core_components.yaml
another-provider BootstrapProvider ./ bootstrap-components.yaml
eks BootstrapProvider https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/ eks-bootstrap-components.yaml
aws-eks BootstrapProvider https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/ eks-bootstrap-components.yaml
kubeadm BootstrapProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ bootstrap-components.yaml
talos BootstrapProvider https://github.com/talos-systems/cluster-api-bootstrap-provider-talos/releases/latest/ bootstrap-components.yaml
aws-eks ControlPlaneProvider https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/ eks-controlplane-components.yaml
kubeadm ControlPlaneProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ control-plane-components.yaml
talos ControlPlaneProvider https://github.com/talos-systems/cluster-api-control-plane-provider-talos/releases/latest/ control-plane-components.yaml
aws InfrastructureProvider my-aws-infrastructure-components.yaml
Expand All @@ -128,7 +129,7 @@ var expectedOutputYaml = `- File: core_components.yaml
ProviderType: BootstrapProvider
URL: ./
- File: eks-bootstrap-components.yaml
Name: eks
Name: aws-eks
ProviderType: BootstrapProvider
URL: https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/
- File: bootstrap-components.yaml
Expand All @@ -139,6 +140,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: talos
ProviderType: BootstrapProvider
URL: https://github.com/talos-systems/cluster-api-bootstrap-provider-talos/releases/latest/
- File: eks-controlplane-components.yaml
Name: aws-eks
ProviderType: ControlPlaneProvider
URL: https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/
- File: control-plane-components.yaml
Name: kubeadm
ProviderType: ControlPlaneProvider
Expand Down