Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetHostnameAsFQDN option is added to all components. Default is true #302

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
//+optional
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.

4 changes: 4 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remoteexecnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
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
4 changes: 4 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remoteytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down
60 changes: 60 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -3332,6 +3336,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -5692,6 +5700,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -8243,6 +8255,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
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 @@ -10637,6 +10653,10 @@ spec:
description: Service Type string describes ingress methods for
a service
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -13035,6 +13055,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -15442,6 +15466,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
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 @@ -17795,6 +17823,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -20141,6 +20173,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -22505,6 +22541,10 @@ spec:
description: Service Type string describes ingress methods for
a service
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -24883,6 +24923,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the hostname
as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -27248,6 +27292,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
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 @@ -29677,6 +29725,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -32060,6 +32112,10 @@ spec:
description: Service Type string describes ingress methods for
a service
type: string
setHostnameAsFqdn:
description: SetHostnameAsFQDN indicates whether to set the
hostname as FQDN.
type: boolean
structuredLoggers:
items:
properties:
Expand Down Expand Up @@ -34618,6 +34674,10 @@ spec:
type: object
runtimeClassName:
type: string
setHostnameAsFqdn:
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 @@ -281,6 +281,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -318,6 +319,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. | | |
| `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 @@ -375,6 +377,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -466,6 +469,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. | | |
| `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 @@ -512,6 +516,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. | | |
| `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 @@ -622,6 +627,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -826,6 +832,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `cellTagMasterCaches` _integer_ | | | |
| `hostAddressesMasterCaches` _string array_ | | | |
Expand Down Expand Up @@ -884,6 +891,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `cellTag` _integer_ | | | |
| `hostAddresses` _string array_ | | | |
Expand Down Expand Up @@ -964,6 +972,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -1001,6 +1010,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -1038,6 +1048,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. | | |
| `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 @@ -1148,6 +1159,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. | | |
| `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 @@ -1216,6 +1228,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |
| `cellTagMasterCaches` _integer_ | | | |
| `hostAddressesMasterCaches` _string array_ | | | |
Expand Down Expand Up @@ -1258,6 +1271,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down Expand Up @@ -1388,6 +1402,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. | | |
| `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 @@ -1446,6 +1461,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. | | |
| `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 @@ -1612,6 +1628,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. | | |
| `nativeTransport` _[RPCTransportSpec](#rpctransportspec)_ | Component config for native RPC bus transport. | | |


Expand Down
10 changes: 5 additions & 5 deletions pkg/apiproxy/ytsaurus.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ func (c *Ytsaurus) IsStatusConditionFalse(conditionType string) bool {

func sortConditions(conditions []metav1.Condition) {
slices.SortStableFunc(conditions, func(a, b metav1.Condition) int {
statusOrder := []metav1.ConditionStatus{metav1.ConditionTrue, metav1.ConditionFalse, metav1.ConditionUnknown}
if diff := cmp.Compare(slices.Index(statusOrder, a.Status), slices.Index(statusOrder, b.Status)); diff != 0 {
return diff
}
return a.LastTransitionTime.Compare(b.LastTransitionTime.Time)
statusOrder := []metav1.ConditionStatus{metav1.ConditionTrue, metav1.ConditionFalse, metav1.ConditionUnknown}
if diff := cmp.Compare(slices.Index(statusOrder, a.Status), slices.Index(statusOrder, b.Status)); diff != 0 {
return diff
}
return a.LastTransitionTime.Compare(b.LastTransitionTime.Time)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our linter test didn't catch that last time? =/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like not

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouln't diff be gone after 6a6f343 ?
Maybe need to rebase

})
}
4 changes: 4 additions & 0 deletions pkg/components/controller_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func NewControllerAgent(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus,
resource.Spec.ControllerAgents.InstanceSpec.MonitoringPort = ptr.Int32(consts.ControllerAgentMonitoringPort)
}

if resource.Spec.ControllerAgents.SetHostnameAsFQDN == nil {
resource.Spec.ControllerAgents.SetHostnameAsFQDN = ptr.Bool(true)
}

srv := newServer(
&l,
ytsaurus,
Expand Down
4 changes: 4 additions & 0 deletions pkg/components/data_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func NewDataNode(
spec.InstanceSpec.MonitoringPort = ptr.Int32(consts.DataNodeMonitoringPort)
}

if spec.SetHostnameAsFQDN == nil {
spec.SetHostnameAsFQDN = ptr.Bool(true)
}

srv := newServer(
&l,
ytsaurus,
Expand Down
Loading
Loading