mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-30 07:43:42 +00:00
Implement proxyclass
This commit is contained in:
parent
23fae133f8
commit
14843b758c
@ -1,4 +1,2 @@
|
|||||||
- name: OPERATOR_DEFAULT_LOAD_BALANCER
|
- name: PROXY_EPHEMERAL_KEYS
|
||||||
value: {{ .Values.defaultLoadBalancer | quote }}
|
value: {{ .Values.operatorConfig.ephemeralKeys | quote }}
|
||||||
- name: PROXY_EPHEMERAL_KEYS
|
|
||||||
value: {{ .Values.ephemeralKeys | quote }}
|
|
@ -71,6 +71,12 @@ operatorConfig:
|
|||||||
# value: "value1"
|
# value: "value1"
|
||||||
# - name: EXTRA_VAR2
|
# - name: EXTRA_VAR2
|
||||||
# value: "value2"
|
# value: "value2"
|
||||||
|
|
||||||
|
# If true, use ephemeral device authentication keys for all proxies by default.
|
||||||
|
# Ephemeral devices are automatically deleted from your tailnet when they
|
||||||
|
# disconnect, helping keep your tailnet clean.
|
||||||
|
# This can be overridden per proxy by setting spec.ephemeral in the ProxyClass.
|
||||||
|
ephemeralKeys: false
|
||||||
|
|
||||||
# In the case that you already have a tailscale ingressclass in your cluster (or vcluster), you can disable the creation here
|
# In the case that you already have a tailscale ingressclass in your cluster (or vcluster), you can disable the creation here
|
||||||
ingressClass:
|
ingressClass:
|
||||||
@ -111,12 +117,3 @@ apiServerProxyConfig:
|
|||||||
mode: "false" # "true", "false", "noauth"
|
mode: "false" # "true", "false", "noauth"
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
# If true, the operator will consider LoadBalancer Services with no
|
|
||||||
# loadBalancerClass field set as Tailscale Services.
|
|
||||||
defaultLoadBalancer: false
|
|
||||||
|
|
||||||
# If true, use ephemeral device authentication keys for all proxies.
|
|
||||||
# Ephemeral devices are automatically deleted from your tailnet when they
|
|
||||||
# disconnect, helping keep your tailnet clean.
|
|
||||||
ephemeralKeys: false
|
|
||||||
|
@ -58,6 +58,13 @@ spec:
|
|||||||
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
ephemeral:
|
||||||
|
description: |-
|
||||||
|
Set Ephemeral to true to make the proxy authenticate as an ephemeral device.
|
||||||
|
Ephemeral devices are automatically deleted from your tailnet when they
|
||||||
|
disconnect, helping keep your tailnet clean.
|
||||||
|
Defaults to false.
|
||||||
|
type: boolean
|
||||||
metrics:
|
metrics:
|
||||||
description: |-
|
description: |-
|
||||||
Configuration for proxy metrics. Metrics are currently not supported
|
Configuration for proxy metrics. Metrics are currently not supported
|
||||||
|
@ -377,7 +377,12 @@ func (a *tailscaleSTSReconciler) createOrGetSecret(ctx context.Context, logger *
|
|||||||
if len(tags) == 0 {
|
if len(tags) == 0 {
|
||||||
tags = a.defaultTags
|
tags = a.defaultTags
|
||||||
}
|
}
|
||||||
authKey, err = newAuthKey(ctx, a.tsClient, tags, a.proxyUseEphemeralKeys)
|
// Determine if we should use ephemeral keys based on ProxyClass first, falling back to operator config
|
||||||
|
ephemeral := a.proxyUseEphemeralKeys
|
||||||
|
if stsC.ProxyClass != nil {
|
||||||
|
ephemeral = stsC.ProxyClass.Spec.Ephemeral
|
||||||
|
}
|
||||||
|
authKey, err = newAuthKey(ctx, a.tsClient, tags, ephemeral)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", nil, err
|
return "", "", nil, err
|
||||||
}
|
}
|
||||||
@ -962,8 +967,17 @@ func tailscaledConfig(stsC *tailscaleSTSConfig, newAuthkey string, oldSecret *co
|
|||||||
conf.AppConnector.Advertise = true
|
conf.AppConnector.Advertise = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if shouldAcceptRoutes(stsC.ProxyClass) {
|
|
||||||
conf.AcceptRoutes = "true"
|
// Apply ProxyClass settings if available
|
||||||
|
if stsC.ProxyClass != nil {
|
||||||
|
// Set AcceptRoutes if specified in ProxyClass
|
||||||
|
if shouldAcceptRoutes(stsC.ProxyClass) {
|
||||||
|
conf.AcceptRoutes = "true"
|
||||||
|
}
|
||||||
|
|
||||||
|
// For ephemeral devices, we set this in the auth key when created
|
||||||
|
// The ephemeral setting is handled at auth key creation time in the newAuthKey function
|
||||||
|
// We don't need to set it directly in the config
|
||||||
}
|
}
|
||||||
|
|
||||||
if newAuthkey != "" {
|
if newAuthkey != "" {
|
||||||
|
@ -81,6 +81,12 @@ type ProxyClassSpec struct {
|
|||||||
// renewed.
|
// renewed.
|
||||||
// +optional
|
// +optional
|
||||||
UseLetsEncryptStagingEnvironment bool `json:"useLetsEncryptStagingEnvironment,omitempty"`
|
UseLetsEncryptStagingEnvironment bool `json:"useLetsEncryptStagingEnvironment,omitempty"`
|
||||||
|
// Set Ephemeral to true to make the proxy authenticate as an ephemeral device.
|
||||||
|
// Ephemeral devices are automatically deleted from your tailnet when they
|
||||||
|
// disconnect, helping keep your tailnet clean.
|
||||||
|
// Defaults to false.
|
||||||
|
// +optional
|
||||||
|
Ephemeral bool `json:"ephemeral,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TailscaleConfig struct {
|
type TailscaleConfig struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user