aws / aws/containers-roadmap

[EKS] [Auto Mode]: Publish Go API types and CRD manifests for eks.amazonaws.com resources

Open
#2,823 0 comments 0 reactions 0 assignees View on GitHub
EKS EKS Auto Mode Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

Hello EKS Team,

We are heavily adopting EKS Auto Mode and utilizing the managed load balancing features. We are currently writing custom internal tooling / controllers in Go to programmatically manage and validate our cluster configurations, specifically looking at IngressClass and IngressClassParams resources.

While the standard AWS Load Balancer Controller publishes its API definitions under elbv2.k8s.aws, EKS Auto Mode uses the eks.amazonaws.com API group. Because these API types and Go structs are not publicly published in an open-source repository or module, we are forced to interact with them using unstructured.Unstructured in our Go code, which strips away compile-time type safety.

The Problem / Use Case
Below is a stripped-down example of what we have to do right now just to fetch and inspect an EKS Auto Mode IngressClassParams resource. It requires a lot of boilerplates and map lookups:

```Go
package main

import (
"context"
"fmt"
"log"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-client/kubernetes/dynamic"
)

func main() {
// (Assuming dynamic client initialization is here)
var dynamicClient dynamic.Interface

gvr := schema.GroupVersionResource{
Group: "eks.amazonaws.com",
Version: "v1",
Resource: "ingressclassparams",
}

// We are forced to use Unstructured because no typed client/structs exist publicly
obj, err := dynamicClient.Resource(gvr).Get(context.TODO(), "shared-alb-params-test", metav1.GetOptions{})
if err != nil {
log.Fatalf("Failed to get resource: %v", err)
}

// Parsing nested fields safely out of maps is brittle
scheme, found, err := unstructured.NestedString(obj.Object, "spec", "scheme")
if err != nil || !found {
log.Fatalf("Could not parse scheme field")
}

fmt.Printf("Managed ALB Scheme: %s\n", scheme)
}
```
Our Request
We would like to request that AWS publish the Go API types/structs (e.g., via a public repository or an official subdirectory in aws/aws-sdk-go-v2 or aws/eks-hybrid) and provide raw CRD YAML manifests out-of-band.

Ideally, we want to be able to write type-safe code like this:

```Go
import (
eksv1 "github.com/aws/eks-anywhere-or-similar/apis/eks/v1" // Proposed package
)

// Ideal typed usage:
var params eksv1.IngressClassParams
err := typedClient.Get(ctx, name, ¶ms)
fmt.Println(params.Spec.Scheme)
```

Thank you!

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files, tests, or implementation entry point. Start by reviewing the IngressClass and IngressClassParams examples and the eks.amazonaws.com/v1 resource details in the report; done means the requested public Go API types and raw CRD manifests are available for type-safe use.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, kubernetes
Domain
api, cloud, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.