Skip to content

Instantly share code, notes, and snippets.

@nbabynyuk
nbabynyuk / vpc-fargate.yaml
Created February 23, 2022 11:05 — forked from lizrice/vpc-fargate.yaml
Cloudformation template for setting up VPC and subnets for Fargate
# Usage:
# aws cloudformation --region <region> create-stack --stack-name <stack name> --template-body file://vpc-fargate.yaml
# This template will:
# Create a VPC with:
# 2 Public Subnets
# 2 Private Subnets
# An Internet Gateway (with routes to it for Public Subnets)
# A NAT Gateway for outbound access (with routes from Private Subnets set to use it)
#
In order to build docker image with params:
` docker build . --build-arg APP_HOST=8082 --build-arg NGINX_HOST_VALUE=8000 -t sso-nginx:0.0.1`
@nbabynyuk
nbabynyuk / GKE cluster provisioning
Last active October 13, 2021 03:23
GKE cluster provisioning
1. Set project ID
export PROJECT_ID=****
2. Configure gke remote registries
gcloud auth configure-docker
3. Tag an image that you want to build for remote GCR repository. Pattern is: gcr.io/<project_id>/<image_name> , for instances
docker tag sample-app-backend:0.0.5 gcr.io/$PROJECT_ID/sample-app-backend:0.0.5
4. Push image to remote container registry
docker push gcr.io/$PROJECT_ID/sample-app-backend:0.0.5
5. Create container registry:
gcloud container clusters create nbgkesample --num-nodes 2 --machine-type e2-medium
@nbabynyuk
nbabynyuk / aks-cluster-provisioning.txt
Last active October 11, 2021 04:47
Create an AKS cluster
1. Create a resource group
az group create --name aks-demo --location westeurope
2. Create container registry
az acr create --name nbaksdemocr --location westeurope --resource-group aks-demo --sku basic
3. Build an image and publish it to the container registry
az acr build --image nb-dummy-backend:0.0.5 --registry nbaksdemocr --file Dockerfile .
Or as an alternative use combination of commands docker build/docker tag. Actually docker build and docker tag is preferred, since the command above doesn't create an image on you local machine.
4. Create cluster
az aks create -g aks-demo -n nbaksdemo --node-vm-size Standard_B2s --node-count 2
5. Allow access to container registry from the cluster
@nbabynyuk
nbabynyuk / 0_reuse_code.js
Created September 4, 2017 16:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console