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

✨ Add EKS control plane #1724

Merged
merged 19 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2b68eb6
feat: adding eks control plane support
richardcase May 14, 2020
2a1772a
Detach role policies, no longer need AmazonEKSServicePolicy
michaelbeaumont Jul 7, 2020
08d50ca
Set status of managed control plane
michaelbeaumont Jul 8, 2020
f92d649
Handle version updates, set FailureMessage
michaelbeaumont Jul 11, 2020
bccc03f
Support cloudwatch logging options
michaelbeaumont Jul 14, 2020
7ef31cd
chore: fix issues after rebase
richardcase Jul 15, 2020
cfe9f22
Support EncryptionConfigs at cluster creation
michaelbeaumont Jul 15, 2020
1047d21
feat: updates to enable awsmanagedcluster
richardcase Jul 15, 2020
61b5ce0
Add public/private endpoint access support
michaelbeaumont Jul 16, 2020
bc31df8
feat: added conditions and changed finalizer name
richardcase Jul 17, 2020
70a0e21
feat: changes from testing and logging structure change
richardcase Jul 20, 2020
feb3a0b
feat: introduce token methods and tag reconcilation and api refactor
richardcase Jul 20, 2020
ebf3367
Add unit tests, fix logging, fix log output
michaelbeaumont Jul 27, 2020
6e6bc41
feat: webhooks, eks cluster name and auth without aws-iam-authenticator
richardcase Aug 5, 2020
fa4ad22
Make new EKS template flavor conformant
michaelbeaumont Aug 24, 2020
8c919d8
feat: added new KubernetesClusterName field
richardcase Aug 25, 2020
d1df985
Validate and normalize EKS versions, be lenient in controller
michaelbeaumont Aug 25, 2020
23e379c
feat: removed EKSClusterName on managed scope
richardcase Aug 27, 2020
8a18234
chore: fixed typos in errors
michaelbeaumont Aug 27, 2020
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
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ E2E_DATA_DIR ?= $(REPO_ROOT)/test/e2e_new/data
E2E_CONF_PATH ?= $(E2E_DATA_DIR)/e2e_conf.yaml
KUBETEST_CONF_PATH ?= $(abspath $(E2E_DATA_DIR)/kubetest/conformance.yaml)
KUBETEST_FAST_CONF_PATH ?= $(abspath $(REPO_ROOT)/test/e2e_new/data/kubetest/conformance-fast.yaml)
CONFORMANCE_CI_TEMPLATE := $(ARTIFACTS)/templates/cluster-template-conformance-ci-artifacts.yaml
EXP_DIR := exp

# Binaries.
CLUSTERCTL := $(BIN_DIR)/clusterctl
Expand Down Expand Up @@ -165,7 +167,7 @@ test-conformance-fast: ## Run clusterctl based conformance test on workload clus
## Binaries
## --------------------------------------
.PHONY: binaries
binaries: manager clusterawsadm ## Builds and installs all binaries
binaries: manager clusterawsadm ## Builds and installs all binaries

.PHONY: manager
manager: ## Build manager binary.
Expand Down Expand Up @@ -273,6 +275,7 @@ generate: ## Generate code
generate-go: $(CONTROLLER_GEN) $(CONVERSION_GEN) $(MOCKGEN) $(DEFAULTER_GEN) ## Runs Go related generate targets
$(CONTROLLER_GEN) \
paths=./api/... \
paths=./$(EXP_DIR)/api/... \
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt

$(CONTROLLER_GEN) \
Expand All @@ -291,15 +294,17 @@ generate-go: $(CONTROLLER_GEN) $(CONVERSION_GEN) $(MOCKGEN) $(DEFAULTER_GEN) ##
go generate ./...

.PHONY: generate-manifests
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests for the core provider e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./api/... \
paths=./$(EXP_DIR)/api/... \
crd:crdVersions=v1 \
output:crd:dir=$(CRD_ROOT) \
output:webhook:dir=$(WEBHOOK_ROOT) \
webhook
$(CONTROLLER_GEN) \
paths=./controllers/... \
paths=./$(EXP_DIR)/controllers/... \
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha3/awscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type AWSClusterSpec struct {
// +optional
AdditionalTags Tags `json:"additionalTags,omitempty"`

// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior
// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
// +optional
ControlPlaneLoadBalancer *AWSLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"`

Expand Down
13 changes: 13 additions & 0 deletions api/v1alpha3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,19 @@ func (s Subnets) FilterByZone(zone string) (res Subnets) {
return
}

// GetUniqueZones returns a slice containing the unique zones of the subnets
func (s Subnets) GetUniqueZones() []string {
keys := make(map[string]bool)
zones := []string{}
for _, x := range s {
if _, value := keys[x.AvailabilityZone]; !value {
keys[x.AvailabilityZone] = true
zones = append(zones, x.AvailabilityZone)
}
}
return zones
}

// CNISpec defines configuration for CNI
type CNISpec struct {
// CNIIngressRules specify rules to apply to control plane and worker node security groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ spec:
- port
type: object
controlPlaneLoadBalancer:
description: ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior
description: ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
properties:
crossZoneLoadBalancing:
description: "CrossZoneLoadBalancing enables the classic ELB cross availability zone balancing. \n With cross-zone load balancing, each load balancer node for your Classic Load Balancer distributes requests evenly across the registered instances in all enabled Availability Zones. If cross-zone load balancing is disabled, each load balancer node distributes requests evenly across the registered instances in its Availability Zone only. \n Defaults to false."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: awsmanagedclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
names:
categories:
- cluster-api
kind: AWSManagedCluster
listKind: AWSManagedClusterList
plural: awsmanagedclusters
shortNames:
- awsmc
singular: awsmanagedcluster
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Cluster to which this AWSManagedControl belongs
jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name
name: Cluster
type: string
- description: Control plane infrastructure is ready for worker nodes
jsonPath: .status.ready
name: Ready
type: string
- description: AWS VPC the control plane is using
jsonPath: .spec.networkSpec.vpc.id
name: VPC
type: string
- description: API Endpoint
jsonPath: .spec.controlPlaneEndpoint.host
name: Endpoint
priority: 1
type: string
name: v1alpha3
schema:
openAPIV3Schema:
description: AWSManagedCluster is the Schema for the awsmanagedclusters API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: AWSManagedClusterSpec defines the desired state of AWSManagedCluster
properties:
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
properties:
host:
description: The hostname on which the API server is serving.
type: string
port:
description: The port on which the API server is serving.
format: int32
type: integer
required:
- host
- port
type: object
type: object
status:
description: AWSManagedClusterStatus defines the observed state of AWSManagedCluster
properties:
failureDomains:
additionalProperties:
description: FailureDomainSpec is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across.
properties:
attributes:
additionalProperties:
type: string
description: Attributes is a free form map of attributes an infrastructure provider might use or require.
type: object
controlPlane:
description: ControlPlane determines if this failure domain is suitable for use by control plane machines.
type: boolean
type: object
description: FailureDomains specifies a list fo available availability zones that can be used
type: object
ready:
description: Ready is when the AWSManagedControlPlane has a API server URL.
type: boolean
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading