Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eks: Implement deploy script and guide for EKS #78

Merged
merged 128 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
74adca1
Started workin on EKS automation script
LudiSistemas Aug 26, 2022
3a0915d
fixing typo
LudiSistemas Aug 26, 2022
2337e9a
geting ready for more advanced logic
LudiSistemas Aug 29, 2022
f1188e4
minor changes, and starting to work on the aws cli part
LudiSistemas Sep 1, 2022
6a47957
populating .env and addin cluster config template creation function
LudiSistemas Sep 1, 2022
db72612
adding function to create cluster and adding log dir to gitignore
LudiSistemas Sep 1, 2022
35a5a23
adding log dir to gitignore
LudiSistemas Sep 1, 2022
3f3c5ca
calling functions from main
LudiSistemas Sep 1, 2022
95691cd
changing naming
LudiSistemas Sep 1, 2022
fa4e405
adding efs creation and mounting script part
LudiSistemas Sep 3, 2022
6d1b803
adding multus, daemon yamls
dektech Sep 5, 2022
ebdf9ed
crb
dektech Sep 5, 2022
501ddc5
Adding more aws logic
LudiSistemas Sep 5, 2022
dd433d8
Merge branch 'eks' of github.com:testground/infra into eks
LudiSistemas Sep 5, 2022
1efa54c
adding ebs to the construct
LudiSistemas Sep 5, 2022
6cd8082
added ds-s and the rest of the important things
LudiSistemas Sep 6, 2022
960ecc1
adding yaml files
LudiSistemas Sep 6, 2022
affab7d
pre test fix
LudiSistemas Sep 7, 2022
b6dc394
fix before test
LudiSistemas Sep 9, 2022
fd685cf
removing white spaces before and after in var naming
LudiSistemas Sep 9, 2022
583f05c
fixing logging
LudiSistemas Sep 9, 2022
afdbea7
preping for logging
LudiSistemas Sep 9, 2022
50a9ca3
a bit difrent aproach
LudiSistemas Sep 9, 2022
945286f
fixing os detection issue
LudiSistemas Sep 9, 2022
2308e2b
fixing fi
LudiSistemas Sep 9, 2022
5b3577d
debuging
LudiSistemas Sep 9, 2022
f5049fc
debuging issue
LudiSistemas Sep 9, 2022
a228f73
debuging
LudiSistemas Sep 9, 2022
27b9144
typo
LudiSistemas Sep 9, 2022
5dd2431
refactorin logging
LudiSistemas Sep 9, 2022
0db7651
did not specify the flag
LudiSistemas Sep 9, 2022
e417b0d
missed the path
LudiSistemas Sep 9, 2022
df1edfc
adding files
LudiSistemas Sep 10, 2022
d2589f4
adding temp log path
LudiSistemas Sep 10, 2022
aadda73
bug fixinig
LudiSistemas Sep 10, 2022
e037959
Multus change
LudiSistemas Sep 13, 2022
e12129f
its confuisng aws, removing it
LudiSistemas Sep 13, 2022
c1e37ae
finaly found a way to look up the new subnet
LudiSistemas Sep 13, 2022
e3d38f1
did not call a function
LudiSistemas Sep 14, 2022
c7a64f8
fixinf network for sg cration
LudiSistemas Sep 14, 2022
d96a76a
fixing exports
LudiSistemas Sep 14, 2022
4016230
correcting the path
LudiSistemas Sep 14, 2022
a7bade7
correcting the path
LudiSistemas Sep 14, 2022
5943840
minor changes and formatting, adding cm
dektech Sep 20, 2022
85f57a9
switching to private security group
LudiSistemas Sep 20, 2022
f140706
missed one
LudiSistemas Sep 20, 2022
0a4c241
modifing to use shared sg for efs
LudiSistemas Sep 20, 2022
316a967
forgot to call the function
LudiSistemas Sep 20, 2022
0c45a7f
fixing multus softlink
dektech Sep 21, 2022
5cb1d29
Merge branch 'eks' of https://github.com/testground/infra into eks
dektech Sep 21, 2022
d3c82b1
adding cleanup functionality. Untested
LudiSistemas Sep 21, 2022
f6ce979
adding more celanup
LudiSistemas Sep 21, 2022
ed4a81e
typos
LudiSistemas Sep 21, 2022
4d58e96
adding more functionality
LudiSistemas Sep 21, 2022
aef748a
just exiting without exit code 1
LudiSistemas Sep 21, 2022
1eb3bfc
adding sleep as it can fail there
LudiSistemas Sep 21, 2022
74e67e5
missed path
LudiSistemas Sep 21, 2022
97aefd5
adding a readme for the install script
dektech Sep 22, 2022
1423168
upd readme, removing ssh to workers
dektech Sep 22, 2022
088e6b4
adding perf.sh, modifying readme
dektech Sep 23, 2022
8f95781
small edits
dektech Sep 23, 2022
a3cea4c
public api note
dektech Sep 23, 2022
43a5179
changing images to ecr, upd readme, functions
dektech Sep 23, 2022
ec123b2
removing multus, updating script
dektech Sep 26, 2022
6df5a1a
removing EOF
dektech Sep 27, 2022
8569b86
adding a note about scaling a running cluster
dektech Sep 28, 2022
baed364
adding LB support, updating README
dektech Sep 28, 2022
2164a77
changes per PR comments
dektech Sep 30, 2022
44dd9d7
comment per PR
dektech Sep 30, 2022
e9bca8d
changes per PR comments
dektech Oct 3, 2022
662c7a3
further work per PR comments
dektech Oct 4, 2022
b5855b3
adding functionality to execute from any directory
LudiSistemas Oct 4, 2022
44cad83
adding missing dot
LudiSistemas Oct 4, 2022
bd63663
removing unused code and jq check
LudiSistemas Oct 4, 2022
5479154
removing double bin/bash
LudiSistemas Oct 4, 2022
edd92d3
adding the log path back to original
LudiSistemas Oct 4, 2022
f5a3499
fixing alb output and weave link
dektech Oct 4, 2022
9dbf5d7
adding difrent logic for tracicking and removing assets
LudiSistemas Oct 4, 2022
3252f19
Merge branch 'temp_merge' into eks
LudiSistemas Oct 4, 2022
cafcea4
changes
dektech Oct 4, 2022
9fe3725
fix func name
dektech Oct 4, 2022
897fdfd
adding some more checks
dektech Oct 4, 2022
04d33c0
fixing counting
LudiSistemas Oct 5, 2022
5704bd2
Create infra-diagram.md
dektech Oct 5, 2022
24ad052
Update infra-diagram.md
dektech Oct 5, 2022
f2c3b28
adding changres for the removal proess to take place
LudiSistemas Oct 5, 2022
efdf8e5
merging upstream branch
LudiSistemas Oct 5, 2022
4110f0e
adding start variable
LudiSistemas Oct 5, 2022
ca81818
adding step to remove .cs file
LudiSistemas Oct 5, 2022
53e271c
adding tags and some cosmetic modifications
dektech Oct 6, 2022
aff978d
updating cleanup
dektech Oct 6, 2022
51eba50
fixing uninstall script
dektech Oct 6, 2022
daec51c
dynamic ami, removing kops files, adding REGION
dektech Oct 6, 2022
526121e
.env, readme shuffle, uninstall update
dektech Oct 6, 2022
023031e
env to ignore, readme, functions
dektech Oct 6, 2022
0fe42ad
minor fixes
dektech Oct 7, 2022
d7943ea
fixing ami name, az suffix, instance/alb checks
dektech Oct 10, 2022
c3ff2ed
feat: add Dockerfile with deps needed to launch testground on EKS
galargh Oct 10, 2022
cb7f6c0
fix: mode of EKS related shell scripts
galargh Oct 10, 2022
6f4442c
uninstall script, minor other changes, gitignore
dektech Oct 11, 2022
f73a6df
Merge branch 'eks' of https://github.com/testground/infra into eks
dektech Oct 11, 2022
da9ee55
further edits to uninstall script
dektech Oct 11, 2022
17e207a
edit to uninstall script
dektech Oct 12, 2022
d6733c6
edits to readme, env, functions
dektech Oct 12, 2022
4c92ebd
fixing gitignore
dektech Oct 12, 2022
835d435
adding new wait functionality for efs mount point
dektech Oct 13, 2022
2463845
sysctl role binding, new image tags
dektech Oct 13, 2022
421529f
new images, redirecting stderr to file
dektech Oct 13, 2022
5ec6ca2
renaming .cs
dektech Oct 13, 2022
d860fcd
fixing kubelet args
dektech Oct 13, 2022
7d37270
small fix .env.toml
dektech Oct 13, 2022
e2b7d00
additional work on the uninstall script
dektech Oct 13, 2022
1024b55
adding failover logic to the script, cosmetics
dektech Oct 14, 2022
7a4ff34
fixes to script
dektech Oct 14, 2022
01744ac
another fix
dektech Oct 14, 2022
9d48e92
requested formatting changes
dektech Oct 17, 2022
591f8f7
note about kubeconfig files
dektech Oct 17, 2022
4a3f625
adding docker image build to readme
dektech Oct 17, 2022
44d6ec9
adding multiline sysctls for ngs
dektech Oct 18, 2022
04ae2b6
minor addition
dektech Oct 18, 2022
d83bf09
adding monitoring
dektech Oct 20, 2022
982cbeb
fixing path
dektech Oct 20, 2022
ac1b35e
another path fix
dektech Oct 20, 2022
d6c009a
adding grafana values
dektech Oct 20, 2022
d9a4aa1
fixing grafana datasources, script adjustment
dektech Oct 20, 2022
725ff13
updating the monitoring stack
dektech Oct 25, 2022
4af2abd
Version specific Multus image.
AbominableSnowman730 Nov 11, 2022
874b89d
influxdb added
dektech Nov 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.idea
ebs-terraform/.terraform/
efs-terraform/.terraform/
###script temp files
log
.cluster
.env
47 changes: 47 additions & 0 deletions k8s/eks/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#### Please fill in the cluster details below: ####

