Skip to content

Commit

Permalink
SetHostnameAsFQDN option is added to all components. Default is true (y…
Browse files Browse the repository at this point in the history
…tsaurus#302)

* SetHostnameAsFQDN option is added to all components. Default is true

* SetHostnameAsFQDN is true by default and the value is getting from instanceSpec in one place in server.go

* forgot lint-generated
  • Loading branch information
qurname2 authored and leo-astorsky committed Aug 13, 2024
1 parent 08a4e79 commit 88af2c9
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 1 deletion.
3 changes: 3 additions & 0 deletions api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ type InstanceSpec struct {
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
// SetHostnameAsFQDN indicates whether to set the hostname as FQDN.
//+kubebuilder:default:=true
SetHostnameAsFQDN *bool `json:"setHostnameAsFqdn,omitempty"`
// Component config for native RPC bus transport.
//+optional
NativeTransport *RPCTransportSpec `json:"nativeTransport,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remoteexecnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
sidecars:
description: List of sidecar containers as yaml of core/v1 Container.
items:
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remoteytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down
75 changes: 75 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -3368,6 +3373,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -5748,6 +5758,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -8319,6 +8334,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
sidecars:
description: List of sidecar containers as yaml of core/v1 Container.
items:
Expand Down Expand Up @@ -10736,6 +10756,11 @@ spec:
description: Service Type string describes ingress methods for
a service
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -13157,6 +13182,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -15584,6 +15614,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
sidecars:
description: List of sidecar containers as yaml of core/v1 Container.
items:
Expand Down Expand Up @@ -17957,6 +17992,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -20323,6 +20363,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -22707,6 +22752,11 @@ spec:
description: Service Type string describes ingress methods for
a service
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -25105,6 +25155,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -27490,6 +27545,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
sidecars:
description: List of sidecar containers as yaml of core/v1 Container.
items:
Expand Down Expand Up @@ -29939,6 +29999,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -32342,6 +32407,11 @@ spec:
description: Service Type string describes ingress methods for
a service
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -34920,6 +34990,11 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
default: true
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down
17 changes: 17 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -320,6 +321,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `tags` _string array_ | List of the node tags. | | |
| `rack` _string_ | Name of the node rack. | | |
Expand Down Expand Up @@ -377,6 +379,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -468,6 +471,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `tags` _string array_ | List of the node tags. | | |
| `rack` _string_ | Name of the node rack. | | |
Expand Down Expand Up @@ -514,6 +518,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `serviceType` _[ServiceType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#servicetype-v1-core)_ | | NodePort | |
| `httpNodePort` _integer_ | | | |
Expand Down Expand Up @@ -624,6 +629,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -828,6 +834,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `cellTagMasterCaches` _integer_ | | | |
| `hostAddressesMasterCaches` _string array_ | | | |
Expand Down Expand Up @@ -886,6 +893,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `cellTag` _integer_ | | | |
| `hostAddresses` _string array_ | | | |
Expand Down Expand Up @@ -966,6 +974,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -1003,6 +1012,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -1040,6 +1050,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `serviceType` _[ServiceType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#servicetype-v1-core)_ | | | |
| `nodePort` _integer_ | | | |
Expand Down Expand Up @@ -1152,6 +1163,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `tags` _string array_ | List of the node tags. | | |
| `rack` _string_ | Name of the node rack. | | |
Expand Down Expand Up @@ -1220,6 +1232,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `cellTagMasterCaches` _integer_ | | | |
| `hostAddressesMasterCaches` _string array_ | | | |
Expand Down Expand Up @@ -1262,6 +1275,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -1392,6 +1406,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `serviceType` _[ServiceType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#servicetype-v1-core)_ | | | |
| `minPort` _integer_ | | 32000 | |
Expand Down Expand Up @@ -1450,6 +1465,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `tags` _string array_ | List of the node tags. | | |
| `rack` _string_ | Name of the node rack. | | |
Expand Down Expand Up @@ -1616,6 +1632,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core) array_ | | | |
| `podLabels` _object (keys:string, values:string)_ | | | |
| `podAnnotations` _object (keys:string, values:string)_ | | | |
| `setHostnameAsFqdn` _boolean_ | SetHostnameAsFQDN indicates whether to set the hostname as FQDN. | true | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down
2 changes: 1 addition & 1 deletion pkg/components/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (s *serverImpl) rebuildStatefulSet() *appsv1.StatefulSet {
statefulSet.Spec.Template.Spec = corev1.PodSpec{
RuntimeClassName: s.instanceSpec.RuntimeClassName,
ImagePullSecrets: s.commonSpec.ImagePullSecrets,
SetHostnameAsFQDN: ptr.Bool(true),
SetHostnameAsFQDN: s.instanceSpec.SetHostnameAsFQDN,
EnableServiceLinks: ptr.Bool(false),
Containers: []corev1.Container{
{
Expand Down
Loading

0 comments on commit 88af2c9

Please sign in to comment.