Good doc - useful for example if you migrate an 'istioctl install' into helm, in particular Service resources which can't be deleted without losing the external IP.
https://jacky-jiang.medium.com/import-existing-resources-in-helm-3-e27db11fd467
Technical stuff
Good doc - useful for example if you migrate an 'istioctl install' into helm, in particular Service resources which can't be deleted without losing the external IP.
https://jacky-jiang.medium.com/import-existing-resources-in-helm-3-e27db11fd467
USB charging info - going all the way back to LPT/COM ports, and lots of details on the protocols.
XDS is a gRPC-based protocol for pushing configs and updates. The data is represented by 'resource type' and 'resource names', and values are typically protocol buffers, but can be JSON or any other format.
K8S defines a similar API - based on Json, also defined as protocol buffers or OpenAPI schema.
XDS and K8S APIs are quite similar - and serve a similar purpose, to allow controllers and other apps to get real-time notifications when anything changes in the config database. K8S also supports 'update/delete' - which are not present in 'official' XDS, but relatively easy to extend or support as a separate gRPC method.
It is possible to write a one or 2 way bridge between the two protocols: it would allow a simpler model for watching K8S resources compared to 'list and watch', and likely provide better performance. On the opposite side, it would allow kubectl to be used to debug and interact with XDS servers.
In general, there are many similar protocols using GET/LIST and with some form of 'watch' or events - creating bridges to allow users to pick one client library and interact with different protocols seems better than current model of having one heavy client library for each protocol.
A few notes on K8S Events.
K8S at its core is a database of configs - with a stable and well defined schema. Different applications (controllers) use the database to perform actions - run workloads, setup networking and storage. The interface to the database is nosql - with a 'watch' interface similar to pubsub/mqtt that allow controllers to operate with very low latency, on every change.
Most features are defined in terms of CRDs - the database object, with metadata (name, namespace, labels, version ), data and status. The status is used by controllers to write info about how the object was actuated, and by users to find out. For example a Pod represents a workload - the controllers will write the IP of the pod and 'running' in status. Other controllers will use this information to update other object - like EndpointSlice.
K8S also has a less used and more generic pubsub mechanism - the Event, for 'general purpose' events.
Events, logs and traces are similar in structure and use - but different in persistence and on how the user interacts with them. While 'debugging' is the most obvious use case, analyzing and using them in code, to extract information and trigger actions is where the real power lies.
The CRD 'status' is persistent and treated as a write to the object - all watchers will be notified, the writing is quite expensive. Logs are batched and generally written to specialized storage, and deleted after some time - far cheaper but harder to use programmatically, since each log system has a different query API.
In K8S events have 1h default storage - far less than logs, which are typically stored for weeks, or Status - which is stored as long as the object lives. K8S implementation may also optimize the storage - keep them in RAM longer or using optimized storage mechanisms. In GKE (and likely others) they are also logged to stackdriver - and may have longer persistence.
Events are associated with other objects using 'involvedObject' field, which links the event to an object, and is used in 'kubectl describe'. This pattern is similar to the new Gateway 'policy attachment' - where config, overrides or defaults can be are attached to other resources.
```# Selectors filter on server side.kubectl get events -A --field-selector involvedObject.kind!=Pod
kubect get events -A --watch
```
Watching the events can be extremely instructive and reveal a lot of internal problems - Status also includes errors, but you need to know to watch a particular object. Links:
Publishing content is very easy - github, blogger, personal pages, countless social sites and fancy P2P networks.
Reading content is harder - Reddit, Twitter, Feedly and few others are attempting to identify 'interesting' content and organize it. There is too much content published, and too little diversity if you stick with a list of subscriptions (old style blog readers) and too much garbage and propaganda if you want broader sources.
Comments are the third problem - they usually are more interesting than the original post, and are valuable both to the reader and to the original poster. Just posting some content on a page with no way to get any feedback is a waste of time.
I've started to look for an alternative to Twitter for reading - and while doing so I also started for a place to start posting/blogging/ranting. I rarely post on Twitter - but I keep a lot of notes on various projects and experiments - just too lazy to publish them except in comments and 'readme' in git repos I work on.
The options so far:
I've been playing with this for some time, and this is what I've found:
# Anything with the mark 15001 will be sent to loopback ip -4 rule add fwmark 15001 lookup 15001 ip -4 route add local default dev lo table 15001
# Calling this chain will set the mark resulting in route to lo iptables -t mangle -N ZT_CAPTURE_EGRESS iptables -t mangle -A ZT_CAPTURE_EGRESS -j MARK --set-mark 15001 # PREROUTING on loopback - anything routed by the route table 15001, based on OUTPUT mark # Ignore local source or dst - it's not egress iptables -t mangle -N ZT_TPROXY iptables -t mangle -A ZT_TPROXY -d 127.0.0.0/8 -j RETURN iptables -t mangle -A ZT_TPROXY -d 127.0.0.0/8 -j RETURN iptables -t mangle -A ZT_TPROXY --match mark --mark 15001 -p tcp -j TPROXY --tproxy-mark 15001/0xffffffff --on-port 15001 iptables -t mangle -A PREROUTING -i lo -j ZT_TPROXY # Table that determines who gets redirected iptables -t mangle -N ZT_EGRESS iptables -t mangle -A OUTPUT -j ZT_EGRESS
The OUTPUT table is similar to regular Istio:
# Exclude few ports that should not be captured iptables -t mangle -A ZT_EGRESS -p tcp --dport 15001 -j RETURN iptables -t mangle -A ZT_EGRESS -p tcp --dport 15009 -j RETURN iptables -t mangle -A ZT_EGRESS -p tcp --dport 15008 -j RETURN # UID or GID of the app capturing - so it can originate egress without # getting captured again. # Best is to use GID - so root user is also captured. However when debuggin # in an IDE like CLion/Golang it is very easy to set 'run as root' but not # 'using group id' - so using uid-owner. iptables -t mangle -A ZT_EGRESS -m owner --uid-owner 0 -j RETURN # For now capture only 10.0.0.0, private range, can be changed to 0.0.0.0/0 # to capture everything. iptables -t mangle -A ZT_EGRESS -d 10.0.0.0/8 -j ZT_CAPTURE_EGRESS
This works for sidecars - and avoids the problems with REDIRECT, however it does require the sidecar to run with NET_ADMIN cap, which is not always possible. For Ambient Istio (ZTunnel) it may not be needed since eBPF or veth can be used instead.
The other major benefit of TPproxy is that it also allows UDP capture - REDIRECT 'original DST' does not work for UDP. I did a bit of testing with UDP and IPv6 - all seems to be working.
Links to various docs on using K8S as an identity provider for JWT tokens - TokenReview and TokenRequest APIs.
https://jpweber.io/blog/a-look-at-tokenrequest-api/
https://github.com/mikedanese/community/blob/2bf41bd80a9a50b544731c74c7d956c041ec71eb/contributors/design-proposals/storage/svcacct-token-volume-source.md
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#tokenreview-v1-authentication-k8s-io
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auth/bound-service-account-tokens.md