Skip to content

Instantly share code, notes, and snippets.

@svennam92
svennam92 / helpers
Created Jun 18, 2019
Helper Commands - workshop
View helpers
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
kubectl get gateway bookinfo-gateway -o yaml
kubectl get virtualservice bookinfo -o yaml
kubectl describe destinationrules
@svennam92
svennam92 / deployment.yaml
Created Apr 25, 2019
Kubernetes Deployment Video: Sample YAML
View deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-deployment
labels:
app: sample
spec:
replicas: 3
selector:
matchLabels:
View dana_proxy
//var express = require('express');
//var app = express();
//var proxy = require('http-proxy');
//var apiProxy = proxy.createProxyServer({changeOrigin: true});
//
//app.use('/*', function(req, res) {
// var proxiedUrl = req.baseUrl;
// var url = require('url');
// var url_parts = url.parse(req.url, true);
// console.log(url_parts.host);
@svennam92
svennam92 / app.js
Last active Aug 29, 2015 — forked from anonymous/app.js
Create OOM when hitting endpoint
View app.js
app.get('/OOM', function(req, res){
(function () {
function tree (n, m) {
if (n > 0) {
var a = new Array(m);
for (var i = 0; i < m; i++) a[i] = tree(n - 1, m);
return a;
}
}
View gist:472830bb13d7218b0636
2015-04-09T13:56:20.99+0200 [STG] OUT -----> Downloaded app package (2.0M)
2015-04-09T13:56:21.23+0200 [STG] OUT ����-----> Node.js Buildpack Version: v1.15-20150331-2231
2015-04-09T13:56:21.28+0200 [STG] OUT -----> Resetting git environment
2015-04-09T13:56:21.83+0200 [STG] OUT -----> Resolved node version: 0.12.2
2015-04-09T13:56:30.94+0200 [STG] OUT -----> Checking and configuring service extensions
2015-04-09T13:56:31.00+0200 [API] OUT Updated app with guid 1effb00e-2dfd-4639-b3fd-33e8abb6b65f ({"name"=>"icinetic-123", "command"=>"PRIVATE DATA HIDDEN", "instances"=>1, "memory"=>512, "buildpack"=>"sdk-for-nodejs", "environment_json"=>"PRIVATE DATA HIDDEN", "health_check_timeout"=>180})
2015-04-09T13:56:31.12+0200 [STG] OUT -----> Installing dependencies
2015-04-09T13:57:02.82+0200 [STG] OUT > kerberos@0.0.7 install /tmp/staged/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
2015-04-09T13:57:02.82+0200 [STG] OUT > (node-gyp rebuild 2> bu