### Install GoFormation Source: https://github.com/eksctl-io/eksctl/blob/main/pkg/goformation/README.md Install the GoFormation library using go get. Ensure you are using the latest version for the most up-to-date features and resource definitions. ```bash go get github.com/awslabs/goformation/v4 ``` -------------------------------- ### Example Service Account with Wildcard Pattern Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/iamserviceaccounts.md Example of creating a role that allows all service accounts starting with 'app-' in the 'default' namespace to be assumed. Use wildcard patterns cautiously to ensure security. ```bash eksctl create iamserviceaccount \ --cluster= \ --name=app-base \ --namespace=default \ --attach-policy-arn=arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess \ --subject-pattern="app-*" ``` -------------------------------- ### Addon Details Output Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/addons.md Example output of the 'eksctl get addon' command, showing ConfigurationValues and other addon details. ```yaml - ConfigurationValues: '{"replicaCount":3}' IAMRole: "" Issues: null Name: coredns NewerVersion: "" Status: ACTIVE Version: v1.8.7-eksbuild.3 ``` -------------------------------- ### Example add-on pod status output Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/nodegroup-unmanaged.md This is an example of the expected output after successfully upgrading add-ons, showing that all relevant pods are running and ready. ```shell NAME READY STATUS RESTARTS AGE aws-node-g5ghn 1/1 Running 0 2m aws-node-zfc9s 1/1 Running 0 2m coredns-7bcbfc4774-g6gg8 1/1 Running 0 1m coredns-7bcbfc4774-hftng 1/1 Running 0 1m kube-proxy-djkp7 1/1 Running 0 3m kube-proxy-mpdsp 1/1 Running 0 3m ``` -------------------------------- ### Install Dependencies and Build eksctl Source: https://github.com/eksctl-io/eksctl/blob/main/CONTRIBUTING.md Install the necessary dependencies and build the eksctl binary. The binary will be placed in the root of your cloned repository. ```bash make install-build-deps make build ``` -------------------------------- ### Complete ClusterConfig with CloudWatch Logging Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/cloudwatch-cluster-logging.md A complete `ClusterConfig` example demonstrating the setup for a new EKS cluster, including enabling specific CloudWatch log types and setting a retention period. ```yaml apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: cluster-11 region: eu-west-2 nodeGroups: - name: ng-1 instanceType: m5.large desiredCapacity: 1 cloudWatch: clusterLogging: enableTypes: ["audit", "authenticator"] logRetentionInDays: 7 ``` -------------------------------- ### Addon Details with Namespace Output Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/addons.md Example output of the 'eksctl get addon' command showing the NamespaceConfig, including the custom namespace. ```yaml - ConfigurationValues: "" IAMRole: "" Issues: null Name: aws-ebs-csi-driver NamespaceConfig: namespace: custom-namespace NewerVersion: "" PodIdentityAssociations: null Status: ACTIVE Version: v1.47.0-eksbuild.1 ``` -------------------------------- ### Install eksctl with Scoop on Windows Source: https://github.com/eksctl-io/eksctl/blob/main/README.md Install eksctl on Windows using the Scoop package manager. ```powershell scoop install eksctl ``` -------------------------------- ### Build and Serve User Documentation Source: https://github.com/eksctl-io/eksctl/blob/main/CONTRIBUTING.md Build and serve the user documentation locally. Requires python3 and pip3 to be installed. ```bash # Requires python3 and pip3 installed in your local system make install-site-deps make build-pages make serve-pages ``` -------------------------------- ### Install NVIDIA Device Plugin (Older Versions) Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/gpu-support.md For older versions, use this command to manually install the NVIDIA Kubernetes device plugin from a GitHub URL. ```bash kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin//nvidia-device-plugin.yml ``` -------------------------------- ### Install eksctl with Chocolatey on Windows Source: https://github.com/eksctl-io/eksctl/blob/main/README.md Install eksctl on Windows using the Chocolatey package manager. ```powershell choco install eksctl ``` -------------------------------- ### Basic Node Repair with Percentage Thresholds Example Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/nodegroup-node-repair-config.md A complete configuration example demonstrating basic node repair with percentage-based thresholds for both unhealthy nodes and parallel repairs. ```yaml apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: basic-repair-cluster region: us-west-2 managedNodeGroups: - name: basic-ng instanceType: m5.large desiredCapacity: 3 nodeRepairConfig: enabled: true maxUnhealthyNodeThresholdPercentage: 20 maxParallelNodesRepairedPercentage: 15 ``` -------------------------------- ### Preview eksctl Docs Locally Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/README.md Use this command to serve the documentation locally for previewing changes. Ensure MkDocs is installed. ```console $ make serve-pages INFO - Building documentation... INFO - Cleaning site directory INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration: - index.md [I 191218 10:16:30 server:296] Serving on http://127.0.0.1:8000 [I 191218 10:16:30 handlers:62] Start watching changes [I 191218 10:16:30 handlers:64] Start detecting changes [I 191218 10:16:33 handlers:135] Browser Connected: http://127.0.0.1:8000/introduction/ ... ``` -------------------------------- ### Install NVIDIA Device Plugin (Newer Versions) Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/gpu-support.md For versions 0.15.0 and above, use this command to manually install the NVIDIA Kubernetes device plugin from a GitHub URL. ```bash kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin//deployments/static/nvidia-device-plugin.yml ``` -------------------------------- ### Install eksctl on Unix Source: https://github.com/eksctl-io/eksctl/blob/main/README.md Download and install the latest eksctl release for Unix-like systems. Verify the checksum for integrity. Requires ARCH and PLATFORM variables to be set. ```bash # for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7` ARCH=amd64 PLATFORM=$(uname -s)_$ARCH curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz" # (Optional) Verify checksum curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz sudo install -m 0755 /tmp/eksctl /usr/local/bin && rm /tmp/eksctl ``` -------------------------------- ### Run Unit Tests Source: https://github.com/eksctl-io/eksctl/blob/main/CONTRIBUTING.md Run the unit tests for eksctl after installing build dependencies. ```bash make test ``` -------------------------------- ### Check EKS Anywhere Version Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/eksctl-anywhere.md Execute this command to verify the installation and version of the eksctl-anywhere binary. Ensure the binary is in your PATH. ```shell eksctl anywhere version v0.5.0 ``` -------------------------------- ### Create kops cluster Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/vpc-configuration.md Example command to create a kops cluster. This is a prerequisite for using an existing kops-managed VPC with eksctl. ```bash export KOPS_STATE_STORE=s3://kops kops create cluster cluster-1.k8s.local --zones=us-west-2c,us-west-2b,us-west-2a --networking=weave --yes ``` -------------------------------- ### Install eksctl with Homebrew on macOS Source: https://github.com/eksctl-io/eksctl/blob/main/README.md Install eksctl on macOS using Homebrew by first tapping the weaveworks repository and then installing the eksctl package. ```bash brew tap weaveworks/tap brew install weaveworks/tap/eksctl ``` -------------------------------- ### Build eksctl Binary on Windows Source: https://github.com/eksctl-io/eksctl/blob/main/CONTRIBUTING.md On Windows, you can build the eksctl binary and run unit tests using Go commands if you have Git and Go installed, as the Makefile is not yet portable. ```bash go build .\cmd\eksctl go test .\pkg\... ``` -------------------------------- ### List Available Add-on Versions for a Cluster Source: https://context7.com/eksctl-io/eksctl/llms.txt This command lists all available EKS add-on versions that can be installed on a specified cluster. ```bash # List available addons for a cluster eksctl utils describe-addon-versions --cluster my-cluster ``` -------------------------------- ### Example Commit Messages Source: https://github.com/eksctl-io/eksctl/blob/main/pkg/goformation/CONTRIBUTING.md Follow these examples for structuring your commit messages according to conventional commits. ```commit `fix(pencil): stop graphite breaking when too much pressure applied` ``` ```commit `feat(pencil): add 'graphiteWidth' option` Fix #42 ``` ```commit perf(pencil): remove graphiteWidth option` BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reasons. ``` -------------------------------- ### AmazonLinux2023 NodeConfig Example Source: https://github.com/eksctl-io/eksctl/blob/main/pkg/nodebootstrap/README.md Example of the multipart/mixed MIME content for AmazonLinux2023 node initialization using nodeadm. This configuration specifies cluster details and kubelet flags. ```text MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=// --// Content-Type: application/node.eks.aws apiVersion: node.eks.aws/v1alpha1 kind: NodeConfig spec: cluster: apiServerEndpoint: https://XXXX.us-west-2.eks.amazonaws.com certificateAuthority: XXXX cidr: 10.100.0.0/16 name: my-cluster kubelet: config: clusterDNS: - 10.100.0.10 flags: - --node-labels=alpha.eksctl.io/cluster-name=my-cluster,alpha.eksctl.io/nodegroup-name=my-nodegroup - --register-with-taints=special=true:NoSchedule (only for EKS-managed nodes) --//-- ``` -------------------------------- ### Example Access Entry JSON Output Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/hybrid-nodes.md An example JSON output representing an access entry for a Hybrid Nodes IAM Role, mapping it to Kubernetes groups. ```json [ { "principalARN": "arn:aws:iam::000011112222:role/eksctl-my-cluster-clust-HybridNodesSSMRole-XiIAg0d29PkO", "kubernetesGroups": [ "system:nodes" ] } ] ``` -------------------------------- ### Configure Addon with YAML Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/addons.md Provide addon configuration values in a YAML file during creation or update. This example shows setting the replicaCount for the coredns addon. ```yaml addons: - name: coredns configurationValues: |- replicaCount: 2 ``` -------------------------------- ### Create Service Account with S3 Read-Only Access Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/iamserviceaccounts.md Example of creating a service account with read-only access to S3. By default, it is created in the 'default' namespace. ```bash eksctl create iamserviceaccount --cluster= --name=s3-read-only --attach-policy-arn=arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess ``` -------------------------------- ### Get Addon Details with ConfigurationValues Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/addons.md Retrieve addon details, including its ConfigurationValues, in YAML format. This command helps verify the current addon configuration. ```bash eksctl get addon --cluster my-cluster --output yaml ``` -------------------------------- ### Create and Test with a Pre-created Cluster Source: https://github.com/eksctl-io/eksctl/blob/main/CONTRIBUTING.md Set up a development cluster, run integration tests against it, and then delete the cluster. This provides a faster turnaround for testing. ```bash TEST_CLUSTER= make create-integration-test-dev-cluster TEST_CLUSTER= make integration-test-dev TEST_CLUSTER= make delete-integration-test-dev-cluster ``` -------------------------------- ### EKS Cluster Creation Output Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/getting-started.md This is an example of the output you can expect when creating an EKS cluster using the 'eksctl create cluster' command. It shows the progress of resource creation, including CloudFormation stacks and nodegroup setup. ```sh $ eksctl create cluster [ℹ] using region us-west-2 [ℹ] setting availability zones to [us-west-2a us-west-2c us-west-2b] [ℹ] subnets for us-west-2a - public:192.168.0.0/19 private:192.168.96.0/19 [ℹ] subnets for us-west-2c - public:192.168.32.0/19 private:192.168.128.0/19 [ℹ] subnets for us-west-2b - public:192.168.64.0/19 private:192.168.160.0/19 [ℹ] nodegroup "ng-98b3b83a" will use "ami-05ecac759c81e0b0c" [AmazonLinux2/1.11] [ℹ] creating EKS cluster "floral-unicorn-1540567338" in "us-west-2" region [ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup [ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --cluster=floral-unicorn-1540567338' [ℹ] 2 sequential tasks: { create cluster control plane "floral-unicorn-1540567338", create nodegroup "ng-98b3b83a" } [ℹ] building cluster stack "eksctl-floral-unicorn-1540567338-cluster" [ℹ] deploying stack "eksctl-floral-unicorn-1540567338-cluster" [ℹ] building nodegroup stack "eksctl-floral-unicorn-1540567338-nodegroup-ng-98b3b83a" [ℹ] --nodes-min=2 was set automatically for nodegroup ng-98b3b83a [ℹ] --nodes-max=2 was set automatically for nodegroup ng-98b3b83a [ℹ] deploying stack "eksctl-floral-unicorn-1540567338-nodegroup-ng-98b3b83a" [✔] all EKS cluster resource for "floral-unicorn-1540567338" had been created [✔] saved kubeconfig as "~/.kube/config" [ℹ] adding role "arn:aws:iam::376248598259:role/eksctl-ridiculous-sculpture-15547-NodeInstanceRole-1F3IHNVD03Z74" to auth ConfigMap [ℹ] nodegroup "ng-98b3b83a" has 1 node(s) [ℹ] node "ip-192-168-64-220.us-west-2.compute.internal" is not ready [ℹ] waiting for at least 2 node(s) to become ready in "ng-98b3b83a" [ℹ] nodegroup "ng-98b3b83a" has 2 node(s) [ℹ] node "ip-192-168-64-220.us-west-2.compute.internal" is ready [ℹ] node "ip-192-168-8-135.us-west-2.compute.internal" is ready [ℹ] kubectl command should work with "~/.kube/config", try 'kubectl get nodes' [✔] EKS cluster "floral-unicorn-1540567338" in "us-west-2" region is ready ``` -------------------------------- ### Clone and Set Up Remotes Source: https://github.com/eksctl-io/eksctl/blob/main/pkg/goformation/CONTRIBUTING.md Clone your fork of the repository and add the original repository as an upstream remote. ```bash # Clone your fork of the repo into the current directory $ git clone https://github.com//goformation # Navigate to the newly cloned directory $ cd goformation # Assign the original repo to a remote called "upstream" $ git remote add upstream https://github.com/awslabs/goformation ``` -------------------------------- ### Install eksctl with MacPorts on macOS Source: https://github.com/eksctl-io/eksctl/blob/main/README.md Install eksctl on macOS using the MacPorts package manager. ```bash port install eksctl ``` -------------------------------- ### Example Output of Eksctl Create Cluster Source: https://github.com/eksctl-io/eksctl/blob/main/README.md This output shows the detailed steps and information logged during the creation of an EKS cluster using the 'eksctl create cluster' command. It includes region, availability zones, subnet details, Kubernetes version, and cluster status. ```bash $ eksctl create cluster [ℹ] eksctl version 0.143.0 [ℹ] using region eu-west-2 [ℹ] setting availability zones to [eu-west-2a eu-west-2c eu-west-2b] [ℹ] subnets for eu-west-2a - public:192.168.0.0/19 private:192.168.96.0/19 [ℹ] subnets for eu-west-2c - public:192.168.32.0/19 private:192.168.128.0/19 [ℹ] subnets for eu-west-2b - public:192.168.64.0/19 private:192.168.160.0/19 [ℹ] nodegroup "ng-ac4c787c" will use "" [AmazonLinux2/1.25] [ℹ] using Kubernetes version 1.25 [ℹ] creating EKS cluster "attractive-sculpture-1685534556" in "eu-west-2" region with managed nodes [ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial managed nodegroup [ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=eu-west-2 --cluster=attractive-sculpture-1685534556' [ℹ] Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "attractive-sculpture-1685534556" in "eu-west-2" [ℹ] CloudWatch logging will not be enabled for cluster "attractive-sculpture-1685534556" in "eu-west-2" [ℹ] you can enable it with 'eksctl utils update-cluster-logging --enable-types={SPECIFY-YOUR-LOG-TYPES-HERE (e.g. all)} --region=eu-west-2 --cluster=attractive-sculpture-1685534556' [ℹ] 2 sequential tasks: { create cluster control plane "attractive-sculpture-1685534556", 2 sequential sub-tasks: { wait for control plane to become ready, create managed nodegroup "ng-ac4c787c", } } [ℹ] building cluster stack "eksctl-attractive-sculpture-1685534556-cluster" [ℹ] deploying stack "eksctl-attractive-sculpture-1685534556-cluster" [ℹ] waiting for CloudFormation stack "eksctl-attractive-sculpture-1685534556-cluster" [ℹ] building managed nodegroup stack "eksctl-attractive-sculpture-1685534556-nodegroup-ng-ac4c787c" [ℹ] deploying stack "eksctl-attractive-sculpture-1685534556-nodegroup-ng-ac4c787c" [ℹ] waiting for CloudFormation stack "eksctl-attractive-sculpture-1685534556-nodegroup-ng-ac4c787c" [ℹ] waiting for the control plane to become ready [✔] all EKS cluster resources for "attractive-sculpture-1685534556" have been created [ℹ] nodegroup "ng-ac4c787c" has 2 node(s) [ℹ] node "ip-192-168-20-235.eu-west-2.compute.internal" is ready [ℹ] node "ip-192-168-80-49.eu-west-2.compute.internal" is ready [ℹ] waiting for at least 2 node(s) to become ready in "ng-ac4c787c" [ℹ] nodegroup "ng-ac4c787c" has 2 node(s) [ℹ] node "ip-192-168-20-235.eu-west-2.compute.internal" is ready [ℹ] node "ip-192-168-80-49.eu-west-2.compute.internal" is ready [ℹ] kubectl command should work with ".../.kube/config", try 'kubectl get nodes' [✔] EKS cluster "attractive-sculpture-1685534556" in "eu-west-2" region is ready $ ``` -------------------------------- ### Create EKS Cluster with GPU and Disable NVIDIA Plugin Installation Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/gpu-support.md Use this command to create an EKS cluster with a GPU instance type while disabling the automatic installation of the NVIDIA device plugin. You will need to install it manually. ```bash eksctl create cluster --node-type=g5.xlarge --install-nvidia-plugin=false ``` -------------------------------- ### Install Pod Identity Agent Addon Source: https://context7.com/eksctl-io/eksctl/llms.txt This command installs the EKS Pod Identity agent addon, which is a prerequisite for using Pod Identity Associations. ```bash # Install the pod identity agent addon (required) eksctl create addon --cluster my-cluster --name eks-pod-identity-agent ``` -------------------------------- ### Flux Configuration with Extra Args Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-008-flux2.md Demonstrates a comprehensive YAML configuration for Flux GitOps, including provider-specific settings and an `fluxExtraArgs` list for arbitrary flags. This example shows settings for GitLab, GitHub, and Git providers. ```yaml gitops: flux: # gitlab, github and git would not be specified all at once ofc, but you get the idea gitlab: branch: main namespace: "flux-system" components: - "source-controller" - "kustomize-controller" fluxExtraArgs: - "--flag-one=value" - "--flag-two value" - "--bool-flag" interval: 1m0s path: "clusters/cluster-27" owner: dr-who repository: my-cluster-gitops personal: true hostname: "gh-enterprise.com" interval: 1m0s private: true readWriteKey: true reconcile: true teams: - "team1" - "team2" github: ... would be same as gitlag git: branch: main namespace: "flux-system" components: - "source-controller" - "kustomize-controller" fluxExtraArgs: - "--flag-one=value" - "--flag-two value" - "--bool-flag" interval: 1m0s path: "clusters/cluster-27" username: "dr-who" passwordFile: /basic/auth/pass url: https://// ``` -------------------------------- ### Create Cluster and Nodegroup from Separate Files Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-003-extending-use-of-config-file.md This demonstrates two methods for creating a cluster and additional nodegroups using separate configuration files. ```bash eksctl create cluster --config-file=cluster.yaml && eksctl create ng --config-file=extra-nodegroup.yaml ``` ```bash cat cluster.yaml extra-nodegroup.yaml | eksctl create cluster --config-file - ``` -------------------------------- ### Get All IAM Identity Mappings Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/iam-identity-mappings.md Retrieves all identity mappings for a specified EKS cluster and region. ```bash eksctl get iamidentitymapping --cluster --region= ``` -------------------------------- ### Create Selected Nodegroups During Cluster Creation Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-003-extending-use-of-config-file.md This example shows how `eksctl create cluster` could be updated to allow creating selected nodegroups defined in the cluster config using glob patterns. ```bash eksctl create cluster --config-file=cluster.yaml --include='.*-private' ## only nodegroups matching glob pattern will be created ``` -------------------------------- ### Karpenter Configuration Options Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/eksctl-karpenter.md Customize Karpenter installation by setting options like `createServiceAccount`, `defaultInstanceProfile`, and `withSpotInterruptionQueue`. ```yaml karpenter: version: '1.2.1' createServiceAccount: true # default is false defaultInstanceProfile: 'KarpenterNodeInstanceProfile' # default is to use the IAM instance profile created by eksctl withSpotInterruptionQueue: true # adds all required policies and rules for supporting Spot Interruption Queue, default is false ``` -------------------------------- ### Create nodegroup with instance selector (dry-run) Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-007-instance-selector-dry-run.md Use this command to preview the ClusterConfig for a new nodegroup with specific instance requirements. The output includes a generated ClusterConfig file that can be used to create the nodegroup. ```shell $ eksctl create nodegroup --cluster=dev --managed --spot --instance-selector-vcpus=2 --instance-selector-memory=4 --dry-run apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: dev region: us-west-2 managedNodeGroups: - name: spot: true instanceTypes: ["c3.large", "c4.large", "c5.large", "c5d.large", "c5n.large", "c5a.large"] instanceSelector: vCPUs: 2 memory: 4 ``` -------------------------------- ### Get Fargate Profiles in JSON Format Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/fargate-support.md Retrieve existing Fargate profiles for an EKS cluster in JSON format. ```bash eksctl get fargateprofile --cluster fargate-example-cluster -o json ``` -------------------------------- ### Get Fargate Profiles in YAML Format Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/fargate-support.md View existing Fargate profiles for an EKS cluster in YAML format. ```bash eksctl get fargateprofile --cluster fargate-example-cluster -o yaml ``` -------------------------------- ### Create EKS Cluster on Outposts (Initial Command) Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/outposts.md Execute this command to initiate the creation of an EKS control plane and subnets on the specified Outpost. Use the --without-nodegroup flag if nodegroups are to be added later, as direct nodegroup creation during this step is not supported without prior VPC-local gateway association. ```shell eksctl create cluster -f outpost.yaml ``` -------------------------------- ### Verify Flux Controller Pods Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/gitops-v2.md Check the status of Flux v2 controller pods after installation. All controllers should be in a 'Running' state. ```bash kubectl get pods --namespace flux-system ``` -------------------------------- ### Create Capabilities After Cluster Creation Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/capabilities.md Use the `eksctl create capability` command with a configuration file to add capabilities to an existing cluster. ```console eksctl create capability -f config.yaml ``` -------------------------------- ### Configure Zsh Completion for eksctl Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/installation.md Set up Zsh completion by creating a directory for completion scripts and adding it to your fpath. Ensure autocompletion is initialized if not already. ```zsh mkdir -p ~/.zsh/completion/ eksctl completion zsh > ~/.zsh/completion/_eksctl ``` ```zsh fpath=($fpath ~/.zsh/completion) ``` ```zsh autoload -U compinit compinit ``` -------------------------------- ### List Available Add-on Versions for a Kubernetes Version Source: https://context7.com/eksctl-io/eksctl/llms.txt This command lists available EKS add-on versions compatible with a specific Kubernetes version. ```bash # List available addons for a specific Kubernetes version eksctl utils describe-addon-versions --kubernetes-version 1.29 ``` -------------------------------- ### Use Default VPC with All Existing Subnets Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-002_existing-vpc.md Instruct eksctl to use the default VPC and all of its associated subnets for cluster creation. This is a convenient option when no specific subnets are required. ```bash eksctl create cluster --vpc-id=default ``` -------------------------------- ### Minimal Nodegroup Configuration Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/spot-instances.md A minimal configuration for a nodegroup specifying instance types. This example focuses on the essential `instancesDistribution` settings. ```yaml nodeGroups: - name: ng-1 instancesDistribution: instanceTypes: ["t3.small", "t3.medium"] # At least one instance type should be specified ``` -------------------------------- ### CLI Command Structure Source: https://github.com/eksctl-io/eksctl/blob/main/docs/guidelines/design-conventions.md Commands should follow the `eksctl ` pattern, similar to `kubectl`. Resource names can be provided as arguments or via the `--name` flag. ```bash eksctl create nodegroup ng-1 ``` ```bash eksctl create nodegroup --name ng-1 ``` ```bash eksctl create nodegroup --cluster clus1 ng-1 ``` -------------------------------- ### List Nodegroups in YAML Format Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/nodegroups.md Get detailed information about nodegroups in YAML format for better readability and programmatic parsing. ```bash # YAML format eksctl get nodegroup --cluster= [--name=] --output=yaml ``` -------------------------------- ### Create Addon Explicitly using eksctl Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/addons.md Create EKS addons after cluster creation using a configuration file. ```bash eksctl create addon -f config.yaml ``` -------------------------------- ### Create Nodegroup with Spot Instances Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/spot-instances.md Add a managed nodegroup using Spot instances to an existing cluster with the `--spot` flag. Instance types can be specified. ```bash $ eksctl create nodegroup --cluster= --spot --instance-types=c3.large,c4.large,c5.large ``` -------------------------------- ### Get Fargate Profiles in a Cluster Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/fargate-support.md Retrieve a list of existing Fargate profiles for a given EKS cluster in a tabular format. ```bash eksctl get fargateprofile --cluster fargate-example-cluster ``` -------------------------------- ### Get IAM Identity Mappings by ARN Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/iam-identity-mappings.md Retrieves identity mappings that match a specific ARN for an EKS cluster and region. ```bash eksctl get iamidentitymapping --cluster --region= --arn arn:aws:iam::123456:role/testing-role ``` -------------------------------- ### Create a new feature branch Source: https://github.com/eksctl-io/eksctl/blob/main/CONTRIBUTING.md Create a new topic branch from your desired base, typically 'main', before starting your work. ```bash git checkout -b ``` -------------------------------- ### Create Namespace and Deploy Pod for Fargate Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/fargate-support.md Use these kubectl commands to create a namespace and deploy a pod to be scheduled on Fargate. Ensure the namespace is whitelisted or the pod has the correct scheduler annotation. ```bash $ kubectl create namespace dev namespace/dev created ``` ```bash $ kubectl run nginx --image=nginx --restart=Never --namespace dev pod/nginx created ``` ```bash $ kubectl get pods --all-namespaces --output wide NAMESPACE NAME READY STATUS AGE IP NODE dev nginx 1/1 Running 75s 192.168.183.140 fargate-ip-192-168-183-140.ap-northeast-1.compute.internal kube-system aws-node-44qst 1/1 Running 21m 192.168.70.246 ip-192-168-70-246.ap-northeast-1.compute.internal kube-system aws-node-4vr66 1/1 Running 21m 192.168.23.122 ip-192-168-23-122.ap-northeast-1.compute.internal kube-system coredns-699bb99bf8-84x74 1/1 Running 26m 192.168.2.95 ip-192-168-23-122.ap-northeast-1.compute.internal kube-system coredns-699bb99bf8-f6x6n 1/1 Running 26m 192.168.90.73 ip-192-168-70-246.ap-northeast-1.compute.internal kube-system kube-proxy-brxhg 1/1 Running 21m 192.168.23.122 ip-192-168-23-122.ap-northeast-1.compute.internal kube-system kube-proxy-zd7s8 1/1 Running 21m 192.168.70.246 ip-192-168-70-246.ap-northeast-1.compute.internal ``` -------------------------------- ### Create Cluster with Spot Managed Nodegroup Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/spot-instances.md Use the `--spot` flag to create a cluster with a managed nodegroup utilizing Spot instances. Optionally specify instance types. ```bash $ eksctl create cluster --spot --instance-types=c3.large,c4.large,c5.large ``` -------------------------------- ### Get Add-on Configuration Schema Source: https://context7.com/eksctl-io/eksctl/llms.txt This command retrieves the configuration schema for a specific add-on version, detailing the available configuration parameters. ```bash # Get addon configuration schema eksctl utils describe-addon-configuration --name vpc-cni --version v1.12.0-eksbuild.1 ``` -------------------------------- ### Create a Fargate Profile with a Specific Name Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/fargate-support.md Create a Fargate profile with a custom name. The name must not start with the prefix `eks-`. ```bash eksctl create fargateprofile --namespace dev --cluster fargate-example-cluster --name fp-development ``` -------------------------------- ### Ubuntu Troubleshooting Commands Source: https://github.com/eksctl-io/eksctl/blob/main/pkg/nodebootstrap/README.md Commands to check Kubelet logs and Docker service status on Ubuntu nodes. Also lists key files involved in the bootstrapping process. ```sh sudo snap logs kubelet-eks [-n=all/20] systemctl status docker.service ``` ```text /etc/eks/bootstrap.sh /var/lib/cloud/scripts/eksctl/bootstrap.ubuntu.sh /etc/kubernetes/kubelet/kubelet-config.json /etc/docker/daemon.json ``` -------------------------------- ### Create Cluster using ClusterConfig with Instance Selector Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/instance-selector.md Apply the instance selector configuration defined in a ClusterConfig file to create a cluster. ```bash $ eksctl create cluster -f instance-selector-cluster.yaml ``` -------------------------------- ### Nodegroup with GPU Instances Source: https://github.com/eksctl-io/eksctl/blob/main/userdocs/src/usage/spot-instances.md Example of a nodegroup configured to use GPU instances with mixed instance types. The `instanceType` field should be set to 'mixed'. ```yaml nodeGroups: - name: ng-gpu instanceType: mixed desiredCapacity: 1 instancesDistribution: instanceTypes: - g5.xlarge - g5.8xlarge - g5.16xlarge maxPrice: 0.50 ``` -------------------------------- ### Dry Run for Cluster Creation with Instance Selector Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-007-instance-selector-dry-run.md Use the `--dry-run` option with `eksctl create cluster` to output a `ClusterConfig` file reflecting the specified CLI options, including instance types determined by the instance selector. This allows for inspection and modification before actual creation. ```shell eksctl create cluster --name development --managed --instance-selector-vcpus=2 --instance-selector-memory=4 --dry-run > config.yaml ``` -------------------------------- ### Define eksctl Managed Node Group Source: https://github.com/eksctl-io/eksctl/blob/main/docs/proposal-007-apply.md Example configuration for an eksctl-managed nodegroup. This defines the name and desired capacity for a nodegroup that eksctl will manage. ```yaml nodeGroups: - name: ng-2 desiredCapacity: 1 ```