cmd/k8s-operator,k8s-operator: document tailscale.com Custom Resource Definitions better. (#11665)

Updates tailscale/tailscale#10880

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
Irbe Krumina
2024-04-16 17:52:10 +01:00
committed by GitHub
parent ca5cb41b43
commit 26f9bbc02b
6 changed files with 46 additions and 15 deletions

View File

@ -24,11 +24,19 @@ var ConnectorKind = "Connector"
// +kubebuilder:printcolumn:name="IsExitNode",type="string",JSONPath=`.status.isExitNode`,description="Whether this Connector instance defines an exit node."
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=`.status.conditions[?(@.type == "ConnectorReady")].reason`,description="Status of the deployed Connector resources."
// Connector defines a Tailscale node that will be deployed in the cluster. The
// node can be configured to act as a Tailscale subnet router and/or a Tailscale
// exit node.
// Connector is a cluster-scoped resource.
// More info:
// https://tailscale.com/kb/1236/kubernetes-operator#deploying-exit-nodes-and-subnet-routers-on-kubernetes-using-connector-custom-resource
type Connector struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// ConnectorSpec describes the desired Tailscale component.
// More info:
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec ConnectorSpec `json:"spec"`
// ConnectorStatus describes the status of the Connector. This is set

View File

@ -17,13 +17,26 @@ var ProxyClassKind = "ProxyClass"
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=`.status.conditions[?(@.type == "ProxyClassReady")].reason`,description="Status of the ProxyClass."
// ProxyClass describes a set of configuration parameters that can be applied to
// proxy resources created by the Tailscale Kubernetes operator.
// To apply a given ProxyClass to resources created for a tailscale Ingress or
// Service, use tailscale.com/proxy-class=<proxyclass-name> label. To apply a
// given ProxyClass to resources created for a Connector, use
// connector.spec.proxyClass field.
// ProxyClass is a cluster scoped resource.
// More info:
// https://tailscale.com/kb/1236/kubernetes-operator#cluster-resource-customization-using-proxyclass-custom-resource.
type ProxyClass struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired state of the ProxyClass resource.
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec ProxyClassSpec `json:"spec"`
// +optional
// Status of the ProxyClass. This is set and managed automatically.
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Status ProxyClassStatus `json:"status"`
}
@ -36,7 +49,9 @@ type ProxyClassList struct {
}
type ProxyClassSpec struct {
// Proxy's StatefulSet spec.
// Configuration parameters for the proxy's StatefulSet. Tailscale
// Kubernetes operator deploys a StatefulSet for each of the user
// configured proxies (Tailscale Ingress, Tailscale Service, Connector).
StatefulSet *StatefulSet `json:"statefulSet"`
}