Skip to content

Instantly share code, notes, and snippets.

Kenneth Massada kmassada

View GitHub Profile
View deltaT.go
package main
import (
"errors"
"flag"
"fmt"
"strings"
"time"
)
View ingress-readiness.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoheaders
spec:
selector:
matchLabels:
app: echoheaders
replicas: 1
template:
@kmassada
kmassada / README.md
Last active Sep 26, 2018
fanout ingress with static IP
View README.md

create static IP

gcloud compute addresses create fanout-ingress --region $REGION

Note annotation "fanout-gress" is the name of static IP

  annotations:
View pubsub.go
// pubsub attempts to reproduce a client timeout issue.
package main
import (
"context"
"fmt"
"math/rand"
"os"
"os/user"
"sync/atomic"
@kmassada
kmassada / README.md
Created Jun 25, 2018
Trying let'sencrypt with nginx
View README.md

Letsencrypt + nginx

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo apt-get install nginx
@kmassada
kmassada / scrape-cos-gke-logs.sh
Last active May 11, 2018
scrape CoS nodes running GKE for node logs
View scrape-cos-gke-logs.sh
#!/bin/bash
# GENERIC
# uptime
# dmesg
# df -a --inodes
# cat /proc/sys/fs/file-nr
# systemctl status -l docker
# sudo journalctl -u docker
# sudo journalctl -u kube-docker-monitor.service
View README.md

Create the sertificate and a secret

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout secret.key -out secret.crt -subj "/CN=foobar.com"
kubectl create secret tls tls-secret --key=secret.key --cert=secret.crt
@kmassada
kmassada / echo.go
Last active Feb 27, 2018
go echoheaders
View echo.go
package main
import (
"fmt"
"net/http"
"strings"
"time"
)
// handler hello world, the web server
@kmassada
kmassada / Dockerfile
Last active Jan 9, 2018
Node.js container on gce with pid and exit on ctrl-c
View Dockerfile
FROM node:8
USER node
ENV HOME=/home/node
RUN mkdir $HOME/app
WORKDIR $HOME/app
COPY package.json $HOME/app
RUN npm set progress=false && \
npm config set depth 0 && \
npm install --only=production && \
npm cache clean --force
@kmassada
kmassada / fanout-ingress.yml
Last active Oct 29, 2018
Try out fanout ingress service service in GKE
View fanout-ingress.yml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
You can’t perform that action at this time.