It parses yaml file with v1.List
(made of nodes) OR ---
separated v1.Node
s into []*v1.Node
.
apiVersion: v1
items:
- apiVersion: v1
kind: Node
metadata:
...
name: kind-control-plane
...
spec:
...
- apiVersion: v1
kind: Node
metadata:
...
name: kind-worker
...
spec:
...
kind: List
metadata:
resourceVersion: ""
Check node-templates-list.yaml for an actual example.
apiVersion: v1
kind: Node
metadata:
...
name: kind-control-plane
...
spec:
...
---
apiVersion: v1
kind: Node
metadata:
...
name: kind-worker
...
spec:
...
Check node-templates-non-list.yaml for an actual example.
With node-templates-non-list.yaml
$ go run main.go
node kind-control-plane
node kind-worker
With node-templates-list.yaml
$ go run main.go
node kind-control-plane
node kind-worker
node kind-worker2
- This is a PoC to read in template nodes for
kwok
provider in Kubernetes cluster-autoscaler. Check kubernetes/autoscaler#5820
- decoding
---
separated objects: kubernetes/client-go#193 (comment) - decoding node objects: kubernetes/client-go#193 (comment)
- decoding
RawExtension
: kubernetes/apimachinery#102 - converting
runtime.Object
tov1.Node
: kubernetes/client-go#401 (comment) - creating multi-node
kind
cluster: https://mcvidanagama.medium.com/set-up-a-multi-node-kubernetes-cluster-locally-using-kind-eafd46dd63e5