Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Carlo Cassanelli cassanellicarlo

🎯
Focusing
View GitHub Profile
@cassanellicarlo
cassanellicarlo / app.yaml
Created Nov 10, 2020
Kubernetes Deployment
View app.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: node-hello-world
name: node-hello-world
namespace: default
spec:
replicas: 3
selector:
View 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 Nov 10, 2020
Node.js Express Hello World
View server.js
'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 Nov 10, 2020
Terraform - Google Cloud Kubernetes Cluster
View gke.tf
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