Skip to content

Instantly share code, notes, and snippets.

-- add the following flag to your Data Plane: "untrusted_lua_sandbox_requires: resty.ipmatcher"
local ipmatcher = require "resty.ipmatcher"
-- Vars - DO CHANGES HERE
local ADEO_CIDR = {
"10.15.0.0/16",
"172.16.0.0/12"
}
local client_ip = ngx.var.remote_addr
@bcollard
bcollard / run.sh
Created February 9, 2024 08:36
kong-mesh-virtualoutbound-and-failover
kubectl --context="${CTX_GLOBAL}" apply -f - <<EOF
apiVersion: kuma.io/v1alpha1
kind: MeshHTTPRoute
metadata:
name: gw-to-frontend-route
namespace: kong-mesh-system
labels:
kuma.io/mesh: default
spec:
@bcollard
bcollard / run.sh
Created January 8, 2024 10:27
KIC with the Gateway API
# https://docs.konghq.com/kubernetes-ingress-controller/3.0.x/get-started/
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
# Gateway API resources
echo "
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: kong
@bcollard
bcollard / demo.sh
Created April 11, 2023 12:34
A few Gloo Gateway use cases
# global vars
export MGMT=sap-neo
export CLUSTER1=sap-neo
export CLUSTER2=cluster2
export MGMT_CONTEXT=sap-neo
export REMOTE_CONTEXT1=sap-neo
export REMOTE_CONTEXT2=sap-neo
export GLOO_MESH_VERSION=2.2.6
@bcollard
bcollard / gloo-edge-demo.sh
Created March 16, 2023 12:28
Gloo Edge Enterprise demo with GraphQL and OIDC
################
# GOALS:
# - deploy gloo edge
# - deploy some apps 4 MS
# - 1 is a graphql server
# - authn Okta
################
GLOO_VERSION="1.14.0-beta9"
helm repo update
@bcollard
bcollard / README.md
Last active March 14, 2023 14:19
Visualizing LinkedIn Connections over time
export KUBECONFIG="/Users/bapt/.kube/config"
#export KUBECONFIG="/Users/Bapt/Downloads/kubeconfig--kneo--solo-workshop.yaml"
export MGMT_CONTEXT=kind-1-sap-neo
#export MGMT_CONTEXT="shoot--kneo--solo-workshop"
export GLOO_MESH_VERSION=2.2.1
export ISTIO_VERSION=1.16.1
export ISTIO_IMAGE=1.16.1-solo
@bcollard
bcollard / direct links
Last active December 13, 2022 23:01
Istio + WebAuthN workshop
# Linux machine
# minikube with driver docker
# using a single network named "minik" for all docker images representing the k8s cluster/nodes
# creating subnets for each node, for services type LoadBalancer:
# node "cl1" with LB range: 172.38.1.1-172.38.1.254
# node "cl2-m2" with LB range: 172.38.2.1-172.38.2.254
# node "cl3-m3" with LB range: 172.38.3.1-172.38.3.254
# CLI
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
@bcollard
bcollard / multiple-minikube-with-metallb.sh
Last active October 6, 2022 14:49
multiple-minikube-with-metallb.sh
# Linux machine
# minikube with driver docker
# using a single network named "minik" for all docker images representing the k8s cluster/nodes
# creating subnets for each node, for services type LoadBalancer:
# node "cl1" with LB range: 172.38.1.1-172.38.1.254
# node "cl2" with LB range: 172.38.2.1-172.38.2.254
# CLI
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube