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
version: "3.3" | |
services: | |
telegraf: | |
image: telegraf:1.3 | |
networks: | |
- tick-net | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
configs: |
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
#!/bin/bash | |
## Override | |
JENKINS_HOST="" | |
JENKINS_USERNAME="" | |
JENKINS_PASSWORD="" | |
JENKINS_JOB="" | |
CRON_EXPRESSION="cron(0 8 * * ? *)" | |
## Global variables | |
AWS_REGION="us-east-1" |
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
aws lambda invoke --function-name RestartJob output |
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
func triggerJob() error { | |
url := fmt.Sprintf(`%s/job/%s/build`, os.Getenv("JENKINS_HOST"), os.Getenv("JENKINS_JOB")) | |
client := http.Client{} | |
req, err := http.NewRequest("POST", url, nil) | |
if err != nil { | |
return err | |
} | |
crumb, err := getToken() |
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
FROM golang:1.10 | |
WORKDIR /go/src/github.com/mlabouardy/lambda-oneshot-container | |
COPY main.go . | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | |
FROM alpine:latest | |
RUN apk --no-cache add ca-certificates | |
WORKDIR /root/ | |
COPY --from=0 /go/src/github.com/mlabouardy/lambda-oneshot-container/app . | |
CMD ["./app"] |
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
container_commands: | |
01starttelegraf: | |
command: "service telegraf start" | |
ignoreErrors: true |
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
files: | |
"/etc/telegraf/telegraf.conf": | |
mode: "000666" | |
owner: root | |
group: root | |
content: | | |
[global_tags] | |
hostname="Avengers" | |
# Read metrics about CPU usage |
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
container_commands: | |
01downloadpackage: | |
command: "wget https://dl.influxdata.com/telegraf/releases/telegraf-1.6.0-1.x86_64.rpm -O /tmp/telegraf.rpm" | |
ignoreErrors: true | |
02installpackage: | |
command: "yum localinstall -y /tmp/telegraf.rpm" | |
ignoreErrors: true | |
03removepackage: | |
command: "rm /tmp/telegraf.rpm" | |
ignoreErrors: true |
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
#!/bin/bash | |
set -e | |
up() { | |
echo "[k8s] starting k8s dind cluster" | |
docker run -d --privileged --shm-size 8G --name=k8s_dind -p 30000:30000 -p 8443:8443 -p 80:80 --rm riuvshin/minikube-dind:latest | |
wait_k8s | |
enable_ingress_addon | |
install_helm |
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
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo 'Expects 2 arguments: ./populate.sh APPLICATION K8S_ENVIRONMENT' | |
exit 1 | |
fi | |
extra_vars="--extra-vars @group_vars/secrets.yml" | |
application=$1 | |
k8s_environment=$2 |