-
Notifications
You must be signed in to change notification settings - Fork 3
/
mkeks
executable file
·40 lines (33 loc) · 1.2 KB
/
mkeks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Create an EKS cluster for demonstrating import to open cluster management
# https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html
export KUBECONFIG=$(mktemp kubeconfig-eks.XXXX)
echo "Kubeconfig: $KUBECONFIG"
aws --no-cli-pager sts get-caller-identity > /dev/null
if [ $? -ne 0 ]; then
echo "Please login to AWS. Hint: Set AWS_PROFILE"
exit 1
fi
CLUSTER_NAME=${1:-eks-tofu}
EKS_VERSION=${2:-1.27}
# RHACS sensor needs 2C, 4G
# --node-type t3.medium \
eksctl create cluster \
--name "${CLUSTER_NAME}" \
--version "${EKS_VERSION}" \
--region us-west-2 \
--nodegroup-name "standard-workers-${CLUSTER_NAME}" \
--node-type t3.xlarge \
--nodes 3 \
--nodes-min 1 \
--nodes-max 4 \
--ssh-access \
--ssh-public-key ~/.ssh/acm.pub \
--managed
# eksctl utils describe-stacks --region=us-west-2 --cluster=$CLUSTER_NAME
# eksctl delete cluster --name=eks-tofu
# https://repost.aws/knowledge-center/eks-persistent-storage
#aws eks describe-cluster --name "$CLUSTER_NAME" --query "cluster.identity.oidc.issuer" --output text
#None
#aws iam list-open-id-connect-providers | grep OIDC_PROVIDER_ID
#$