## REQUIRED TO BE CHANGED ##

# This value must be set or the process will fail!
# Defaults to "" (blank)
CLUSTER_NAME=

## OPTIONAL TO BE CHANGED/ CAN BE LEFT WITH DEFAULTS ##

# Common

# Here we declare the AWS region where the cluster and our new EBS/EFS will be created; defaults to eu-west-3
REGION=eu-west-3
# There must be only one AZ because of the script logic; it defaults to `eu-west-3a`. Please see the README for more info.
AZ_SUFFIX=a

# The AMI used for worker nodes defaults to Amazon EKS optimized Amazon Linux 2 v1.22 built on 08 Aug 2022, or by image name, `amazon-eks-node-1.22-v20220802`
# If you need to change the image, please see the README for more info
AMI_NAME=amazon-eks-node-1.22-v20220802

# When you run testplans, all results are stored locally on the tg-daemon DB and then on the EBS. This setting controls the size of the volume; defaults to 300(GB)
EBS_SIZE=300

# Infra

# 58 is the max number of pods for c5.2xlarge; if we put 110 for example, it will still cap it to 58 on the node. More info provided below.
# Defaults to `c5.2xlarge`
INSTANCE_TYPE_INFRA=c5.2xlarge
# Number of worker nodes for the `infra` nodegroup; defaults to 2
DESIRED_CAPACITY_INFRA=2
# Size of the root volume for `infra` worker nodes; defaults to 80(GB)
VOLUME_SIZE_INFRA=80

# Plan

# 234 is the max number of pods for c5.4xlarge. More info provided below.
# Defaults to `c5.4xlarge`
INSTANCE_TYPE_PLAN=c5.4xlarge
# Number of worker nodes for the `plan` nodegroup; defaults to 2
DESIRED_CAPACITY_PLAN=2
# Size of the root volume for `infra` worker nodes; defaults to 100(GB)
VOLUME_SIZE_PLAN=100

# Notes:
# More information on max number of pods per node:
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI
69 changes: 69 additions & 0 deletions k8s/eks/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This dockerfile builds a container containing
# all the testground_*.sh scripts dependencies
#
# To build:
# docker build --platform amd64 --tag testground-on-eks:latest - < Dockerfile
#
# To run (assumes you have AWS credentials in ~/.aws/credentials):
# docker run --rm -it -v ~/.aws:/root/.aws -v $(pwd):/root/eks testground-on-eks:latest

ARG AMAZONLINUX_TAG=2.0.20220912.1
ARG HELM_VERSION=3.8.2
ARG KUBECTL_VERSION=1.22.0
ARG AWSCLIV2_VERSION=2.8.2
ARG EKSCTL_VERSION=0.114.0
ARG JQ_VERSION=1.6

FROM amazonlinux:${AMAZONLINUX_TAG} AS base
RUN yum update -y && yum install -y \
tar \
gzip \
unzip \
&& yum clean all

FROM base AS helm
ARG HELM_VERSION
RUN curl -fsSLO https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz
RUN tar -zxvf helm-v${HELM_VERSION}-linux-amd64.tar.gz
RUN mv linux-amd64/helm /usr/local/bin/helm

FROM base AS kubectl
ARG KUBECTL_VERSION
RUN curl -fsSLO https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
RUN curl -fsSLO https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256
RUN echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
RUN chmod +x kubectl
RUN mv kubectl /usr/local/bin/kubectl

FROM base as awscliv2
ARG AWSCLIV2_VERSION
RUN curl -fsSLO https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLIV2_VERSION}.zip
RUN unzip awscli-exe-linux-x86_64-${AWSCLIV2_VERSION}.zip
RUN mv aws /tmp/aws

FROM base as eksctl
ARG EKSCTL_VERSION
RUN curl -fsSLO https://github.com/weaveworks/eksctl/releases/download/v${EKSCTL_VERSION}/eksctl_Linux_amd64.tar.gz
RUN tar -zxvf eksctl_Linux_amd64.tar.gz
RUN mv eksctl /usr/local/bin/eksctl

FROM base as jq
ARG JQ_VERSION
RUN curl -LO https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64
RUN chmod +x jq-linux64
RUN mv jq-linux64 /usr/local/bin/jq

FROM amazonlinux:${AMAZONLINUX_TAG}
RUN yum update -y && yum install -y \
tar \
gzip \
gettext \
&& yum clean all
COPY --from=helm /usr/local/bin/helm /usr/local/bin/helm
COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin/kubectl
COPY --from=awscliv2 /tmp/aws /tmp/aws
RUN /tmp/aws/install && rm -rf /tmp/aws
COPY --from=eksctl /usr/local/bin/eksctl /usr/local/bin/eksctl
COPY --from=jq /usr/local/bin/jq /usr/local/bin/jq

WORKDIR /root
Loading