Skip to content

Commit 26a8dd8

Browse files
committed
add additional role settings
1 parent 9d08448 commit 26a8dd8

12 files changed

Lines changed: 994 additions & 766 deletions

File tree

docs/input-manifest/api-reference.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ needs to be defined.
4949
| `hetznerdns` | [Hetzner](#hetznerdns) DNS provider type |
5050
| `oci` | [OCI](#oci) provider type |
5151
| `genesiscloud` | [GenesisCloud](#genesiscloud) provider type |
52-
52+
5353
- `secretRef` [SecretRef](#secretref)
5454

5555
Represents a Secret Reference. It has enough information to retrieve secret in any namespace.
@@ -59,7 +59,7 @@ Support for more cloud providers is in the [roadmap](https://github.com/berops/c
5959
!!! note "For static nodepools a provider is not needed, refer to the [static section](#static) for more detailed information."
6060

6161
## SecretRef
62-
62+
6363
SecretReference represents a Kubernetes Secret Reference. It has enough information to retrieve secret in any namespace.
6464

6565
- `name`
@@ -158,11 +158,11 @@ To find out how to configure OCI provider and service account, follow the instru
158158
Fingerprint of the user-supplied private key.
159159

160160
- `tenancyocid`
161-
161+
162162
OCID of the tenancy where `privateKey` is added as an API key
163163

164164
- `userocid`
165-
165+
166166
OCID of the user in the supplied tenancy
167167

168168
- `compartmentocid`
@@ -202,15 +202,15 @@ To find out how to configure Azure provider and service account, follow the inst
202202
Subscription ID of your subscription in Azure.
203203

204204
- `tenantid`
205-
205+
206206
Tenant ID of your tenancy in Azure.
207207

208208
- `clientid`
209209

210210
Client ID of your client. The Claudie is design to use a service principal with appropriate permissions.
211211

212212
- `clientsecret`
213-
213+
214214
Client secret generated for your client.
215215

216216
- `templates`
@@ -225,7 +225,7 @@ Collection of static and dynamic nodepool specification, to be referenced in the
225225
- `dynamic` [Dynamic](#dynamic)
226226

227227
List of dynamically to-be-created nodepools of not yet existing machines, used for Kubernetes or loadbalancer clusters.
228-
228+
229229
These are only blueprints, and will only be created per reference in `kubernetes` or `loadBalancer` clusters. E.g. if the nodepool isn't used, it won't even be created. Or if the same nodepool is used in two different clusters, it will be created twice.
230230
In OOP analogy, a dynamic nodepool would be a class that would get instantiated `N >= 0` times depending on which clusters reference it.
231231

@@ -243,29 +243,29 @@ Dynamic nodepools are defined for cloud provider machines that Claudie is expect
243243

244244
- `provideSpec` [Provider spec](#provider-spec)
245245

246-
Collection of provider data to be used while creating the nodepool.
246+
Collection of provider data to be used while creating the nodepool.
247247

248248
- `count`
249249

250250
Number of the nodes in the nodepool. Maximum value of 255. Mutually exclusive with `autoscaler`.
251251

252252
- `serverType`
253-
253+
254254
Type of the machines in the nodepool.
255-
255+
256256
Currently, only AMD64 machines are supported.
257257

258258
- `machineSpec`
259259

260260
Further describes the selected server type, if available by the cloud provider.
261-
261+
262262
- `cpuCount`: specifies the number of cpu to be used by the `serverType`
263263
- `memory`: specifies the memory in GB to be used by the `serverType`
264264

265265
- `image`
266266

267267
OS image of the machine.
268-
268+
269269
Currently, only Ubuntu 22.04 AMD64 images are supported.
270270

271271
- `storageDiskSize`
@@ -277,13 +277,13 @@ Dynamic nodepools are defined for cloud provider machines that Claudie is expect
277277
The default value for this field is `50`, with a minimum value also set to `50`. This value is only applicable to compute nodes. If the disk size is set to `0`, no storage disk will be created for any nodes in the particular node pool.
278278

279279
- `autoscaler` [Autoscaler Configuration](#autoscaler-configuration)
280-
280+
281281
Autoscaler configuration for this nodepool. Mutually exclusive with `count`.
282282

283283
- `labels`
284284

285285
Map of user defined labels, which will be applied on every node in the node pool. This field is optional.
286-
286+
287287
To see the default labels Claudie applies on each node, refer to [this section](#default-labels).
288288

289289
- `annotations`
@@ -319,7 +319,7 @@ Provider spec is an additional specification built on top of the data from any o
319319
Autoscaler configuration on per nodepool basis. Defines the number of nodes, autoscaler will scale up or down specific nodepool.
320320

321321
- `min`
322-
322+
323323
Minimum number of nodes in nodepool.
324324

325325
- `max`
@@ -343,7 +343,7 @@ Static nodepools are defined for static machines which Claudie will not manage.
343343
- `labels`
344344

345345
Map of user defined labels, which will be applied on every node in the node pool. This field is optional.
346-
346+
347347
To see the default labels Claudie applies on each node, refer to [this section](#default-labels).
348348

349349
- `annotations`
@@ -376,7 +376,7 @@ Static node defines single static node from a static nodepool.
376376
Secret from which private key will be taken used to SSH into the machine (as root or as a user specificed in the username attribute).
377377

378378
The field in the secret must be `privatekey`, i.e.
379-
379+
380380
```yaml
381381
apiVersion: v1
382382
type: Opaque
@@ -426,7 +426,7 @@ Collection of data used to define a Kubernetes cluster.
426426
Defines loadbalancer clusters.
427427

428428
- `roles` [Role](#role)
429-
429+
430430
List of roles loadbalancers use to forward the traffic. Single role can be used in multiple loadbalancer clusters.
431431

432432
- `clusters` [Cluster-lb](#cluster-lb)
@@ -461,6 +461,17 @@ Role defines a concrete loadbalancer configuration. Single loadbalancer can have
461461
- `targetPools`
462462
Defines from which nodepools, nodes will be targeted by the Load Balancer
463463

464+
- `settings`
465+
Optional settings that can be configured for a role
466+
467+
- `proxyProtocol`: Default value: `true`
468+
469+
Specifies whether to enable the proxy protocol. The Proxy protocol forwards connection information from the client, such as the IP address, to the target pools. The application to which the traffic is forwarded must support the proxy protocol.
470+
471+
- `stickySessions`: Default value: `false`
472+
473+
Specifies whether incoming traffic should be sent to the same node each time, rather than load balancing between available nodes. A hash of the IP is used to determine which node the traffic is routed to. <br>
474+
464475
## Cluster-lb
465476

466477
Collection of data used to define a loadbalancer cluster.
@@ -470,13 +481,13 @@ Collection of data used to define a loadbalancer cluster.
470481
Name of the loadbalancer. The name is limited by 28 characters.
471482

472483
- `roles`
473-
484+
474485
List of roles the loadbalancer uses.
475486

476487
- `dns` [DNS](#dns)
477-
488+
478489
Specification of the loadbalancer's DNS record.
479-
490+
480491
- `targetedK8s`
481492

482493
Name of the Kubernetes cluster targetted by this loadbalancer.
@@ -500,7 +511,7 @@ Collection of data Claudie uses to create a DNS record for the loadbalancer.
500511
Name of [provider](#providers) to be used for creating an A record entry in defined DNS zone.
501512

502513
- `hostname`
503-
514+
504515
Custom hostname for your A record. If left empty, the hostname will be a random hash.
505516

506517
### Default labels

docs/input-manifest/example.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ spec:
379379
# port: # Port, where traffic will be coming.
380380
# targetPort: # Port, where loadbalancer will forward traffic to.
381381
# targetPools: # Targeted nodes on kubernetes cluster. Specify a nodepool that is used in the targeted K8s cluster.
382+
# settings: # Optional settings that further configures the role.
383+
# proxyProtocol: # Turns on the proxy protocol, can be true, false. Default is true.
384+
# stickySessions: # Turn on sticky sessions that will hash the source ip to always choose the same node to which the traffic will be forwarded to. Can be true, false. Default is false.
382385
#
383386
# Definition specification for loadbalancer:
384387
#
@@ -401,10 +404,19 @@ spec:
401404
targetPort: 6443
402405
targetPools:
403406
- control-htz # make sure that this nodepools is acutally used by the targeted `dev-cluster` cluster.
407+
- name: https
408+
protocol: tcp
409+
port: 443
410+
targetPort: 30143 # make sure there is a NodePort service.
411+
targetPools:
412+
- compute-htz # make sure that this nodepools is acutally used by the targeted `dev-cluster` cluster.
413+
settings:
414+
proxyProtocol: true
404415
clusters:
405416
- name: apiserver-lb-dev
406417
roles:
407418
- apiserver
419+
- https
408420
dns:
409421
dnsZone: dns-zone
410422
provider: hetznerdns-1

go.mod

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/berops/claudie
22

3-
go 1.23
3+
go 1.23.0
44

55
require (
66
cloud.google.com/go/compute v1.29.0
@@ -30,17 +30,17 @@ require (
3030
github.com/tidwall/sjson v1.2.5
3131
go.mongodb.org/mongo-driver v1.17.1
3232
golang.org/x/crypto v0.32.0
33-
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0
33+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
3434
golang.org/x/net v0.34.0
3535
golang.org/x/sync v0.10.0
3636
google.golang.org/api v0.203.0
3737
google.golang.org/grpc v1.67.1
3838
google.golang.org/protobuf v1.36.1
3939
gopkg.in/yaml.v3 v3.0.1
40-
k8s.io/api v0.31.3
41-
k8s.io/apimachinery v0.31.3
40+
k8s.io/api v0.32.2
41+
k8s.io/apimachinery v0.32.2
4242
k8s.io/autoscaler/cluster-autoscaler v0.0.0-20230523093230-982c82176cde
43-
k8s.io/client-go v0.31.0
43+
k8s.io/client-go v0.32.1
4444
sigs.k8s.io/controller-runtime v0.19.3
4545
)
4646

@@ -84,9 +84,9 @@ require (
8484
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
8585
github.com/go-git/go-billy/v5 v5.5.0 // indirect
8686
github.com/go-logr/stdr v1.2.2 // indirect
87-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
87+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
8888
github.com/go-openapi/jsonreference v0.20.2 // indirect
89-
github.com/go-openapi/swag v0.22.4 // indirect
89+
github.com/go-openapi/swag v0.23.0 // indirect
9090
github.com/go-playground/locales v0.14.1 // indirect
9191
github.com/go-playground/universal-translator v0.18.1 // indirect
9292
github.com/gofrs/flock v0.8.1 // indirect
@@ -97,12 +97,10 @@ require (
9797
github.com/golang/snappy v0.0.4 // indirect
9898
github.com/google/gnostic-models v0.6.8 // indirect
9999
github.com/google/gofuzz v1.2.0 // indirect
100-
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
101100
github.com/google/s2a-go v0.1.8 // indirect
102101
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
103102
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
104103
github.com/gorilla/mux v1.8.1 // indirect
105-
github.com/imdario/mergo v0.3.15 // indirect
106104
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
107105
github.com/jmespath/go-jmespath v0.4.0 // indirect
108106
github.com/josharian/intern v1.0.0 // indirect
@@ -113,11 +111,13 @@ require (
113111
github.com/leodido/go-urn v1.4.0 // indirect
114112
github.com/mailru/easyjson v0.7.7 // indirect
115113
github.com/mattn/go-colorable v0.1.13 // indirect
116-
github.com/mattn/go-isatty v0.0.19 // indirect
114+
github.com/mattn/go-isatty v0.0.20 // indirect
117115
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
118116
github.com/modern-go/reflect2 v1.0.2 // indirect
119117
github.com/montanaflynn/stats v0.7.1 // indirect
120118
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
119+
github.com/onsi/ginkgo/v2 v2.22.1 // indirect
120+
github.com/onsi/gomega v1.36.2 // indirect
121121
github.com/pjbgf/sha1cd v0.3.0 // indirect
122122
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
123123
github.com/pkg/errors v0.9.1 // indirect
@@ -129,7 +129,7 @@ require (
129129
github.com/sirupsen/logrus v1.9.3 // indirect
130130
github.com/skeema/knownhosts v1.2.2 // indirect
131131
github.com/sony/gobreaker v0.5.0 // indirect
132-
github.com/spf13/pflag v1.0.5 // indirect
132+
github.com/spf13/pflag v1.0.6 // indirect
133133
github.com/tidwall/match v1.1.1 // indirect
134134
github.com/tidwall/pretty v1.2.0 // indirect
135135
github.com/x448/float16 v0.8.4 // indirect
@@ -149,20 +149,20 @@ require (
149149
golang.org/x/term v0.28.0 // indirect
150150
golang.org/x/text v0.21.0 // indirect
151151
golang.org/x/time v0.7.0 // indirect
152-
golang.org/x/tools v0.28.0 // indirect
152+
golang.org/x/tools v0.29.0 // indirect
153153
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
154154
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
155155
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
156156
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
157+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
157158
gopkg.in/inf.v0 v0.9.1 // indirect
158159
gopkg.in/warnings.v0 v0.1.2 // indirect
159-
gopkg.in/yaml.v2 v2.4.0 // indirect
160-
k8s.io/apiextensions-apiserver v0.31.0 // indirect
160+
k8s.io/apiextensions-apiserver v0.32.1 // indirect
161161
k8s.io/klog/v2 v2.130.1 // indirect
162-
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
163-
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
164-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
165-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
162+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
163+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
164+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
165+
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
166166
sigs.k8s.io/yaml v1.4.0 // indirect
167167
)
168168

0 commit comments

Comments
 (0)