Skip to content

Commit 2c3adb0

Browse files
committed
feat: update chart to 0.2
1 parent d02d465 commit 2c3adb0

113 files changed

Lines changed: 16494 additions & 873 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/golangci-lint.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- '.golangci.yml'
1717

1818
env:
19-
GO_VERSION: '1.25'
19+
GO_VERSION: '1.26'
2020
TASK_VERSION: '3.38.0'
2121

2222
jobs:

‎.github/workflows/test-lib.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- main
1212

1313
env:
14-
GO_VERSION: '1.25'
14+
GO_VERSION: '1.26'
1515
TASK_VERSION: '3.38.0'
1616

1717
jobs:

‎auth-center/.helm/values.yaml‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,19 @@ service:
1313
http: 9000
1414
grpc: 8000
1515
administrator:
16-
username: ""
17-
password: ""
16+
existingSecret: cs-account
1817
containerSecurityContext:
19-
enabled: true
2018
seLinuxOptions: {}
2119
privileged: false
2220
allowPrivilegeEscalation: false
2321
readOnlyRootFilesystem: true
2422
seccompProfile:
2523
type: "RuntimeDefault"
2624
podSecurityContext:
27-
enabled: true
2825
fsGroupChangePolicy: Always
2926
sysctls: []
3027
supplementalGroups: []
3128
env:
32-
- name: ADMINISTRATOR_USERNAME
33-
valueFrom:
34-
secretKeyRef:
35-
name: auth-center-account
36-
key: username
37-
- name: ADMINISTRATOR_PASSWORD
38-
valueFrom:
39-
secretKeyRef:
40-
name: auth-center-account
41-
key: password
4229
postgresql:
4330
enabled: true
4431
serviceAccount:
@@ -58,7 +45,6 @@ resources:
5845
memory: 128Mi
5946
ephemeral-storage: 1Mi
6047
livenessProbe:
61-
enabled: true
6248
httpGet:
6349
path: /live
6450
scheme: HTTP
@@ -67,7 +53,6 @@ livenessProbe:
6753
successThreshold: 1
6854
failureThreshold: 2
6955
readinessProbe:
70-
enabled: true
7156
httpGet:
7257
path: /ready
7358
scheme: HTTP
@@ -76,7 +61,6 @@ readinessProbe:
7661
successThreshold: 1
7762
failureThreshold: 3
7863
startupProbe:
79-
enabled: true
8064
httpGet:
8165
path: /ready
8266
scheme: HTTP

‎cluster-manager/.helm/values.yaml‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,24 @@ service:
1313
grpc: 8000
1414
http: 9000
1515
containerSecurityContext:
16-
enabled: true
1716
seLinuxOptions: {}
1817
privileged: false
1918
allowPrivilegeEscalation: false
2019
readOnlyRootFilesystem: true
2120
seccompProfile:
2221
type: "RuntimeDefault"
2322
podSecurityContext:
24-
enabled: true
2523
fsGroupChangePolicy: Always
2624
sysctls: []
2725
supplementalGroups: []
2826
env:
29-
- name: ADMINISTRATOR_USERNAME
30-
valueFrom:
31-
secretKeyRef:
32-
name: auth-center-account
33-
key: username
34-
- name: ADMINISTRATOR_PASSWORD
35-
valueFrom:
36-
secretKeyRef:
37-
name: auth-center-account
38-
key: password
3927
- name: PUBLIC_ACCESS_TOKEN_SALT_KEY
4028
valueFrom:
4129
secretKeyRef:
42-
name: cs-keys
30+
name: '{{ include "common.cs.keys.secretName" . }}'
4331
key: publicAccessTokenSalt
32+
administrator:
33+
existingSecret: cs-account
4434
encryption:
4535
enabled: true
4636
postgresql:
@@ -63,7 +53,6 @@ resources: {}
6353
# memory: 512Mi
6454
# ephemeral-storage: 1Gi
6555
livenessProbe:
66-
enabled: true
6756
httpGet:
6857
path: /live
6958
scheme: HTTP
@@ -72,7 +61,6 @@ livenessProbe:
7261
successThreshold: 1
7362
failureThreshold: 2
7463
readinessProbe:
75-
enabled: true
7664
httpGet:
7765
path: /ready
7866
scheme: HTTP
@@ -81,7 +69,6 @@ readinessProbe:
8169
successThreshold: 1
8270
failureThreshold: 3
8371
startupProbe:
84-
enabled: true
8572
httpGet:
8673
path: /ready
8774
scheme: HTTP

