Skip to content

Instantly share code, notes, and snippets.

View kars7e's full-sized avatar

Karol Stępniewski kars7e

View GitHub Profile
@kars7e
kars7e / blog_example_gke.md
Last active February 7, 2018 04:17
Dispatch Blog Example using GKE

Prerequisite

Dispatch

If you arrived here, you should already have GKE environment ready, and Dispatch deployed. We will now deploy dependencies, and install our blog application.

Minio

Minio is a S3 compatible object store, we use it to store blog posts. You can deploy a minio server locally or use S3 instead.

@kars7e
kars7e / instructions.md
Last active February 6, 2018 23:04
CTOA

Instructions for using Ubuntu OVA

  1. Deploy the following Ubuntu 16.04 OVA on VMware fusion or your vCenter server and power-on VM http://file01.eng.vmware.com/images/ubuntu-server-amd64/Ubuntu_16.04.2_server_amd64.ovf

  2. SSH to the deployed VM with credentials:vmware/vmware

  3. Download and execute the bash script to install docker, minikube & helm

 curl -LO https://raw.githubusercontent.com/neosab/vagrantfiles/master/scripts/install_minikube_ubuntu1604.sh && chmod +x install_minikube_ubuntu1604.sh
@kars7e
kars7e / create_ansible_inventory.sh
Created January 15, 2018 11:11
Create Ansible Inventory
git clone https://github.com/kars7e/tinker-cluster
cd tinker-cluster/ansible
cat > inventory.ini<<EOF
tinker-0
tinker-1
tinker-2
tinker-3
[k8s-master]
tinker-0
@kars7e
kars7e / Install_openfaas.sh
Created January 15, 2018 11:10
Install OpenFaaS on ARM
git clone https://github.com/openfaas/faas-netes
cd faas-netes/yaml_armhf
kubectl apply -f nats.armhf.yml,faas.async.armhf.yml,rbac.yml,monitoring.armhf.yml
@kars7e
kars7e / get_openfaas_ui_url.sh
Created January 15, 2018 11:08
Get OpenFaaS UI URL
echo "http://tinker-0:$(kubectl get svc/gateway -o go-template --template='{{ (index .spec.ports 0).nodePort }}')/ui"
@kars7e
kars7e / apiserver.log
Created January 3, 2018 22:05
Kubernetes kubelet -> api server http2 connection issue on ARM
E0103 21:39:27.193748 1 writers.go:149] apiserver was unable to write a JSON response: http2: stream closed
E0103 21:39:27.193837 1 status.go:64] apiserver received an error that is not an metav1.Status: http2: stream closed
I0103 21:39:27.195217 1 trace.go:76] Trace[326704214]: "Get /api/v1/nodes/tinker-3" (started: 2018-01-03 21:39:17.201568091 +0000 UTC m=+2559.876159196) (total time: 9.99348593s):
Trace[326704214]: [9.99348593s] [9.989147957s] END
@kars7e
kars7e / string_split.go
Created September 4, 2017 18:10
String split in go
package main
import (
"bytes"
"log"
"math/rand"
"strings"
"time"
)
@kars7e
kars7e / string_split.rb
Created September 4, 2017 18:09
(By @robpe, slightly modified)
# For given string S, and a list of strings (syllables) L, find an optimal split of
# S in form of list of strings, where all strings in a result come from L.
#
# examples:
# input: S = "abab", L=['ab', 'bc']
# output: ['ab','ab']
# input: S = "abcde", L=['ab', 'abcd']
# output: = ['abcd']
# input S= "aaaaab", L=['c']
# output = [] (empty list)
@kars7e
kars7e / string_split.py
Last active September 4, 2017 15:25
Solution for string split problem
# For given string S, and a list of strings (syllables) L, find an optimal split of
# S in form of list of strings, where all strings in a result come from L.
#
# examples:
# input: S = "abab", L=['ab', 'bc']
# output: ['ab','ab']
# input: S = "abcde", L=['ab', 'abcd']
# output: = ['abcd']
# input S= "aaaaab", L=['c']
# output = [] (empty list)
@kars7e
kars7e / controller-manager.log
Created August 7, 2017 07:42
Errors in volume reattachment
I0807 07:14:41.120666 9 nodecontroller.go:553] NodeController observed a Node deletion: k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f
I0807 07:14:41.120691 9 controller_utils.go:274] Recording Removing Node k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f from NodeController event message for node k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f
I0807 07:14:41.120856 9 event.go:218] Event(v1.ObjectReference{Kind:"Node", Namespace:"", Name:"k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f", UID:"09f7de8b-7b3f-11e7-bac4-fa163e21d7b6", APIVersion:"", ResourceVersion:"", FieldPath:""}): type: 'Normal' reason: 'RemovingNode' Node k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f event: Removing Node k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f from NodeController
I0807 07:14:41.405718 9 gc_controller.go:144] GC'ing orphaned
I0807 07:14:41.410523 9 gc_controller.go:162] Found orphaned Pod webapp-dev-3850711988-g8rxg assigned to the Node k8s-node-0-93614e2e-091a-476f-830e-7a47b7749f8f.