Documentation
¶
Overview ¶
Package apiservicetrust keeps the aggregated API server's APIService trusting its serving CA.
The controller runs inside the aggregated API server process. It sets spec.caBundle of the v1alpha1.aggregation.coder.com APIService to the CA in the servingcert Secret and turns spec.insecureSkipTLSVerify off, in one merge patch and only when something differs. It reacts to a single-object informer on that APIService and to servingcert.Manager changes; it never polls, and failures never affect serving or readiness.
Index ¶
Constants ¶
const ( // APIServiceName is the APIService registered by deploy/apiserver-apiservice.yaml. APIServiceName = "v1alpha1.aggregation.coder.com" // OptOutAnnotation set to "false" on the APIService makes the controller leave it alone, for // clusters where cert-manager or a GitOps tool owns spec.caBundle. OptOutAnnotation = "coder.com/manage-ca-bundle" // FieldManager identifies the controller's patches in managedFields. FieldManager = "coder-k8s-apiservice-cabundle" // DocsURL explains the RBAC, upgrade order, and opt-out. DocsURL = "https://coder.github.io/coder-k8s/how-to/deploy-aggregated-apiserver/#how-kube-apiserver-trusts-the-server" )
Variables ¶
var APIServiceGVR = schema.GroupVersionResource{Group: "apiregistration.k8s.io", Version: "v1", Resource: "apiservices"}
APIServiceGVR is the apiregistration.k8s.io/v1 APIService resource. kube-aggregator's typed client is not vendored, so the controller uses the dynamic client.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller keeps the APIService caBundle in sync with the servingcert Secret.
func New ¶
func New(dyn dynamic.Interface, secrets kubernetes.Interface, namespace string) (*Controller, error)
New returns a Controller for the servingcert Secret in namespace.
func (*Controller) Enqueue ¶
func (c *Controller) Enqueue()
Enqueue schedules a sync. It implements dynamiccertificates.Listener, so registering the controller with servingcert.Manager.AddListener reacts to CA changes.