Skip to content

Commit

Permalink
feat: close gaps in EKS Best Practices (#53)
Browse files Browse the repository at this point in the history
Co-authored-by: Pankaj Khushalani <[email protected]>
  • Loading branch information
kumar-mallikarjuna and pankajatnirmata authored Jan 5, 2023
1 parent 05c0c9f commit e1c95ec
Show file tree
Hide file tree
Showing 8 changed files with 550 additions and 123 deletions.
29 changes: 28 additions & 1 deletion api/v1alpha1/awsadapterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ type AWSAdapterConfigSpec struct {
Region *string `json:"region"`
}

// AccountData contains the AWS Account details
type AccountData struct {
ID *string `json:"id,omitempty"`
InspectorEnabledEC2 *bool `json:"inspectorEnabledEC2,omitempty"`
InspectorEnabledECR *bool `json:"inspectorEnabledECR,omitempty"`
}

// EKSCluster contains the EKS cluster's details
type EKSCluster struct {
ID *string `json:"id,omitempty"`
Expand All @@ -53,6 +60,13 @@ type EKSCluster struct {
Tags map[string]string `json:"tags,omitempty"`
}

// ECRRepository contains container repository details
type ECRRepository struct {
RepositoryName *string `json:"repositoryName,omitempty"`
RepositoryUri *string `json:"repositoryUri,omitempty"`
ImageTagMutable *bool `json:"imageTagMutable,omitempty"`
}

// EKSEncryptionConfig contains encryption configuration of the EKS cluster
type EKSEncryptionConfig struct {
KeyARN *string `json:"keyARN,omitempty"`
Expand All @@ -63,6 +77,7 @@ type EKSEncryptionConfig struct {
type EKSCompute struct {
NodeGroups []*EKSNodeGroup `json:"nodeGroups,omitempty"`
FargateProfiles []string `json:"fargateProfiles,omitempty"`
Reservations []*Reservation `json:"reservations,omitempty"`
}

// EKSNodeGroup contains info of the EKS cluster's node group
Expand Down Expand Up @@ -95,6 +110,15 @@ type EKSNodeGroupUpdateConfig struct {
MaxUnavailablePercentage *int32 `json:"maxUnavailablePercentage,omitempty"`
}

type Reservation struct {
Instances []*Instance `json:"instances,omitempty"`
}

type Instance struct {
HttpPutResponseHopLimit *int32 `json:"httpPutResponseHopLimit,omitempty"`
PublicDnsName *string `json:"publicDnsName,omitempty"`
}

// EKSNodeGroupResources contains info of ASG and remote access SG for node group
type EKSNodeGroupResources struct {
AutoScalingGroups []string `json:"autoScalingGroups,omitempty"`
Expand Down Expand Up @@ -144,6 +168,7 @@ type EKSVpcConfig struct {
SecurityGroupIDs []string `json:"securityGroupIDs,omitempty"`
SubnetIDs []string `json:"subnetIDs,omitempty"`
VpcID *string `json:"vpcID,omitempty"`
FlowLogsEnabled *bool `json:"flowLogsEnabled,omitempty"`
}

// EKSNetworking contains networking configuration of the EKS cluster
Expand Down Expand Up @@ -182,10 +207,12 @@ type AWSAdapterConfigStatus struct {
LastUpdatedTimestamp *metav1.Time `json:"lastUpdatedTimestamp,omitempty"`
// Information on when the adapter last tried to fetch the EKS cluster details
LastPollInfo LastPollInfo `json:"lastPollInfo"`
AccountData *AccountData `json:"accountData,omitempty"`
// EKS cluster details fetched from AWS
// For details of individual fields, refer to AWS SDK docs:
// https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/[email protected]/types#Cluster
EKSCluster *EKSCluster `json:"eksCluster,omitempty"`
EKSCluster *EKSCluster `json:"eksCluster,omitempty"`
ECRRepositories []*ECRRepository `json:"ecrRepositories,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
143 changes: 143 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e1c95ec

Please sign in to comment.