mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-02 05:31:01 +00:00
cmd/k8s-operator: temporarily disable HA Ingress controller (#14833)
The HA Ingress functionality is not actually doing anything valuable yet, so don't run the controller in 1.80 release yet. Updates tailscale/tailscale#24795 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
parent
0ed4aa028f
commit
a49af98b31
@ -103,7 +103,7 @@ spec:
|
|||||||
pattern: ^tag:[a-zA-Z][a-zA-Z0-9-]*$
|
pattern: ^tag:[a-zA-Z][a-zA-Z0-9-]*$
|
||||||
type:
|
type:
|
||||||
description: |-
|
description: |-
|
||||||
Type of the ProxyGroup proxies. Supported types are egress and ingress.
|
Type of the ProxyGroup proxies. Currently the only supported type is egress.
|
||||||
Type is immutable once a ProxyGroup is created.
|
Type is immutable once a ProxyGroup is created.
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
|
@ -2860,7 +2860,7 @@ spec:
|
|||||||
type: array
|
type: array
|
||||||
type:
|
type:
|
||||||
description: |-
|
description: |-
|
||||||
Type of the ProxyGroup proxies. Supported types are egress and ingress.
|
Type of the ProxyGroup proxies. Currently the only supported type is egress.
|
||||||
Type is immutable once a ProxyGroup is created.
|
Type is immutable once a ProxyGroup is created.
|
||||||
enum:
|
enum:
|
||||||
- egress
|
- egress
|
||||||
|
@ -331,28 +331,6 @@ func runReconcilers(opts reconcilerOpts) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
startlog.Fatalf("could not create ingress reconciler: %v", err)
|
startlog.Fatalf("could not create ingress reconciler: %v", err)
|
||||||
}
|
}
|
||||||
lc, err := opts.tsServer.LocalClient()
|
|
||||||
if err != nil {
|
|
||||||
startlog.Fatalf("could not get local client: %v", err)
|
|
||||||
}
|
|
||||||
err = builder.
|
|
||||||
ControllerManagedBy(mgr).
|
|
||||||
For(&networkingv1.Ingress{}).
|
|
||||||
Named("ingress-pg-reconciler").
|
|
||||||
Watches(&corev1.Service{}, handler.EnqueueRequestsFromMapFunc(serviceHandlerForIngressPG(mgr.GetClient(), startlog))).
|
|
||||||
Complete(&IngressPGReconciler{
|
|
||||||
recorder: eventRecorder,
|
|
||||||
tsClient: opts.tsClient,
|
|
||||||
tsnetServer: opts.tsServer,
|
|
||||||
defaultTags: strings.Split(opts.proxyTags, ","),
|
|
||||||
Client: mgr.GetClient(),
|
|
||||||
logger: opts.log.Named("ingress-pg-reconciler"),
|
|
||||||
lc: lc,
|
|
||||||
tsNamespace: opts.tailscaleNamespace,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
startlog.Fatalf("could not create ingress-pg-reconciler: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
connectorFilter := handler.EnqueueRequestsFromMapFunc(managedResourceHandlerForType("connector"))
|
connectorFilter := handler.EnqueueRequestsFromMapFunc(managedResourceHandlerForType("connector"))
|
||||||
// If a ProxyClassChanges, enqueue all Connectors that have
|
// If a ProxyClassChanges, enqueue all Connectors that have
|
||||||
@ -1178,42 +1156,6 @@ func indexEgressServices(o client.Object) []string {
|
|||||||
return []string{o.GetAnnotations()[AnnotationProxyGroup]}
|
return []string{o.GetAnnotations()[AnnotationProxyGroup]}
|
||||||
}
|
}
|
||||||
|
|
||||||
// serviceHandlerForIngressPG returns a handler for Service events that ensures that if the Service
|
|
||||||
// associated with an event is a backend Service for a tailscale Ingress with ProxyGroup annotation,
|
|
||||||
// the associated Ingress gets reconciled.
|
|
||||||
func serviceHandlerForIngressPG(cl client.Client, logger *zap.SugaredLogger) handler.MapFunc {
|
|
||||||
return func(ctx context.Context, o client.Object) []reconcile.Request {
|
|
||||||
ingList := networkingv1.IngressList{}
|
|
||||||
if err := cl.List(ctx, &ingList, client.InNamespace(o.GetNamespace())); err != nil {
|
|
||||||
logger.Debugf("error listing Ingresses: %v", err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
reqs := make([]reconcile.Request, 0)
|
|
||||||
for _, ing := range ingList.Items {
|
|
||||||
if ing.Spec.IngressClassName == nil || *ing.Spec.IngressClassName != tailscaleIngressClassName {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !hasProxyGroupAnnotation(&ing) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if ing.Spec.DefaultBackend != nil && ing.Spec.DefaultBackend.Service != nil && ing.Spec.DefaultBackend.Service.Name == o.GetName() {
|
|
||||||
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&ing)})
|
|
||||||
}
|
|
||||||
for _, rule := range ing.Spec.Rules {
|
|
||||||
if rule.HTTP == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, path := range rule.HTTP.Paths {
|
|
||||||
if path.Backend.Service != nil && path.Backend.Service.Name == o.GetName() {
|
|
||||||
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&ing)})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return reqs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func hasProxyGroupAnnotation(obj client.Object) bool {
|
func hasProxyGroupAnnotation(obj client.Object) bool {
|
||||||
ing := obj.(*networkingv1.Ingress)
|
ing := obj.(*networkingv1.Ingress)
|
||||||
return ing.Annotations[AnnotationProxyGroup] != ""
|
return ing.Annotations[AnnotationProxyGroup] != ""
|
||||||
|
@ -599,7 +599,7 @@ _Appears in:_
|
|||||||
|
|
||||||
| Field | Description | Default | Validation |
|
| Field | Description | Default | Validation |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `type` _[ProxyGroupType](#proxygrouptype)_ | Type of the ProxyGroup proxies. Supported types are egress and ingress.<br />Type is immutable once a ProxyGroup is created. | | Enum: [egress ingress] <br />Type: string <br /> |
|
| `type` _[ProxyGroupType](#proxygrouptype)_ | Type of the ProxyGroup proxies. Currently the only supported type is egress.<br />Type is immutable once a ProxyGroup is created. | | Enum: [egress ingress] <br />Type: string <br /> |
|
||||||
| `tags` _[Tags](#tags)_ | Tags that the Tailscale devices will be tagged with. Defaults to [tag:k8s].<br />If you specify custom tags here, make sure you also make the operator<br />an owner of these tags.<br />See https://tailscale.com/kb/1236/kubernetes-operator/#setting-up-the-kubernetes-operator.<br />Tags cannot be changed once a ProxyGroup device has been created.<br />Tag values must be in form ^tag:[a-zA-Z][a-zA-Z0-9-]*$. | | Pattern: `^tag:[a-zA-Z][a-zA-Z0-9-]*$` <br />Type: string <br /> |
|
| `tags` _[Tags](#tags)_ | Tags that the Tailscale devices will be tagged with. Defaults to [tag:k8s].<br />If you specify custom tags here, make sure you also make the operator<br />an owner of these tags.<br />See https://tailscale.com/kb/1236/kubernetes-operator/#setting-up-the-kubernetes-operator.<br />Tags cannot be changed once a ProxyGroup device has been created.<br />Tag values must be in form ^tag:[a-zA-Z][a-zA-Z0-9-]*$. | | Pattern: `^tag:[a-zA-Z][a-zA-Z0-9-]*$` <br />Type: string <br /> |
|
||||||
| `replicas` _integer_ | Replicas specifies how many replicas to create the StatefulSet with.<br />Defaults to 2. | | Minimum: 0 <br /> |
|
| `replicas` _integer_ | Replicas specifies how many replicas to create the StatefulSet with.<br />Defaults to 2. | | Minimum: 0 <br /> |
|
||||||
| `hostnamePrefix` _[HostnamePrefix](#hostnameprefix)_ | HostnamePrefix is the hostname prefix to use for tailnet devices created<br />by the ProxyGroup. Each device will have the integer number from its<br />StatefulSet pod appended to this prefix to form the full hostname.<br />HostnamePrefix can contain lower case letters, numbers and dashes, it<br />must not start with a dash and must be between 1 and 62 characters long. | | Pattern: `^[a-z0-9][a-z0-9-]{0,61}$` <br />Type: string <br /> |
|
| `hostnamePrefix` _[HostnamePrefix](#hostnameprefix)_ | HostnamePrefix is the hostname prefix to use for tailnet devices created<br />by the ProxyGroup. Each device will have the integer number from its<br />StatefulSet pod appended to this prefix to form the full hostname.<br />HostnamePrefix can contain lower case letters, numbers and dashes, it<br />must not start with a dash and must be between 1 and 62 characters long. | | Pattern: `^[a-z0-9][a-z0-9-]{0,61}$` <br />Type: string <br /> |
|
||||||
|
@ -48,7 +48,7 @@ type ProxyGroupList struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProxyGroupSpec struct {
|
type ProxyGroupSpec struct {
|
||||||
// Type of the ProxyGroup proxies. Supported types are egress and ingress.
|
// Type of the ProxyGroup proxies. Currently the only supported type is egress.
|
||||||
// Type is immutable once a ProxyGroup is created.
|
// Type is immutable once a ProxyGroup is created.
|
||||||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ProxyGroup type is immutable"
|
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ProxyGroup type is immutable"
|
||||||
Type ProxyGroupType `json:"type"`
|
Type ProxyGroupType `json:"type"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user