mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
envknob,kube/kubetypes,cmd/k8s-operator: add app type for ProxyGroup (#14029)
Sets a custom hostinfo app type for ProxyGroup replicas, similarly to how we do it for all other Kubernetes Operator managed components. Updates tailscale/tailscale#13406,tailscale/corp#22920 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
parent
8dcbd988f7
commit
8ba9b558d2
@ -47,7 +47,7 @@
|
|||||||
reasonProxyGroupInvalid = "ProxyGroupInvalid"
|
reasonProxyGroupInvalid = "ProxyGroupInvalid"
|
||||||
)
|
)
|
||||||
|
|
||||||
var gaugeProxyGroupResources = clientmetric.NewGauge(kubetypes.MetricProxyGroupCount)
|
var gaugeProxyGroupResources = clientmetric.NewGauge(kubetypes.MetricProxyGroupEgressCount)
|
||||||
|
|
||||||
// ProxyGroupReconciler ensures cluster resources for a ProxyGroup definition.
|
// ProxyGroupReconciler ensures cluster resources for a ProxyGroup definition.
|
||||||
type ProxyGroupReconciler struct {
|
type ProxyGroupReconciler struct {
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
tsapi "tailscale.com/k8s-operator/apis/v1alpha1"
|
tsapi "tailscale.com/k8s-operator/apis/v1alpha1"
|
||||||
"tailscale.com/kube/egressservices"
|
"tailscale.com/kube/egressservices"
|
||||||
|
"tailscale.com/kube/kubetypes"
|
||||||
"tailscale.com/types/ptr"
|
"tailscale.com/types/ptr"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -146,6 +147,10 @@ func pgStatefulSet(pg *tsapi.ProxyGroup, namespace, image, tsFirewallMode, cfgHa
|
|||||||
Name: "TS_USERSPACE",
|
Name: "TS_USERSPACE",
|
||||||
Value: "false",
|
Value: "false",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "TS_INTERNAL_APP",
|
||||||
|
Value: kubetypes.AppProxyGroupEgress,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if tsFirewallMode != "" {
|
if tsFirewallMode != "" {
|
||||||
|
@ -411,7 +411,7 @@ func TKASkipSignatureCheck() bool { return Bool("TS_UNSAFE_SKIP_NKS_VERIFICATION
|
|||||||
// Kubernetes Operator components.
|
// Kubernetes Operator components.
|
||||||
func App() string {
|
func App() string {
|
||||||
a := os.Getenv("TS_INTERNAL_APP")
|
a := os.Getenv("TS_INTERNAL_APP")
|
||||||
if a == kubetypes.AppConnector || a == kubetypes.AppEgressProxy || a == kubetypes.AppIngressProxy || a == kubetypes.AppIngressResource {
|
if a == kubetypes.AppConnector || a == kubetypes.AppEgressProxy || a == kubetypes.AppIngressProxy || a == kubetypes.AppIngressResource || a == kubetypes.AppProxyGroupEgress || a == kubetypes.AppProxyGroupIngress {
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
AppIngressResource = "k8s-operator-ingress-resource"
|
AppIngressResource = "k8s-operator-ingress-resource"
|
||||||
AppEgressProxy = "k8s-operator-egress-proxy"
|
AppEgressProxy = "k8s-operator-egress-proxy"
|
||||||
AppConnector = "k8s-operator-connector-resource"
|
AppConnector = "k8s-operator-connector-resource"
|
||||||
|
AppProxyGroupEgress = "k8s-operator-proxygroup-egress"
|
||||||
|
AppProxyGroupIngress = "k8s-operator-proxygroup-ingress"
|
||||||
|
|
||||||
// Clientmetrics for Tailscale Kubernetes Operator components
|
// Clientmetrics for Tailscale Kubernetes Operator components
|
||||||
MetricIngressProxyCount = "k8s_ingress_proxies" // L3
|
MetricIngressProxyCount = "k8s_ingress_proxies" // L3
|
||||||
@ -22,5 +24,6 @@
|
|||||||
MetricNameserverCount = "k8s_nameserver_resources"
|
MetricNameserverCount = "k8s_nameserver_resources"
|
||||||
MetricRecorderCount = "k8s_recorder_resources"
|
MetricRecorderCount = "k8s_recorder_resources"
|
||||||
MetricEgressServiceCount = "k8s_egress_service_resources"
|
MetricEgressServiceCount = "k8s_egress_service_resources"
|
||||||
MetricProxyGroupCount = "k8s_proxygroup_resources"
|
MetricProxyGroupEgressCount = "k8s_proxygroup_egress_resources"
|
||||||
|
MetricProxyGroupIngressCount = "k8s_proxygroup_ingress_resources"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user