minikube version
minikube start
kubectl version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Query blog posts by user -> paginated results and a total count. | |
* @param userId {ObjectId} ID of user to retrieve blog posts for | |
* @param startRow {Number} First row to return in results | |
* @param endRow {Number} Last row to return in results | |
* @param [filter] {Object} Optional extra matching query object | |
* @param [sort] {Object} Optional sort query object | |
* @returns {Object} Object -> `{ rows, count }` | |
*/ | |
function queryBlogPostsByUser (userId, startRow, endRow, filter = {}, sort = false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# MongoDB port | |
PORT=27017 | |
# Consul key to setup the lock | |
MONGO_KEY="mongodb/replicaset" | |
# | |
# Retrieve MongoDB instance IPs from Consul | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Alert, Linking } from 'react-native' | |
import DeviceInfo from 'react-native-device-info' | |
import config from 'expresso-common/config' | |
import { platformIsIos } from 'expresso-common/common/platform' | |
import Firebase from 'firebase' | |
import semanticVersion from 'semver' | |
const attemptAndroidUpgrade = (appId) => { | |
const playStoreUri = `market://details?id=${appId}` | |
const playStoreUrl = `https://play.google.com/store/apps/details?id=${appId}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd `dirname $0`/../.. | |
set -e | |
IMAGE_NAME=eu.gcr.io/${PROJECT_ID}/${REPO_NAME}/$1 | |
# Use multiple cache sources that make sense in given context. | |
# This setup is good for pull-request based CI, as most branches | |
# are based on master branch, each commit has a high chance | |
# to hit the cache of it's direct parent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
# build steps | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['pull', 'gcr.io/$PROJECT_ID/project:latest'] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'build', '--cache-from', 'gcr.io/$PROJECT_ID/project:latest', '-t', 'gcr.io/$PROJECT_ID/projetc:latest', '-t', 'gcr.io/$PROJECT_ID/project', '.' ] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'tag', 'gcr.io/$PROJECT_ID/project', 'gcr.io/$PROJECT_ID/project:stable-v-$TAG_NAME'] |
Cross posted from blog.n1analytics.com
At N1 Analytics we use Kubernetes for running experiments, continuous integration testing and deployment. In this post I document setting up a Kubernetes cluster to automatically provision TLS certificates from Let's Encrypt using Jetstack's Certificate Manager, the helm package manager and the nginx-ingress controller.
I wrote this after migrating our cluster from traefik to use cert manager and nginx-ingress. The end state will be one where we can create Kubernetes ingress with a TLS certificate with only a set of annotations in the respective helm template.
I'm going to assume some background knowlege for this post, if you haven't heard of [Let's Encrypt](https://letsencrypt.org/abou