Skip to content

Commit

Permalink
Allow configuring NTP pools and servers for LBMs (#411)
Browse files Browse the repository at this point in the history
* Allow configuring NTP pools and servers for LBMs

* Support new config in chart

* Format and improve linter settings

* go mod tidy

* Remove chronyd depencency in favor of restart

It seems desirable to start chrony as soon as possible even if it doesn't have its
final config yet. If the clock is off by too much, chrony should perform a step instead
of slewing the clock. It's better to do this quickly after boot before time-sensitive
processes might notice.

* Replace deprecated `initstepslew` directive

* Comment on not using cloud-init's NTP module

* earthly +generate
  • Loading branch information
timebertt committed Sep 10, 2024
1 parent 19a519f commit 4ed6629
Show file tree
Hide file tree
Showing 14 changed files with 542 additions and 306 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ out
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*
# Earthly
.tmp-earthly-out

# editor and IDE paraphernalia
.idea
Expand Down
116 changes: 55 additions & 61 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,21 @@ linters-settings:
statements: 50
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
- hugeParam
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
- hugeParam

gocyclo:
min-complexity:
30 # decrease this
# gci:
# local-prefixes: insert your package name here
# goimports:
# local-prefixes: insert your package name here
#revive:
#rules:
#- name: var-naming
#severity: warning
min-complexity: 30
gomnd:
settings:
mnd:
Expand All @@ -54,31 +45,31 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- dogsled
- gocritic
- gofmt
- goimports
- goprintffuncname
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- revive
- dupl
- gocyclo
- gosec
- nolintlint
- bodyclose
- dogsled
- gocritic
- gofmt
- goimports
- goprintffuncname
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- revive
- dupl
- gocyclo
- gosec
- nolintlint

# don't enable:
# - noctx
Expand Down Expand Up @@ -107,25 +98,28 @@ linters:
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd
- gochecknoglobals
- gosec
- noctx
- goerr113
- goconst
- dupl
- unparam
- path: _test\.go
linters:
- gomnd
- gochecknoglobals
- gosec
- noctx
- goerr113
- goconst
- dupl
- unparam

# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"

# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: "unnecessaryDefer:"
- text: "should not use dot imports"
path: _test\.go

# silence stupid linter errors
exclude:
- directive `// nolint.*` should be written without leading space
- directive `// nolint.*` should be written without leading space

run:
timeout: 15m
Expand Down
4 changes: 2 additions & 2 deletions charts/yawol-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ description: Helm chart for yawol-controller
name: yawol-controller
sources:
- https://github.com/stackitcloud/yawol
version: "0.24.0"
appVersion: v0.24.0
version: "0.25.0"
appVersion: v0.25.0
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.15.0
name: loadbalancermachines.yawol.stackit.cloud
spec:
group: yawol.stackit.cloud
Expand Down Expand Up @@ -39,14 +39,19 @@ spec:
API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -89,9 +94,9 @@ spec:
zone for the LoadBalancer.
type: string
defaultNetwork:
description: DefaultNetwork defines the default/listener network
for the Loadbalancer. TODO Remove optional when Deprecations
are removed
description: |-
DefaultNetwork defines the default/listener network for the Loadbalancer.
TODO Remove optional when Deprecations are removed
properties:
floatingNetID:
description: FloatingNetID defines an openstack ID for the
Expand All @@ -101,8 +106,7 @@ spec:
description: NetworkID defines an openstack ID for the network.
type: string
subnetID:
description: SubnetID defines an openstack ID for the
subnet.
description: SubnetID defines an openstack ID for the subnet.
type: string
required:
- networkID
Expand All @@ -124,21 +128,23 @@ spec:
virtual machines.
type: string
flavorName:
description: NOT IMPLEMENTED ONLY FlavorID is supported. FlavorName
is the name of the flavor used for requesting virtual machines.
description: |-
NOT IMPLEMENTED ONLY FlavorID is supported.
FlavorName is the name of the flavor used for requesting virtual machines.
FlavorName is only used if FlavorID is not defined.
type: string
flavorSearch:
description: NOT IMPLEMENTED ONLY FlavorID is supported. FlavorSearch
is a search string to find the flavor used for requesting
virtual machines. Search will be performed in metadata of
the flavors. FlavorSearch is only used if FlavorName and
FlavorID are not defined.
description: |-
NOT IMPLEMENTED ONLY FlavorID is supported.
FlavorSearch is a search string to find the flavor used for requesting virtual machines.
Search will be performed in metadata of the flavors.
FlavorSearch is only used if FlavorName and FlavorID are not defined.
type: string
type: object
floatingNetID:
description: 'Deprecated: use defaultNetwork instead FloatingNetID
defines a openstack ID for the floatingNet.'
description: |-
Deprecated: use defaultNetwork instead
FloatingNetID defines a openstack ID for the floatingNet.
type: string
image:
description: Image defines openstack image for the LoadBalancer.
Expand All @@ -157,26 +163,28 @@ spec:
machines.
type: string
imageName:
description: NOT IMPLEMENTED ONLY ImageID is supported. ImageName
is the name of the image used for requesting virtual machines.
description: |-
NOT IMPLEMENTED ONLY ImageID is supported.
ImageName is the name of the image used for requesting virtual machines.
ImageName is only used if ImageID is not defined.
type: string
imageSearch:
description: NOT IMPLEMENTED ONLY ImageID is supported. ImageSearch
is a search string to find the image used for requesting
virtual machines. Search will be performed in metadata of
the images. ImageSearch is only used if ImageName and ImageID
are not defined.
description: |-
NOT IMPLEMENTED ONLY ImageID is supported.
ImageSearch is a search string to find the image used for requesting virtual machines.
Search will be performed in metadata of the images.
ImageSearch is only used if ImageName and ImageID are not defined.
type: string
type: object
networkID:
description: 'Deprecated: use defaultNetwork instead NetworkID
defines a openstack ID for the network.'
description: |-
Deprecated: use defaultNetwork instead
NetworkID defines a openstack ID for the network.
type: string
projectID:
description: ProjectID defines an openstack project ID which will
be used instead of the project from the secret ref. If not set
the project from the secret ref will be used.
description: |-
ProjectID defines an openstack project ID which will be used instead of the project from the secret ref.
If not set the project from the secret ref will be used.
type: string
required:
- authSecretRef
Expand Down Expand Up @@ -292,8 +300,9 @@ spec:
type: object
type: array
portID:
description: 'Deprecated: use defaultPortID instead PortID contains
the openstack port ID for a LoadBalancerMachine.'
description: |-
Deprecated: use defaultPortID instead
PortID contains the openstack port ID for a LoadBalancerMachine.
type: string
roleBindingName:
description: RoleBindingName contains the namespacedName from the
Expand Down
Loading

0 comments on commit 4ed6629

Please sign in to comment.