Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
@StevenACoffman
StevenACoffman / FAAS.md
Last active January 18, 2018 15:06
FAAS
@StevenACoffman
StevenACoffman / !readme.md
Created August 2, 2017 01:19 — forked from dougbtv/!readme.md
You had ONE JOB -- A Kubernetes job.

You had ONE JOB -- A Kubernetes job.

Let's take a look at how Kubernetes jobs are crafted. I had been jamming some kind of work-around shell scripts in the entrypoint* for some containers in the vnf-asterisk project that Leif and I have been working on. And that's not perfect when we can use Kubernetes jobs, or in their new parlance, "run to completion finite workloads" (I'll stick to calling them "jobs"). They're one-shot containers that do one thing, and then end (sort of like a "oneshot" of systemd units, at least how we'll use them today). I like the idea of using them to complete some service discovery for me when other pods are coming up. Today we'll fire up a pod, and spin up a job to discover that pod (by querying the API for info about it), and put info into etcd. Let's get the job done.

This post also exists as a [gist on github](https

@StevenACoffman
StevenACoffman / README.md
Created July 27, 2017 02:46 — forked from cedricvidal/README.md
Netflix Eureka curl registration

Registration

curl -v -X POST -H "Accept: application/xml" -H "Content-type: application/xml" --data @reg.xml http://localhost:8761/eureka/apps/test

Listing

curl -X GET -H "Accept: application/json" http://localhost:8761/eureka/apps
curl -k -X GET \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
https://$KUBERNETES_PORT_443_TCP_ADDR:$KUBERNETES_SERVICE_PORT_HTTPS
@StevenACoffman
StevenACoffman / Troubleshooting Kubernetes.md
Last active September 26, 2017 04:14
Troubleshooting Kubernetes

This helpful advice was from @tsupertramp

for a in `kubectl get pods  -n kube-system |grep kube-dns |grep -v autoscaler |cut -d ' ' -f 1 `;do for b in kubedns dnsmasq sidecar;do kubectl logs -n kube-system $a -c $b  > $a-$b.log;done;done

=> Then you have logfiles of dns in your current directory. Then just look through the log files if there is anything like “warning” or “error”

It searches your pod names and then shows logs of each pods containers (it has three kubedns / dnsmasq / sidecar)

Then check output of:

#!/usr/bin/env python
import boto.vpc
import time
REGION_NAME = 'us-west-2'
AMI_ID = 'ami-8e27adbe' # Amazon Linux AMI
conn = boto.vpc.connect_to_region(REGION_NAME)
# Create a VPC
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.macromates.textmate.preview;}'
@StevenACoffman
StevenACoffman / Methods for deploying kubernetes.md
Last active August 9, 2017 04:29
Methods for deploying kubernetes
@StevenACoffman
StevenACoffman / _MicroService Proxy Gateway Solutions.md
Last active July 15, 2024 05:12
Microservice Proxy/Gateway Solutions

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@StevenACoffman
StevenACoffman / serverless webpack
Last active June 12, 2017 20:27
serverless webpack
From [here](http://forum.serverless.com/t/how-to-use-babel-on-serverless-framework/549/9)