Giant Swarm AWS Management Cluster admission controller that implements the following rules:
Mutating Webhook:
-  
In an
AWSClusterresource, the AWS Operator Version is defaulted based on theReleaseCR if it is not set. -  
In an
AWSClusterresource, the Release Version is defaulted based on theClusterCR if it is not set. -  
In an
AWSClusterresource, the Credential Secret is defaulted if it is not set. -  
In an
AWSClusterresource, the Region is defaulted if it is not set. -  
In an
AWSClusterresource, the Description is defaulted if it is not set. -  
In an
AWSClusterresource, the DNS Domain is defaulted if it is not set. -  
In an
AWSClusterresource, the Pod CIDR is defaulted if it is not set. -  
In an
AWSClusterresource, in a pre-HA version, the Master attribute is defaulted if it is not set. -  
In a
Clusterresource, the Release Version is defaulted to the newest active production version if it is not set. -  
In a
Clusterresource, the Cluster Operator Version is defaulted based on theReleaseCR if it is not set. -  
In a
Clusterresource, the Cluster Operator Version is defaulted based on the new release version during an upgrade. -  
In a
G8sControlplaneresource, the Cluster Operator Version is defaulted based on theClusterCR if it is not set. -  
In a
G8sControlplaneresource, the Release Version is defaulted based on theClusterCR if it is not set. -  
In a
G8sControlPlaneresource, when the.spec.replicasis changed from 1 to 3, the Availability Zones of the accordingAWSControlPlanewill be defaulted if needed. -  
In a
G8sControlPlaneresource, the replicas attribute will be defaulted if it is not defined.- For HA-Versions, in case the matching 
AWSControlPlanealready exists, the number of AZs determines the value ofreplicas. In case no suchAWSControlPlaneexists, the default number of AZs is assigned. - For pre-HA versions, replicas is always set to 1 for a single master cluster.
 
 - For HA-Versions, in case the matching 
 -  
In a
G8sControlPlaneresource, the infrastructure reference will be set to point to the matchingAWSControlPlane. -  
In an
AWSControlplaneresource, the AWS Operator Version is defaulted based on theAWSClusterCR if it is not set. -  
In an
AWSControlplaneresource, the Release Version is defaulted based on theClusterCR if it is not set. -  
In an
AWSControlPlaneresource, the Availability Zones will be defaulted if they arenil.- For HA-Versions, in case the matching 
G8sControlPlanealready exists, the number of AZs is determined by the number ofreplicasdefined there. In case no suchG8sControlPlaneexists, the default number of AZs is assigned. - For Pre-HA-Versions, in case the matching 
AWSClusteralready exists, the AZ is taken from there. 
 - For HA-Versions, in case the matching 
 -  
In an
AWSControlPlaneresource, the Instance Type will be defaulted if it is not defined.- For HA-Versions, the default Instance Type is chosen.
 - For Pre-HA-Versions, in case the matching 
AWSClusteralready exists, the Instance Type is taken from there. 
 -  
In an
AWSMachinedeploymentresource, the Availability Zones will be defaulted if they arenil. The default number of
AZs is assigned based on the master AZs taken from theAWSControlPlaneCR. -  
In an
AWSMachinedeploymentresource, the AWS Operator Version is defaulted based on theAWSClusterCR if it is not set. -  
When a new
AWSMachineDeploymentis created, details are logged. -  
In an
AWSMachinedeploymentresource, the Release Version is defaulted based on theClusterCR if it is not set. -  
In a
Machinedeploymentresource, the Release Version is defaulted based on theClusterCR if it is not set. -  
In a
Machinedeploymentresource, the Cluster Operator Version is defaulted based on theClusterCR if it is not set. 
Validating Webhook:
-  
In a
G8sControlPlaneresource, it validates the Master Node Replicas are a valid count (Right now either 1 or 3). -  
In a
G8sControlPlaneresource, it validates the Master Node Replicas are matching the number of Availability Zones in theAWSControlPlaneresource. -  
In an
AWSControlPlaneresource, it validates the Master Instance Type is a valid Instance Type for the installation. -  
In an
AWSControlPlaneresource, it validates that the order of Master Node Availability Zones does not change on update. -  
In an
AWSControlPlaneresource, it validates that the number of distinct Master Node Availability Zones is maximal. -  
In an
AWSControlPlaneresource, it validates the Master Node Availability Zones are valid AZs for the installation. -  
In an
AWSControlPlaneresource, it validates the Master Node Availability Zones are a valid count (Right now either 1 or 3). -  
In an
AWSControlPlaneresource, it validates the Master Node Availability Zones are matching the number of Replicas in theG8sControlPlaneresource. -  
In an
AWSMachineDeploymentresource, it validates the Machine Deployment ID is matching againstMachineDeploymentresource. -  
In an
AWSMachineDeploymentresource, on creation it validates that theClusteris not deleted. -  
In an
AWSMachinedeploymentresource, it validates that themaxnumber of nodes is not 0 and greater or equal tomin. -  
In a
Clusterresource, the release version label can only be changed to an existing and non-deprecated release by admin users and users in restricted groups. -  
In a
Clusterresource, the release version label can only be changed to a major version that is greater than the current one -  
In a
Clusterresource, the release version label can only be changed if the cluster is in a transitioned condition. ("updated" or "created") but does not skip major versions by admin users and users in restricted groups. -  
In a
Clusterresource, the non-version label values are not allowed to be deleted or renamed by admin users and users in restricted groups. -  
In a
Clusterresource, thegiantswarm.iolabel keys are not allowed to be deleted or renamed by admin users and users in restricted groups. -  
In a
MachineDeploymentresource, on creation it validates that theClusteris not deleted. -  
In a
NetworkPoolresource, it validates the .Spec.CIDRBlock from other NetworkPools and also checks if there's overlapping from Docker CIDR, Kubernetes cluster IP range or tenant cluster CIDR. 
The certificates for the webhook are created with CertManager and injected through the CA Injector.
Firecracker Team
Testing the core-conversion-webhook in a kind cluster on your local machine:
kind create cluster # Build a linux image CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build . docker build . -t core-conversion-webhook:dev kind load docker-image core-conversion-webhook:dev # Make sure the Custom Resource Definitions are in place opsctl ensure crds -k "$(kind get kubeconfig)" -p aws # Insert the certificate kubectl apply --context kind-kind -f local_dev/certmanager.yml ## Wait until certmanager is up kubectl apply --context kind-kind -f local_dev/clusterissuer.yml helm template core-conversion-webhook -f helm/core-conversion-webhook/ci/default-values.yaml helm/core-conversion-webhook > local_dev/deploy.yaml ## Replace image name with core-conversion-webhook:dev kubectl apply --context kind-kind -f local_dev/deploy.yaml kind delete cluster See Releases
- Bugs: issues
 - Please visit https://www.giantswarm.io/responsible-disclosure for information on reporting security issues.
 
See CONTRIBUTING for details on submitting patches, the contribution workflow as well as reporting bugs.
See docs/Release.md
See docs/webhook.md
See docs/tests.md