Skip to content

Commit

Permalink
Merge pull request #1724 from richardcase/ekscontrolplane
Browse files Browse the repository at this point in the history
✨ Add EKS control plane
  • Loading branch information
k8s-ci-robot authored Aug 28, 2020
2 parents da7d37f + 8a18234 commit 936a024
Show file tree
Hide file tree
Showing 54 changed files with 6,737 additions and 106 deletions.
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

0 comments on commit 936a024

Please sign in to comment.