Skip to content

Instantly share code, notes, and snippets.

View cassanellicarlo's full-sized avatar
🎯
Focusing

Carlo Cassanelli cassanellicarlo

🎯
Focusing
View GitHub Profile
@cassanellicarlo
cassanellicarlo / app.yaml
Created November 10, 2020 14:08
Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: node-hello-world
name: node-hello-world
namespace: default
spec:
replicas: 3
selector:
@cassanellicarlo
cassanellicarlo / Dockerfile
Created November 10, 2020 13:49
Node.js Dockerfile
FROM node:slim
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
@cassanellicarlo
cassanellicarlo / server.js
Created November 10, 2020 13:47
Node.js Express Hello World
'use strict';
const express = require('express');
// Constants
const PORT = 8080;
const HOST = '0.0.0.0';
// App
const app = express();
@cassanellicarlo
cassanellicarlo / gke.tf
Created November 10, 2020 13:25
Terraform - Google Cloud Kubernetes Cluster
resource "google_container_cluster" "primary" {
name = "my-gke-cluster"
location = "us-central1"
# We can't create a cluster with no node pool defined, but we want to only use
# separately managed node pools. So we create the smallest possible default
# node pool and immediately delete it.
remove_default_node_pool = true
initial_node_count = 1