‎cluster-manager/pkg/helm/values.go‎

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ type Values struct {
4343
PublicAccessTokenSalt string `json:"publicAccessTokenSalt,omitempty"`
4444
} `json:"keys,omitzero"`
4545

46-
Postgresql TLSGlobal `json:"postgresql"`
47-
Redis TLSGlobal `json:"redis"`
48-
Clickhouse TLSGlobal `json:"clickhouse"`
49-
Grafana TLSGlobal `json:"grafana,omitzero"`
50-
Loki TLSGlobal `json:"loki,omitzero"`
46+
Administrator struct {
47+
Username string `json:"username,omitempty"`
48+
Password string `json:"password,omitempty"`
49+
} `json:"administrator,omitzero"`
50+
51+
Postgresql AuthTLSGlobal `json:"postgresql"`
52+
Redis AuthTLSGlobal `json:"redis"`
53+
Rabbitmq AuthGlobal `json:"rabbitmq,omitzero"`
54+
Clickhouse AuthTLSGlobal `json:"clickhouse"`
55+
Grafana TLSGlobal `json:"grafana,omitzero"`
56+
Loki TLSGlobal `json:"loki,omitzero"`
5157
} `json:"global,omitzero"`
5258

5359
TLS struct {
@@ -57,13 +63,6 @@ type Values struct {
5763
CertKey string `json:"certKey,omitempty"`
5864
} `json:"tls,omitzero"`
5965

60-
AuthAPI struct {
61-
Administrator struct {
62-
Username string `json:"username,omitempty"`
63-
Password string `json:"password,omitempty"`
64-
} `json:"administrator,omitzero"`
65-
} `json:"auth-center,omitzero"`
66-
6766
ImagePullSecret struct {
6867
Username string `json:"username,omitempty"`
6968
Password string `json:"password,omitempty"`
@@ -248,20 +247,40 @@ type TLSGlobal struct {
248247
} `json:"tls"`
249248
}
250249

251-
// buildHelmArgs recursively converts a value to Helm command-line arguments.
252-
// It traverses the value and generates the appropriate --set or --set-string arguments
253-
// based on the value's kind.
250+
// AuthTLSGlobal is the global-section block for services that share both an
251+
// existing auth secret name and TLS settings across consumer sub-charts
252+
// (postgresql, redis, clickhouse).
253+
type AuthTLSGlobal struct {
254+
Auth struct {
255+
ExistingSecret string `json:"existingSecret,omitempty"`
256+
} `json:"auth,omitzero"`
257+
TLS struct {
258+
Enabled bool `json:"enabled"`
259+
Verify bool `json:"verify"`
260+
} `json:"tls"`
261+
}
262+
263+
// AuthGlobal is the global-section block for services that share only an
264+
// existing auth secret name across consumer sub-charts (rabbitmq has no TLS
265+
// knobs at the global level).
266+
type AuthGlobal struct {
267+
Auth struct {
268+
ExistingSecret string `json:"existingSecret,omitempty"`
269+
} `json:"auth,omitzero"`
270+
}
271+
272+
// buildHelmArgs recursively converts a struct's fields to Helm command-line arguments.
273+
// It traverses the struct and generates the appropriate --set or --set-string arguments
274+
// based on field types.
254275
//
255-
// Each value is processed according to its kind:
276+
// Each field is processed according to its kind:
256277
// - Strings use --set-string
257278
// - Bool, numeric types use --set
258-
// - Arrays/Slices are expanded into per-element args using the `name[i]` form
259-
// - Structs are processed recursively over their fields
279+
// - Arrays/Slices are JSON marshaled and use --set
280+
// - Structs are processed recursively
260281
//
261-
// Struct fields with `json:"-"` are skipped.
262-
// Struct fields with `json:",omitempty"` or `json:",omitzero"` are skipped if they
263-
// contain zero values; this is communicated through the `hasOmit` argument when
264-
// recursing.
282+
// Fields with `json:"-"` are skipped.
283+
// Fields with `json:",omitempty"` or `json:",omitzero"` are skipped if they contain zero values.
265284
//
266285
// Returns an error if JSON marshaling fails for array/slice fields.
267286
func buildHelmArgs(v any, prefix string, hasOmit bool) ([]string, error) {

‎cluster-manager/pkg/helm/values_test.go‎

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ func TestBuildHelmArgs(t *testing.T) {
6161
Nested struct {
6262
Field1 string `json:"field1"`
6363
Field2 int `json:"field2"`
64-
} `json:"nested"`
64+
} `json:"nested,omitempty"`
6565
NestedEmpty struct {
6666
Field1 string `json:"field1"`
6767
Field2 int `json:"field2"`
68-
} `json:"nestedEmpty,omitzero"`
68+
} `json:"nestedEmpty,omitempty"`
6969
NestedZero struct {
7070
Field1 string `json:"field1"`
7171
Field2 int `json:"field2"`
@@ -225,6 +225,10 @@ func generateValues() Values {
225225
values.Global.ImageShortNames = false
226226
values.Global.Keys.Encryption = "encryption-key"
227227
values.Global.Keys.Token = "token-key"
228+
values.Global.Postgresql.Auth.ExistingSecret = "pg-secret"
229+
values.Global.Redis.Auth.ExistingSecret = "redis-secret"
230+
values.Global.Rabbitmq.Auth.ExistingSecret = "rabbitmq-secret"
231+
values.Global.Clickhouse.Auth.ExistingSecret = "ch-secret"
228232

229233
values.TLS.CertCA = "ca-cert-data"
230234
values.TLS.Cert = "cert-data"
@@ -275,9 +279,9 @@ func generateValues() Values {
275279
// CS Manager
276280
values.CSManager.RegistrationToken = "registration-token"
277281

278-
// AuthAPI
279-
values.AuthAPI.Administrator.Username = "user"
280-
values.AuthAPI.Administrator.Password = "pass"
282+
// Administrator
283+
values.Global.Administrator.Username = "user"
284+
values.Global.Administrator.Password = "pass"
281285

282286
return values
283287
}
@@ -311,15 +315,19 @@ func TestValuesToHelmArgs(t *testing.T) {
311315
"--set-string 'postgresql.auth.username=postgres'",
312316
"--set-string 'postgresql.auth.password=postgres-password'",
313317
"--set 'postgresql.persistence.enabled=true'",
318+
"--set-string 'global.postgresql.auth.existingSecret=pg-secret'",
314319
"--set 'global.postgresql.tls.enabled=true'",
315320
"--set 'global.postgresql.tls.verify=true'",
316321
"--set-string 'postgresql.persistence.storageClass=standard-1'",
317322
"--set 'redis.deploy=true'",
318323
"--set-string 'redis.auth.username=redis'",
319324
"--set-string 'redis.auth.password=redis-password'",
320325
"--set 'redis.persistence.enabled=false'",
326+
"--set-string 'global.redis.auth.existingSecret=redis-secret'",
321327
"--set 'global.redis.tls.enabled=false'",
322328
"--set 'global.redis.tls.verify=false'",
329+
"--set-string 'global.rabbitmq.auth.existingSecret=rabbitmq-secret'",
330+
"--set-string 'global.clickhouse.auth.existingSecret=ch-secret'",
323331
"--set 'metrics.enabled=false'",
324332
"--set 'rabbitmq.deploy=true'",
325333
"--set-string 'rabbitmq.auth.username=rabbitmq'",
@@ -341,8 +349,8 @@ func TestValuesToHelmArgs(t *testing.T) {
341349
"--set-string 'notifier.env[1].name=HTTPS_PROXY'",
342350
"--set-string 'notifier.env[1].value=https://proxy.local'",
343351
"--set-string 'cs-manager.registrationToken=registration-token'",
344-
"--set-string 'auth-center.administrator.username=user'",
345-
"--set-string 'auth-center.administrator.password=pass'",
352+
"--set-string 'global.administrator.username=user'",
353+
"--set-string 'global.administrator.password=pass'",
346354
}
347355

348356
if diff := cmp.Diff(args, expectedArgs,
@@ -367,10 +375,6 @@ func TestValuesToYaml(t *testing.T) {
367375
lines := strings.Split(yaml, "\n")
368376

369377
expectedLines := []string{
370-
"auth-center:",
371-
" administrator:",
372-
" password: pass",
373-
" username: user",
374378
"clickhouse:",
375379
" deploy: false",
376380
" externalHost: clickhouse.local",
@@ -379,8 +383,13 @@ func TestValuesToYaml(t *testing.T) {
379383
"cs-manager:",
380384
" registrationToken: registration-token",
381385
"global:",
386+
" administrator:",
387+
" password: pass",
388+
" username: user",
382389
" centralCsUrl: https://central-cs.local",
383390
" clickhouse:",
391+
" auth:",
392+
" existingSecret: ch-secret",
384393
" tls:",
385394
" enabled: false",
386395
" verify: false",
@@ -392,10 +401,17 @@ func TestValuesToYaml(t *testing.T) {
392401
" token: token-key",
393402
" ownCsUrl: https://cs.local",
394403
" postgresql:",
404+
" auth:",
405+
" existingSecret: pg-secret",
395406
" tls:",
396407
" enabled: true",
397408
" verify: true",
409+
" rabbitmq:",
410+
" auth:",
411+
" existingSecret: rabbitmq-secret",
398412
" redis:",
413+
" auth:",
414+
" existingSecret: redis-secret",
399415
" tls:",
400416
" enabled: false",
401417
" verify: false",

‎cluster-manager/pkg/service/cluster_generic.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ func (cg *ClusterGeneric) buildValues(cfg *model.ClusterConfig, token string) *h
519519
}
520520
}
521521

522-
// AuthAPI
523-
v.AuthAPI.Administrator.Username = cg.AdministratorUsername
524-
v.AuthAPI.Administrator.Password = cg.AdministratorPassword
522+
// Administrator
523+
v.Global.Administrator.Username = cg.AdministratorUsername
524+
v.Global.Administrator.Password = cg.AdministratorPassword
525525

526526
return &v
527527
}

‎cs-manager/.helm/values.yaml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ ownCsUrl: ""
1717
centralCsUrl: ""
1818
registrationToken: ""
1919
containerSecurityContext:
20-
enabled: true
2120
seLinuxOptions: {}
2221
privileged: false
2322
allowPrivilegeEscalation: false
2423
readOnlyRootFilesystem: true
2524
seccompProfile:
2625
type: "RuntimeDefault"
2726
podSecurityContext:
28-
enabled: true
2927
fsGroupChangePolicy: Always
3028
sysctls: []
3129
supplementalGroups: []
@@ -53,7 +51,6 @@ resources:
5351
memory: 512Mi
5452
ephemeral-storage: 1Gi
5553
livenessProbe:
56-
enabled: true
5754
httpGet:
5855
path: /live
5956
scheme: HTTP
@@ -62,7 +59,6 @@ livenessProbe:
6259
successThreshold: 1
6360
failureThreshold: 2
6461
readinessProbe:
65-
enabled: true
6662
httpGet:
6763
path: /ready
6864
scheme: HTTP
@@ -71,7 +67,6 @@ readinessProbe:
7167
successThreshold: 1
7268
failureThreshold: 3
7369
startupProbe:
74-
enabled: true
7570
httpGet:
7671
path: /ready
7772
scheme: HTTP

0 commit comments

Comments
 (0)