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 |
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 | |
#June 18 2017 Patrick Blaas <[email protected]> | |
# Terraform, cloudinit_generator wrapper script to initiate a Kubernetes cluster. | |
IFS=$'\n\t' | |
#create list of main cluster ips. | |
echo $(terraform show|grep access_ip_v4|cut -d= -f2) > k8s_cluster_ips.txt | |
echo Downloading cloudinit_generator. | |
git clone https://github.com/pblaas/cloudinit_generator.git |
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 | |
# | |
# Update docker image tag in a kubernetes deployment | |
# Kubernetes cluster address | |
K8S_CLUSTER="change.me" | |
# Kubernetes cluster certificate path | |
K8S_CERTIFICATE="/change/me" | |
# Kubernetes cluster token | |
K8S_USER="CHANGEME" |
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
#!/usr/bin/env bash | |
echo "Installing Missing Packages" | |
sudo apt update && sudo apt install -y simplestreams apache2 apt-mirror git docker.io python3-pip unzip | |
sudo pip3 install pyyaml | |
sudo pip3 install pyaml | |
sudo snap install kubectl --classic | |
sudo apt-get install juju -y | |
echo "Writing Config Files" |
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
#!/usr/bin/env bash | |
# This script is supposed to run right after having installed the OS | |
# With only one NIC configured | |
shopt -s extglob | |
set -o errtrace | |
set -o errexit | |
set +o noclobber |