Skip to content

Instantly share code, notes, and snippets.

View sebgoa's full-sized avatar
🏠
Working from home

sebgoa

🏠
Working from home
View GitHub Profile
kubectl get deployments
744 kubectl get rs
745 kubectl delete rs foo
746 clear
747 kubectl delete deployments oreilly
748 clear
749 kubectl get pods
750 kubectl get pods
751 clear
752 which kubectl
#cloud-config
package_update: true
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
@sebgoa
sebgoa / kube.sh
Created September 5, 2018 14:16
cloud-init script to boostrap Kubernetes in a single VM
#!/bin/sh
set -e -x
apt-get --yes --quiet update
apt-get --yes --quiet install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
import json
import boto3
access_key=""
secret_key=""
def tweets_processor(event, context):
tweet = event['data']
print tweet
#!/usr/bin/env python
import os
import json
import boto3
import tweepy
consumer_key = os.getenv("consumer_key")
consumer_secret = os.getenv("consumer_secret")
@sebgoa
sebgoa / cron.yaml
Last active October 11, 2017 13:44
A Kubernetes cron job that deploys your app continuously
apiVersion: batch/v2alpha1
kind: CronJob
metadata:
name: cookie-app
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
@sebgoa
sebgoa / wp.yaml
Created September 14, 2017 22:38
wordpress k8s manifest
apiVersion: v1
kind: Namespace
metadata:
name: linux
---
apiVersion: v1
kind: ResourceQuota
metadata:
name: quota
namespace: linux
apiVersion: batch/v1
kind: Job
metadata:
name: bazel-build
spec:
template:
metadata:
name: bazel
spec:
restartPolicy: Never
load("@io_bazel_rules_docker//docker:docker.bzl", "docker_build", "docker_push")
docker_build(
name = "nginx",
labels = {"maintainer" : "Bitnami <containers@bitnami.com>"},
base = "@bitnami_minideb//image:image.tar",
debs = [
"@glibc//file",
],
symlinks = {
load("@io_bazel_rules_docker//docker:docker.bzl", "docker_build", "docker_push")
docker_build(
name = "nginx",
labels = {"maintainer" : "Bitnami <containers@bitnami.com>"},
base = "@bitnami_minideb//image:image.tar",
debs = [
"@glibc//file",
],
symlinks = {