Last active
December 20, 2023 01:58
-
-
Save taufiqpsumarna/acb7f93e0ffb328797004e6676fcd573 to your computer and use it in GitHub Desktop.
Gitlab Runner Config EC2Machine
This file contains 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
concurrent = 4 | |
check_interval = 0 | |
[[runners]] | |
name = "gitlab-runner-autoscaler" | |
url = "https://gitlab.com" #TODO_1: Change with your gitlab repository URL | |
token = "" #TODO_2: Fill with your Gitlab Token | |
executor = "docker+machine" | |
limit = 4 | |
[runners.docker] | |
tls_verify = false | |
image = "docker:20.10.24-dind-alpine3.18" | |
privileged = true | |
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"] | |
disable_cache = true | |
shm_size = 0 | |
[runners.cache] | |
Type = "s3" | |
Path = "cache" | |
Shared = true | |
[runners.cache.s3] #TODO_3: Change with your S3 Bucket, Access and Secret Key | |
ServerAddress = "s3.amazonaws.com" | |
AccessKey = "your-access-key" #Changeme | |
SecretKey = "your-secret-key" #Changeme | |
BucketName = "s3-cache-bucket-name" #Changeme | |
BucketLocation = "ap-southeast-1" | |
[runners.machine] | |
MachineDriver = "amazonec2" | |
MachineName = "gitlab-ci-machine-%s" | |
OffPeakTimezone = "" | |
OffPeakIdleCount = 0 | |
OffPeakIdleTime = 0 | |
IdleCount = 0 #Changeme (optional) | |
#TODO_4: Change with your gitlab-runner-manager IAM Roles, Access, Secret Key, VPC, subnet, security group and instance type | |
MachineOptions = [ | |
"amazonec2-access-key=your-access-key", #Changeme | |
"amazonec2-secret-key=your-secret-key", #Changeme | |
"amazonec2-region=us-east-2", #Changeme | |
"amazonec2-vpc-id=vpc-0175846a", #Changeme | |
"amazonec2-subnet-id=subnet-dbb6afb3", #Changeme | |
"amazonec2-zone=a", #Changeme | |
"amazonec2-use-private-address=true", | |
"amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,true,gitlab-runner-autoscale,true", | |
"amazonec2-security-group=gitlab-runner-instance-worker", #Changeme: Security security group with port 22 (ssh), 2376 (docker-machine-port) open | |
"amazonec2-instance-type=t3.medium", #Changeme (optional) | |
"amazonec2-ami=ami-0fa377108253bf620", #Ubuntu 22.04 LTS, ap-southeast-1, change with your correct AMI ID see more: https://cloud-images.ubuntu.com/locator/ec2/ | |
"amazonec2-request-spot-instance=true", | |
"amazonec2-spot-price=0.03", #Changeme (optional) | |
"amazonec2-block-duration-minutes=0", #Changeme (optional) | |
"engine-install-url='https://releases.rancher.com/install-docker/20.10.24.sh'" | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change default Gitlab Runner image 20.10.24-dind-alpine3.18