Skip to content

Instantly share code, notes, and snippets.

View JonathanBowker's full-sized avatar

Jonathan Bowker JonathanBowker

View GitHub Profile
{
"_index": "content_2016_02_05",
"_type": "content",
"_id": "1454692053000013965",
"_score": null,
"_source": {
"bucket": 1454691900008,
"sequence": 1454692053000014000,
"sequence_range": 13508,
"hashcode": "1ASVlewnlm6WspkRvJ2tYwjIVYQ",
@JonathanBowker
JonathanBowker / aws_lambda.py
Created February 15, 2016 09:49 — forked from maruks/aws_lambda.py
AWS gateway / lambda function invocation
# AWS Version 4 signing example
# This version makes a POST request and passes request parameters
# in the body (payload) of the request. Auth information is passed in
# an Authorization header.
import sys, os, base64, datetime, hashlib, hmac
import requests # pip install requests
method = 'POST'
service = 'execute-api'
/**
* ExampleController.js
*/
module.exports = {
list: function(req, res) {
var perPage = req.query.per_page;
var currentPage = req.query.page;
var conditions = {active: true};
PaginationService.paginate(res, SailsModelHere, conditions, currentPage, perPage, [{name: 'AssociatedModel', query: {isDeleted: false}}], 'createdAt DESC');
@JonathanBowker
JonathanBowker / digitalocean-pv-example.yml
Created June 30, 2018 15:06 — forked from chukaofili/digitalocean-pv-example.yml
DigitalOcean persistent volume exammple
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging.api.letsencrypt.org/directory
email: [your-email-goes-here]
privateKeySecretRef:
name: letsencrypt-staging
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: tiller
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: monitoring-influxdb
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user
Under spec.containers.command add the following:
- --flex-volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume
Under spec.containers.volumeMounts add the following:
- mountPath: /etc/kubernetes/kubelet-plugins/volume
name: flexvolume-mount
readOnly: true
Under spec.volumes update the following: