Makefile and YAML templates for automating the use of AWS Elastic Container Registry with Kubernetes.
Based off of this awesome Redsaid blog post.
- Amazon ECR, along with your AWS account ID and the region your ECR is in
- AWS CLI
| #!/bin/sh | |
| # Make sure to: | |
| # 1) Name this file `backup.sh` and place it in /home/ubuntu | |
| # 2) Run sudo apt-get install awscli to install the AWSCLI | |
| # 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
| # 4) Fill in DB host + name | |
| # 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
| # 6) Run chmod +x backup.sh | |
| # 7) Test it out via ./backup.sh |
| rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/* | |
| cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final |
Makefile and YAML templates for automating the use of AWS Elastic Container Registry with Kubernetes.
Based off of this awesome Redsaid blog post.
| docker-machine create \ | |
| --driver=digitalocean \ | |
| --digitalocean-access-token=$DO_TOKEN \ | |
| --digitalocean-size=512mb \ | |
| --digitalocean-region=nyc3 \ | |
| --digitalocean-private-networking=true \ | |
| --digitalocean-image=ubuntu-15-04-x64 \ | |
| docker-swarm-kv-store | |
| docker $(docker-machine config docker-swarm-kv-store) run -d \ |
| # Dependencies | |
| # nginx_lua | |
| # lua uuid module (luarocks install uuid) | |
| http { | |
| # this will be the request id | |
| map $host $request_uuid { | |
| default ''; | |
| } |
| #cloud-config | |
| write-files: | |
| - path: /etc/conf.d/nfs | |
| permissions: '0644' | |
| content: | | |
| OPTS_RPC_MOUNTD="" | |
| users: | |
| - name: XYZ | |
| groups: |
Install rvm https://rvm.io/
Install jruby
rvm install jrubyuse jruby
| # Changed to use content-type flag instead of header: -H 'Content-Type: application/json' | |
| siege -c50 -t60S --content-type "application/json" 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}' |
Before upgrading, make sure you are allowing insecure registry access, or your newer docker won't be able to talk to the Deis registry:
sudo bash -c 'mkdir -p /etc/systemd/system/docker.service.d/; cat <<EOF > /etc/systemd/system/docker.service.d/50-insecure-registry.conf
[Service]
Environment="DOCKER_OPTS=--insecure-registry 10.0.0.0/8 --insecure-registry 172.16.0.0/12 --insecure-registry 192.168.0.0/16"
EOF
'| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |