惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
Know Your Adversary
Know Your Adversary
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
V
V2EX
The Hacker News
The Hacker News
P
Palo Alto Networks Blog
D
DataBreaches.Net
C
Cyber Attacks, Cyber Crime and Cyber Security
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
AWS News Blog
AWS News Blog
Forbes - Security
Forbes - Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
J
Java Code Geeks
美团技术团队
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
Recorded Future
Recorded Future
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 热门话题
W
WeLiveSecurity
V
Visual Studio Blog
Schneier on Security
Schneier on Security
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
博客园_首页
I
InfoQ
Spread Privacy
Spread Privacy
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
月光博客
月光博客
I
Intezer
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
S
SegmentFault 最新的问题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
The Exploit Database - CXSecurity.com
Google DeepMind News
Google DeepMind News

Learn Cloud Native

Agentgateway rate limiting for agents | Learn Cloud Native Local development with coding agents on Kubernetes using Signadot | Learn Cloud Native cuenv: one typed file for your whole project | Learn Cloud Native Preflight: AI Code Review Before You Push Anatomy of AI Agents Accessing Google Drive from Next.js Deploying to Fly.io using Dagger and Github Top Cloud-Native & Kubernetes Certifications [2026 Guide] Rapid microservices development with Signadot How to prepare for Istio certified associate exam (ICA) Global Rate Limiting in Istio with Envoy Rate Limit Service My Journey with Istio: From Incubation to Graduation Cilium Network Policy Tutorial: Secure Kubernetes Step by Step Kubernetes Networking: How kube-proxy and iptables Work Istio ServiceEntry: DNS vs. STATIC Resolution & Endpoints Explained Apply an Istio DestinationRule Globally (Mesh-Wide) Istio Rate Limiting: Configure a Local Rate Limiter in Envoy How to expose custom ports on Istio ingress gateway Portainer Tutorial: A Web UI for Kubernetes & Containers Traefik Proxy 2.x and TLS 101 Kubernetes CLI (kubectl) tips you didn't know about Setting up SSL certificates with Istio Gateway ArgoCD Best Practices You Should Know 在 OCI Ampere A1 计算实例上运行 AI Running AI On OCI Ampere A1 Instance How to Deploy Traefik Proxy Using Flux and GitOps Principles Firebase Emulators with Next.js: Local Setup Guide Running Hugo on free Ampere VM (Oracle Cloud Infrastructure) How to use kwatch to detect crashes in Kubernetes clusters Continuous profiling in Kubernetes using Pyroscope Monitoring containers with cAdvisor Creating a Kubernetes cluster in Google Cloud (LAB) Your first Kubernetes Pod and ReplicaSet (LABS) Container Lifecycle Hooks GetIstio - CLI, training, and community Attach multiple VirtualServices to Istio Gateway Kubernetes Volumes Explained: Keep Data Beyond the Pod Send a Slack message when Docker images are updated Kubernetes Network Policy Ambassador Container Pattern Start Kubernetes Release Sidecar Container Pattern Kubernetes Init Containers Deploying multiple Istio Ingress Gateways Branch by Abstraction Pattern The Strangler Pattern Kubernetes Development Environment with Skaffold Securing Kubernetes Ingress with Ambassador and Let's Encrypt All About the Ingress Resource How to quarantine Kubernetes pods? Getting started with Kubernetes Horizontal partitioning in MongoDB Docker image tagging scheme Six things to keep in mind when working with Dockerfiles Beginners guide to Docker Beginners guide to gateways and proxies Deploy and Operate Multiple Istio Meshes in one Kubernetes Cluster Managing service meshes with Meshery Circuit Breaking in Istio Explained Build and push your Docker images using Github Actions Kubernetes and Istio service mesh workshop materials Build Netlify-like deployment for React app using Kubernetes pods Six exciting enhancements in Istio 1.4.0 Fallacies of Distributed Systems CAP Theorem Explained Master the Kubernetes CLI (kubectl) - Cheatsheet Minikube Basics and How to Get Started with Kubernetes 5 Tips to Be More Productive with Kubernetes What are sticky sessions and how to configure them with Istio? Debugging Kubernetes applications using Istio Kubernetes Ingress and Istio Gateway Resource Zero Downtime Releases using Kubernetes and Istio Traffic Mirroring with Istio Service Mesh Expose a Kubernetes service on your own custom domain
Maybe Convert Wasm Extension Config?
Peter Jausovec · 2021-04-23 · via Learn Cloud Native

Remember the last time you said to yourself: "But this worked yesterday!!!".

For me, that was today.

If you're in tech, chances are you've said something like this before. The stuff was working just fine, you come back the next day, and nothing works anymore. Everything seems the same as you left it, yet stuff is broken.

I've been in tech for a long time, and one thing that I've learned when troubleshooting issues is to always check the most basic/obvious thing first. That makes a lot of sense if you think about it. If a light doesn't turn on, you'll first check if there's power. You're not going to start cutting into drywall to see if all wires are intact.

You can apply the same approach when you're debugging or trying to get something to work the way it should work.

Anyway, onto my story. I've been spending a good portion of my time researching and learning about Wasm extensions and Envoy.

Specifically, I worked on a Wasm HTTP filter that I wanted to run as part of the Envoy filter chain in my Istio mesh (running on Kubernetes). (I think I hit a cloud-native bingo in that previous sentence).

Creating, building, and "publishing" a Wasm extension was reasonably straightforward, thanks to the GetEnvoy CLI.

To get the context let me tell you what you need to do to get your Wasm extension deployed to Istio after you've built and published the extension.

Since the whole world runs on YAML, so do Istio and Kubernetes. I've created two EnvoyFilter resources.

The first one is downloading the Wasm extension from a remote URI (this is an excellent feature btw!)

The second one "inserts" the downloaded Wasm into Envoy's filter chain

Here are the relevant snippets for both so that you get an idea. This first snippet is the one that configures the extension. The relevant portions are the name (hello-wasm) and the uri where the .wasm file lives:

---
configPatches:
  - applyTo: EXTENSION_CONFIG
    match:
      context: SIDECAR_INBOUND
    patch:
      operation: ADD
      value:
        name: hello-wasm
        typed_config:
          '@type': type.googleapis.com/udpa.type.v1.TypedStruct
          type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
          value:
            config:
              vm_config:
                vm_id: hello-wasm-vm
                runtime: envoy.wasm.runtime.v8
                code:
                  remote:
                    http_uri:
                      uri: https://extensionstorageaccount/extension.wasm

The second EnvoyFilter is the one that inserts the downloaded Wasm extension into Envoys' filter chain. The relevant portion here is the name field (hello-wasm) - that's how Envoy knows which extension I am talking about.

---
patch:
  operation: INSERT_BEFORE
  value:
    name: hello-wasm
    config_discovery:
      config_source:
        ads: {}
        initial_fetch_timeout: 0s # wait indefinitely to prevent bad Wasm fetch
      type_urls:
        ['type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm']

Armed with a sample extension and YAML, I deployed everything to a Kubernetes cluster running Istio 1.9.1. All worked great. (I ran into some caching issues where Envoy was "magically" loading the Wasm from somewhere, but that's a story for another time).

Anyway, the next day I wanted to dig more into the caching issues I was seeing. Since I wasn't getting too far - i.e. I couldn't pinpoint what or where the root cause is, I did the equivalent of "turn your computer on and off again." Get a clean Kubernetes cluster with clean Istio 1.9.1 installation. Instead of wasting time with potentially 'broken' cluster/configuration, I figured it would make the most sense to start clean.

I kept notes from the previous day, and I thought it would be minutes before I have the extension deployed and running again. Boy, was I wrong.

I deployed the YAML and then the Envoy next to the test workload was failing to start. Specifically, this was the error from the logs:

goroutine 136 [running]:
istio.io/istio/pkg/wasm.convert(0xc000af34a0, 0x1c0c6e0, 0xc0007c2300, 0xc000af34a0, 0x27c4500)
        istio.io/istio/pkg/wasm/convert.go:82 +0xef8
istio.io/istio/pkg/wasm.MaybeConvertWasmExtensionConfig.func2(0xc000b12bf0, 0xc00000e440, 0x1, 0x1, 0x1c0c6e0, 0xc0007c2300, 0xc000b12bd8, 0x0)
        istio.io/istio/pkg/wasm/convert.go:52 +0x85
created by istio.io/istio/pkg/wasm.MaybeConvertWasmExtensionConfig
        istio.io/istio/pkg/wasm/convert.go:49 +0x154

I deleted the Pod, re-applied the filter YAML - the same thing... Google to the resource - not many results, unfortunately.

Next, I checked the source code and poked around a bit to make sure if the module is even being downloaded or not. Without digging more into the source code, my assumption at this point was that the module was not being downloaded (i.e. the error was happening before that).

Then I went to check the docs - Wasm in Istio being 'experimental' and all. I didn't remember if there was a different profile I was supposed to use or if there was a magical config setting somewhere. There's no magical setting, and the demo profile should work just fine.

Even though I thought the module was not even being downloaded, I figured I should probably re-create a new, empty Wasm extension and try with that. Well, SAME DARN THING!!!!!11 Same error - doesn't work.

Time for istioctl analyze - no validation errors. All looks good.

Finally, I used an example YAML and Wasm extension from Istio.io. Lo and behold - that one worked! That meant it's probably not my Istio installation, and it could either be my Wasm file or EnvoyFilter configuration.

I replaced the URI in the working EnvoyFilter YAML with the URI of the extension I built. That worked! So it's not the extension either. It was (surprise, surprise) YAML...

From here on out, it was pretty straightforward. I did a diff between the working YAML and the broken YAML to see what the differences are.

Here's the diff between the working YAML (left) and broken YAML (right). Can you spot the issue?

YAML diff
YAML diff

Is it my fault? For sure. Could Istio CLI's analyze command catch this? Probably. Could there have been a better error message? Yep. However, in the end, it was still me who messed up.

Follow me on Twitter for more embarrassing stories and other tech content.