Skip to content

Instantly share code, notes, and snippets.

View rvennam's full-sized avatar

Ram Vennam rvennam

View GitHub Profile
# localhost:9081 -> details:9080
#
# Need a ServiceEntry to route to details on 9081 instead of 9080
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: localhost-svc
spec:
hosts:
- details.service
- ignorePortInHostMatching: true
name: "9080"
validateClusters: false
virtualHosts:
- domains:
- '*'
includeRequestAttemptCount: true
name: allow_any
routes:
- match:
- accessLog:
- filter:
responseFlagFilter:
flags:
- NR
name: envoy.access_loggers.file
typedConfig:
'@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
logFormat:
textFormatSource:
$ make SHELL='sh -x' -f Makefile.selfsigned.mk intermediate-certs VERBOSE=1
+ echo 'generating root-key.pem'
generating root-key.pem
+ openssl genrsa -out root-key.pem 4096
+ echo '[ req ]'
+ echo 'encrypt_key = no'
+ echo 'prompt = no'
+ echo 'utf8 = yes'
+ echo 'default_md = sha256'
+ echo 'default_bits = 4096'
apiVersion: networking.gloo.solo.io/v2
kind: RouteTable
metadata:
name: ingress
namespace: ops-team
spec:
hosts:
- '*'
virtualGateways:
- name: north-south-gw
@rvennam
rvennam / gloo-mesh-external-service-failover.yaml
Last active August 31, 2023 18:56
Gloo Mesh External Service Failover
apiVersion: networking.gloo.solo.io/v2
kind: ExternalService
metadata:
name: mydb
namespace: default
labels:
external-service: mydb
spec:
hosts:
- mydb.com
openapi: '3.0.0'
info:
version: '1.0.0'
title: 'Currencies API'
description: International currency support
servers:
- url: https://currency.solo.io:443/
description: Solo.io Currency server API
- url: http://localhost:8080/
description: Local development
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Currencies API",
"description": "International currency support"
},
"servers": [
{
"url": "https://currency.solo.io:443/",
openapi: '3.1.0'
info:
version: '1.0.0'
title: 'Currencies API'
description: International currency support
servers:
- url: https://currency.solo.io:443/
description: Solo.io Currency server API
- url: http://localhost:8080/
description: Local development
#!/bin/sh
kubectl logs deployment/gloo-mesh-mgmt-server -n gloo-mesh > mgmt-server.log
kubectl port-forward deployment/gloo-mesh-mgmt-server -n gloo-mesh 9091 >/dev/null 2>&1 &
pid=$!
sleep 3
curl -s localhost:9091/snapshots/input > input.json
curl -s localhost:9091/snapshots/output > output.json