Skip to content

Instantly share code, notes, and snippets.

View mreferre's full-sized avatar

Massimo Re Ferrè mreferre

View GitHub Profile
@mreferre
mreferre / user-data-alex
Created October 24, 2022 07:19
user-data-alex
#!/bin/bash
set -e -x
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y
echo Building and installing the amazon-efs-utils #(reference: https://gist.github.com/ryanmaclean/c873c9a86f0bc3ee3a260882e73edecb)
apt-get -y install git binutils
git clone https://github.com/aws/efs-utils
cd efs-utils
./build-deb.sh
args: {
scale_ui: 2
scale_appserver: 3
}
containers: {
"yelb-ui": {
image: "mreferre/yelb-ui:0.7"
scale: args.scale_ui
ports:
@mreferre
mreferre / yelb-k8s-appmesh-gateway.yaml
Created May 21, 2020 09:05
Yelb YAML for AppMesh GW
apiVersion: v1
kind: Service
metadata:
name: redis-server
labels:
app: redis-server
tier: cache
spec:
type: ClusterIP
ports:
@mreferre
mreferre / nginx.conf
Created May 21, 2020 09:02
/etc/nginx/nginx.conf (sample of reverse proxy config)
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
@mreferre
mreferre / Yelb-EC2-Postgres-Redis.yaml
Last active February 11, 2020 20:00
Yelb Plumbing
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'EC2 Postgres and EC2 Redis deployments for Yelb backends'
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
(where applicable)
Type: AWS::EC2::KeyPair::KeyName
ConstraintDescription: Can contain only ASCII characters.
InstanceType:
# This should work on Kubernetes deployments on AWS that have an ALB ingress controller as well as App Mesh components deployed.
apiVersion: appmesh.k8s.aws/v1beta1
kind: Mesh
metadata:
name: MESH_NAME
---
apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualNode
metadata:
name: nginx-v1
# This should work on Kubernetes deployments on AWS that have an ALB ingress controller as well as App Mesh components deployed.
apiVersion: appmesh.k8s.aws/v1beta1
kind: Mesh
metadata:
name: MESH_NAME
---
apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualNode
metadata:
name: yelb-ui-node
@mreferre
mreferre / minikube-on-ubuntu-18.sh
Created July 16, 2019 11:46
Minikube-on-Ubuntu-18
# This script can be run on an i3.metal EC2 instance running Ubuntu 18 TLS and will setup minikube
#!/bin/bash
sudo apt update
sudo apt upgrade
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"
sudo apt update
sudo apt install virtualbox-6.0
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
@mreferre
mreferre / Dockerfile
Last active December 8, 2018 21:12
Dockerfile (from centos) for building a Greengrass 1.7 image for ARMv7
FROM centos
MAINTAINER massimo@it20.info
# This Dockerfile builds a GG image for the ARM64 platform
# curl this file: https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.7.0/aws-greengrass-docker-1.7.0.tar.gz
# untar it
# move into the directory
# curl this file: https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.7.0/greengrass-linux-armv7l-1.7.0.tar.gz
# replace the Dockerfile in the directory with this Dockerfile
# run this command: docker build -t gg-armv7:1.7 --build-arg "greengrass_release=greengrass-linux-armv7l-1.7.0.tar.gz" .
@mreferre
mreferre / Dockerfile
Last active August 20, 2019 00:16
Dockerfile (from alpine) for building a Greengrass 1.7 image for ARMv7
FROM alpine
MAINTAINER massimo@it20.info
# Set ENV_VAR for Greengrass RC to be untarred inside Docker Image
ARG greengrass_release
ENV GREENGRASS_RELEASE=${greengrass_release}
# This Dockerfile builds a GG image for the ARMv7 platform
# curl this file: https://d1onfpft10uf5o.cloudfront.net/greengrass-core/downloads/1.7.0/aws-greengrass-docker-1.7.0.tar.gz
# untar it