Skip to content

Instantly share code, notes, and snippets.

@leonimurilo
leonimurilo / declarative-k8s.yaml
Created January 19, 2020 21:56
Declarative Kubernetes with yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment-name # The name of your Deployment
spec:
replicas: 3 # The amount of replicated pods
selector:
matchLabels: # specifies which pods the Deployment will target ("defines how the Deployment finds which Pods to manage")
app: my-app
environment: production
@leonimurilo
leonimurilo / index.js
Last active April 9, 2021 02:06
How to save multiple versions of an image on Google cloud storage using cloud functions
const { Storage } = require('@google-cloud/storage');
const sharp = require('sharp');
const variations = [
{ prefix: 'thumb', width: 120 },
{ prefix: 'mini', width: 480 },
{ prefix: 'med', width: 1024 }
];
/**