Last active
September 14, 2023 10:47
-
-
Save ruzickap/6cd45d7d4b97fb6dfc27d1a9a4af848f to your computer and use it in GitHub Desktop.
Install Amazon EKS cluster with Cilium CNI using eksctl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export CLUSTER_NAME="${USER}-cilium" | |
export AWS_DEFAULT_REGION="eu-central-1" | |
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf" | |
export TAGS="[email protected] Environment=dev" | |
set -euxo pipefail | |
cat > "/tmp/eksctl-${CLUSTER_NAME}.yaml" << EOF | |
apiVersion: eksctl.io/v1alpha5 | |
kind: ClusterConfig | |
metadata: | |
name: ${CLUSTER_NAME} | |
region: ${AWS_DEFAULT_REGION} | |
tags: &tags | |
$(echo "${TAGS}" | sed "s/ /\\n /g; s/^/ /g; s/=/: /g") | |
iam: | |
withOIDC: true | |
managedNodeGroups: | |
- name: managed-ng-1 | |
amiFamily: AmazonLinux2 | |
# amiFamily: Bottlerocket | |
instanceType: t3a.medium | |
desiredCapacity: 2 | |
privateNetworking: true | |
minSize: 2 | |
maxSize: 3 | |
volumeSize: 20 | |
volumeType: gp3 | |
maxPodsPerNode: 100 | |
tags: | |
<<: *tags | |
compliance:na:defender: eks-node | |
# compliance:na:defender: bottlerocket | |
volumeEncrypted: true | |
disableIMDSv1: true | |
taints: | |
- key: "node.cilium.io/agent-not-ready" | |
value: "true" | |
effect: "NoSchedule" | |
EOF | |
eksctl create cluster --config-file "/tmp/eksctl-${CLUSTER_NAME}.yaml" --kubeconfig "${KUBECONFIG}" | |
sleep 30 | |
cilium install --helm-set cluster.name="${CLUSTER_NAME}" | |
cilium status --wait | |
# cilium connectivity test | |
echo -e "*****\n export KUBECONFIG=${KUBECONFIG} \n*****" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment