Skip to content

Instantly share code, notes, and snippets.

@jpeach
jpeach / instances.sh
Created July 28, 2023 04:22
Scripts to list/stop/start EC2 instances
#! /usr/bin/env bash
source "$(cd $(dirname $0) && pwd)/conf.sh"
for r in $REGIONS; do
aws ec2 describe-instances \
--profile sso --region $r --output json | \
jq '
.Reservations[] |
.Instances[] |
@jpeach
jpeach / 01. Install Gateway API
Last active January 23, 2022 21:33
Gateway API With Kuma
VERSION=0.4.1
# Install the CRDs
kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v$VERSION" | kubectl apply -f -
# Install the validating webhook
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v$VERSION/deploy/certificate_config.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v$VERSION/deploy/admission_webhook.yaml
unset VERSION
@jpeach
jpeach / 001. Kuma Gateway Demo
Last active January 11, 2022 06:54
Kuma Gateway Demo
This is a quick demo of Kuma Gateway in Universal mode.
This demo just runs Kuma locally so that all the components are running on the same host.
Some of the scripts assume that Kuma tools are in your $PATH. This will be true if you use
direnv amd `make dev/envrc` in your working Kuma repository.
package reference
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/gateway-api/apis/v1alpha2"
)
@jpeach
jpeach / names.go
Created January 10, 2022 04:41
names API for reference types
package reference
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/gateway-api/apis/v1alpha2"
)
#! /usr/bin/env bash
set -o errexit
readonly ENVOY=${ENVOY:-${HOME}/.getenvoy/versions/1.18.3/bin/envoy}
readonly DPTYPE=dataplane
exec kuma-dp run \
--binary-path=$ENVOY \
--dataplane-token=$(kumactl generate dataplane-token --proxy-type=${DPTYPE}) \
diff --git pkg/server/sotw/v3/server.go pkg/server/sotw/v3/server.go
index b217b6cf..19d90612 100644
--- pkg/server/sotw/v3/server.go
+++ pkg/server/sotw/v3/server.go
@@ -124,14 +124,6 @@ func (s *server) process(str stream.Stream, reqCh <-chan *discovery.DiscoveryReq
return out.Nonce, str.Send(out)
}
- open := func(w *watch, req *discovery.DiscoveryRequest, responder chan cache.Response) {
- w.cancel = s.cache.CreateWatch(req, streamState, responder)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jpeach@greenling:~/src/envoy-build$ bazel clean --expunge
INFO: Invocation ID: 64f3c9ac-574b-4089-8a0c-b18f46996b06
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
jpeach@greenling:~/src/envoy-build$ CC=/tmp/clang CXX=/tmp/clang bazel build --config=clang @envoy//source/exe:envoy-static
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 806e8db4-37ca-4331-a042-26171cf5129d
DEBUG: /home/jpeach/.cache/bazel/_bazel_jpeach/bca846880028b2eb76664b66797b90da/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14:
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /home/jpeach/.cache/bazel/_bazel_jpeach/bca846880028b2eb76664b66797b90da/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: