Help us shape the future of Go! Take the 2026 Go Developer Survey

eks

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package eks emulates Amazon EKS (REST-JSON). With a container engine every cluster is a real Kubernetes API server, a k3s container that checks bearer tokens the way EKS does, so `aws eks update-kubeconfig` and kubectl work unchanged. Node groups, Fargate profiles, add-ons, access entries, identity provider configs and pod identity associations are metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultImage

func DefaultImage() string

DefaultImage is the k3s image of EKS's default Kubernetes version, which GKE and AKS run too.

func Versions added in v0.2.0

func Versions() (all []string, def string)

Versions are the Kubernetes versions pogi can run, newest last, and the one a cluster gets by default.

Types

type K3s

type K3s struct {
	Name     string   // container name
	Image    string   // rancher/k3s:<tag>; docker.images["<Service>.k3s"] overrides it
	Service  string   // pogi.service label
	Resource string   // pogi.resource label
	Token    string   // k3s server token
	Webhook  string   // URL of a TokenReview webhook that authenticates bearer tokens; empty: none
	Args     []string // more k3s server flags

	// Watch and OnExit, when both are set, report a container that stops on its own after Run succeeded: OnExit gets
	// a plain sentence ("killed: out of memory…", "stopped: exit 1 — …"). Watch ends the watching; the Run context
	// ends when Run returns, so it is not that one.
	Watch  context.Context
	OnExit func(note string)
}

K3s is a Kubernetes cluster in one privileged k3s container, its API server published on a random 127.0.0.1 port. EKS runs one per cluster; GKE and AKS can run theirs the same way.

func (*K3s) Run

func (k *K3s) Run(ctx context.Context, d *docker.Client, restart bool) (endpoint string, ca []byte, err error)

Run starts the cluster, a fresh container or (restart) the one it already has, and waits until its node is Ready and its API server answers on the published port. It returns the API server's URL and the PEM of the CA its certificate chains to.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the EKS emulator.

func New

func New(hub *core.Hub) *Service

New creates the EKS service.

func (*Service) Close

func (s *Service) Close() error

Close stops k3s work and removes the clusters' containers, unless state is persisted: the next run starts them again.

func (*Service) Info

func (s *Service) Info() core.Info

func (*Service) Inspect

func (s *Service) Inspect(_, id string) any

Inspect returns a cluster with its parts and pogi's side: its container and pogiNote (never its k3s token).

func (*Service) Kubeconfig added in v0.2.0

func (s *Service) Kubeconfig(name string) (string, error)

Kubeconfig is a kubeconfig for the cluster of that name. kubectl gets its token by running `aws eks get-token`, with the test credentials of pogi's root user (the ones in `pogi env`). It answers 404 for an unknown cluster and 409 for one that is not ACTIVE with an API server yet.

func (*Service) Load

func (s *Service) Load(b []byte) error

Load restores state. Clusters that ran on k3s start their containers again (persisted state leaves them behind on shutdown), or turn FAILED when the engine or the container is gone.

func (*Service) Reset

func (s *Service) Reset()

func (*Service) Resources

func (s *Service) Resources() []core.Table

Resources lists the clusters for the console.

func (*Service) Save

func (s *Service) Save() ([]byte, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL