Skip to content

Commit

Permalink
upgrade weave, flannel, kubernetes and base AMI image (#64)
Browse files Browse the repository at this point in the history
* upgrade weave, flannel, kubernetes and base AMI image

* upgrade weave to v2.7.0

* update testground AMI via packer

* update distribute-image.sh

* use new AMI image

* install docker on AMI, not via kops

* add redis exporter

* influxdb with headless service

* allow testground-daemon to deletecollection pods
  • Loading branch information
nonsense committed Nov 9, 2020
1 parent 5688f84 commit 57172bd
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 305 deletions.
3 changes: 2 additions & 1 deletion k8s/01_install_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ popd

echo "Installing InfluxDB"
pushd influxdb
helm install influxdb influxdata/influxdb -f ./values.yaml
helm install influxdb bitnami/influxdb -f ./values.yaml
popd


echo "Installing Redis and Grafana dashboards"
pushd testground-infra
helm dep build
Expand Down
6 changes: 4 additions & 2 deletions k8s/02_efs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ trap 'err_report $LINENO' ERR

START_TIME=`date +%s`

CLUSTER_SPEC_TEMPLATE=$1

my_dir="$(dirname "$0")"
source "$my_dir/install-playbook/validation.sh"

echo "Installing EFS..."

vpcId=`aws ec2 describe-vpcs --region=$AWS_REGION --filters Name=tag:Name,Values=$NAME --output text | awk '/VPCS/ { print $8 }'`
vpcId=`aws ec2 describe-vpcs --region=$AWS_REGION --filters Name=tag:Name,Values=$CLUSTER_NAME --output text | awk '/VPCS/ { print $8 }'`

if [[ -z ${vpcId} ]]; then
echo "Couldn't detect AWS VPC created by `kops`"
Expand All @@ -26,7 +28,7 @@ fi

echo "Detected VPC: $vpcId"

securityGroupId=`aws ec2 describe-security-groups --region=$AWS_REGION --output text | awk '/nodes.'$NAME'/ && /SECURITYGROUPS/ { print $6 };'`
securityGroupId=`aws ec2 describe-security-groups --region=$AWS_REGION --output text | awk '/nodes.'$CLUSTER_NAME'/ && /SECURITYGROUPS/ { print $6 };'`

if [[ -z ${securityGroupId} ]]; then
echo "Couldn't detect AWS Security Group created by `kops`"
Expand Down
2 changes: 2 additions & 0 deletions k8s/03_ebs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ trap 'err_report $LINENO' ERR

START_TIME=`date +%s`

CLUSTER_SPEC_TEMPLATE=$1

my_dir="$(dirname "$0")"
source "$my_dir/install-playbook/validation.sh"

Expand Down
2 changes: 2 additions & 0 deletions k8s/04_testground_daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ trap 'err_report $LINENO' ERR

START_TIME=`date +%s`

CLUSTER_SPEC_TEMPLATE=$1

my_dir="$(dirname "$0")"
source "$my_dir/install-playbook/validation.sh"

Expand Down
24 changes: 13 additions & 11 deletions k8s/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
metadata:
creationTimestamp: null
name: ${NAME}
name: ${CLUSTER_NAME}
spec:
docker:
skipInstall: true
cloudLabels:
Team: ${TEAM}
Project: ${PROJECT}
Expand All @@ -27,7 +29,7 @@ spec:
rbac: {}
channel: stable
cloudProvider: aws
configBase: ${KOPS_STATE_STORE}/${NAME}
configBase: ${KOPS_STATE_STORE}/${CLUSTER_NAME}
docker:
defaultUlimit:
- "nofile=${ULIMIT_NOFILE}"
Expand Down Expand Up @@ -83,9 +85,9 @@ spec:
kubeAPIBurst: 40
kubernetesApiAccess:
- 0.0.0.0/0
kubernetesVersion: 1.18.3
masterInternalName: api.internal.${NAME}
masterPublicName: api.${NAME}
kubernetesVersion: 1.18.10
masterInternalName: api.internal.${CLUSTER_NAME}
masterPublicName: api.${CLUSTER_NAME}
networkCIDR: 172.20.0.0/16
networking:
flannel:
Expand Down Expand Up @@ -115,7 +117,7 @@ kind: InstanceGroup
metadata:
creationTimestamp: null
labels:
kops.k8s.io/cluster: ${NAME}
kops.k8s.io/cluster: ${CLUSTER_NAME}
name: master-${ZONE}
spec:
additionalUserData:
Expand All @@ -139,7 +141,7 @@ spec:
net.ipv4.neigh.default.gc_thresh2 = 4096
net.ipv4.neigh.default.gc_thresh3 = 32768
EOT
image: 909427826938/testground_2020-06-09
image: 909427826938/testground_2020-10-30
machineType: ${MASTER_NODE_TYPE}
maxSize: 1
minSize: 1
Expand All @@ -156,7 +158,7 @@ kind: InstanceGroup
metadata:
creationTimestamp: null
labels:
kops.k8s.io/cluster: ${NAME}
kops.k8s.io/cluster: ${CLUSTER_NAME}
name: nodes
spec:
additionalUserData:
Expand All @@ -182,7 +184,7 @@ spec:
EOT
cloudLabels:
testground.node.role.plan: "true"
image: 909427826938/testground_2020-06-09
image: 909427826938/testground_2020-10-30
machineType: ${WORKER_NODE_TYPE}
maxSize: ${WORKER_NODES}
minSize: ${WORKER_NODES}
Expand All @@ -201,7 +203,7 @@ kind: InstanceGroup
metadata:
creationTimestamp: null
labels:
kops.k8s.io/cluster: ${NAME}
kops.k8s.io/cluster: ${CLUSTER_NAME}
name: tginfra
spec:
additionalUserData:
Expand All @@ -227,7 +229,7 @@ spec:
EOT
cloudLabels:
testground.node.role.infra: "true"
image: 909427826938/testground_2020-06-09
image: 909427826938/testground_2020-10-30
machineType: c5.2xlarge
maxSize: 2
minSize: 2
Expand Down
10 changes: 5 additions & 5 deletions k8s/delete_efs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ err_report() {

trap 'err_report $LINENO' ERR

vpcId=`aws ec2 describe-vpcs --filters Name=tag:Name,Values=$NAME --output text | awk '/VPCS/ { print $8 }'`
vpcId=`aws ec2 describe-vpcs --filters Name=tag:Name,Values=$CLUSTER_NAME --output text | awk '/VPCS/ { print $8 }'`

if [[ -z ${vpcId} ]]; then
echo "Couldn't detect AWS VPC created by `kops`"
echo "Couldn't detect AWS VPC created by kops"
exit 1
fi

echo "Detected VPC: $vpcId"

securityGroupId=`aws ec2 describe-security-groups --output text | awk '/nodes.'$NAME'/ && /SECURITYGROUPS/ { print $6 };'`
securityGroupId=`aws ec2 describe-security-groups --output text | awk '/nodes.'$CLUSTER_NAME'/ && /SECURITYGROUPS/ { print $6 };'`

if [[ -z ${securityGroupId} ]]; then
echo "Couldn't detect AWS Security Group created by `kops`"
echo "Couldn't detect AWS Security Group created by kops"
exit 1
fi

Expand All @@ -41,7 +41,7 @@ pushd efs-terraform
S3_BUCKET="${KOPS_STATE_STORE:5:100}"

terraform init -backend-config=bucket=$S3_BUCKET \
-backend-config=key=tf-efs-$NAME \
-backend-config=key=${DEPLOYMENT_NAME}-efs \
-backend-config=region=$AWS_REGION

terraform destroy -var aws_region=$AWS_REGION -var fs_subnet_id_zone_a=$subnetIdZoneA -var fs_subnet_id_zone_b=$subnetIdZoneB -var fs_sg_id=$securityGroupId -auto-approve
Expand Down
2 changes: 1 addition & 1 deletion k8s/delete_kops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ err_report() {

trap 'err_report $LINENO' ERR

kops delete cluster $NAME --yes
kops delete cluster $CLUSTER_NAME --yes
Loading

0 comments on commit 57172bd

Please sign in to comment.