kubebuilder
kubebuilder copied to clipboard
auto generate sample yaml spec
trafficstars
/kind feature
This this my api type:
// BridgeSpec defines the desired state of Bridge
type BridgeSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
VpcName string `json:"vpcname"`
// ovn-nbctl set Logical_Switch vpc1 other_config:subnet=172.66.1.10/24
Subnet string `json:"subnet"`
Gateway string `json:"gateway"`
}
After generating yamls:
make && make install && make run
apiVersion: infra.genos.io/v1
kind: Bridge
metadata:
name: bridge-sample
spec:
# Add fields here
foo: bar
The spec is foo:bar, auto-generate spec may be more convenience