Skip to content

Commit 8daf0bf

Browse files
committed
fix: SGConfig default for collector is empty on OLM
1 parent 638a166 commit 8daf0bf

4 files changed

Lines changed: 97 additions & 49 deletions

File tree

stackgres-k8s/e2e/spec/dbops-security-upgrade

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,6 @@ check_cluster_before_security_upgrade() {
714714
PATRONI_CONFIG="$(kubectl get endpoints -n "$CLUSTER_NAMESPACE" "$CLUSTER_CONFIG_ENDPOINTS_NAME" --template '{{ .metadata.annotations.config }}')"
715715
PATRONI_CONFIG="$(printf '%s' "$PATRONI_CONFIG" | jq -Sc '.
716716
| if .synchronous_mode then . else del(.synchronous_node_count) end
717-
| del(.postgresql.pg_hba)
718717
')"
719718
jq -Sc '.
720719
| if .synchronous_mode then . else del(.synchronous_node_count) end

stackgres-k8s/e2e/spec/dbops-security-upgrade-olm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/sh
22

3+
E2E_OLM_VERSION="${E2E_OLM_VERSION:-0.28.0}"
4+
35
. "$SPEC_PATH/dbops-security-upgrade"
46

57
e2e_test_extra_hash() {
8+
printf 'E2E_OLM_VERSION=%s\n' "$E2E_OLM_VERSION"
69
"$SHELL" "$PROJECT_PATH/stackgres-k8s/ci/build/build-functions.sh" path_hash \
710
"stackgres-k8s/install/operator-sdk"
811
"$SHELL" "$PROJECT_PATH/stackgres-k8s/ci/build/build-functions.sh" path_hash \
@@ -73,7 +76,8 @@ e2e_install_previous_operator() {
7376
|| ! kubectl get clusterrole system:controller:operator-lifecycle-manager 2>/dev/null
7477
wait_until eval '! kubectl get namespace olm > /dev/null 2>&1'
7578
operator-sdk olm install \
76-
--timeout "${E2E_TIMEOUT}s"
79+
--timeout "${E2E_TIMEOUT}s" \
80+
--version "$E2E_OLM_VERSION"
7781
fi
7882

7983
if [ "$E2E_ENV" != "minishift" ] && [ "$E2E_ENV" != "crc" ] && [ "$E2E_ENV" != "microshift" ]

stackgres-k8s/e2e/spec/operator-olm

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/bin/sh
22

3+
E2E_OLM_VERSION="${E2E_OLM_VERSION:-0.28.0}"
4+
5+
. "$SPEC_PATH/abstract/metrics"
6+
7+
e2e_test_extra_hash() {
8+
printf 'E2E_OLM_VERSION=%s\n' "$E2E_OLM_VERSION"
9+
"$SHELL" "$PROJECT_PATH/stackgres-k8s/ci/build/build-functions.sh" path_hash \
10+
"stackgres-k8s/install/operator-sdk"
11+
"$SHELL" "$PROJECT_PATH/stackgres-k8s/ci/build/build-functions.sh" path_hash \
12+
"$(realpath --relative-to "$PROJECT_PATH" "$SPEC_PATH/abstract/metrics")"
13+
}
14+
315
e2e_exclusive_lock() {
416
true
517
}
@@ -42,6 +54,8 @@ e2e_test() {
4254

4355
run_test "Check that resources can be created" check_resources_creation
4456

57+
run_test "Checking that metrics are exported" check_metrics "$CLUSTER_1_NAME"
58+
4559
run_test "Namespace endpoint should return all kubernetes namespaces" check_namespace
4660

4761
if [ "$E2E_SKIP_CHECK_OPERATOR_DELETE" = true ]
@@ -535,7 +549,8 @@ e2e_install_olm() {
535549
|| ! kubectl get clusterrole system:controller:operator-lifecycle-manager 2>/dev/null
536550
wait_until eval '! kubectl get namespace olm > /dev/null 2>&1'
537551
operator-sdk olm install \
538-
--timeout "${E2E_TIMEOUT}s"
552+
--timeout "${E2E_TIMEOUT}s" \
553+
--version "$E2E_OLM_VERSION"
539554
fi
540555

541556
CATALOG_IMAGE_NAME="${E2E_CATALOG_IMAGE_REGISTRY:-$E2E_OPERATOR_REGISTRY${E2E_OPERATOR_REGISTRY_PATH%/}}/stackgres/${OPERATOR_BUNDLE_CATALOG_IMAGE_NAME##*/}"

stackgres-k8s/src/common/src/main/resources/crds/SGConfig.yaml

Lines changed: 76 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,55 @@ spec:
385385
a configured target (by default will expose a Prometheus exporter).
386386
387387
See receivers section to scale this architecture to a set of OpenTelemetry Collectors.
388+
default:
389+
service:
390+
spec:
391+
type: ClusterIP
392+
ports:
393+
- name: prom-http
394+
protocol: TCP
395+
port: 9464
396+
targetPort: prom-http
397+
ports:
398+
- name: prom-http
399+
protocol: TCP
400+
containerPort: 9464
401+
config:
402+
receivers:
403+
otlp:
404+
protocols:
405+
grpc:
406+
endpoint: "0.0.0.0:4317"
407+
tls:
408+
ca_file: "/etc/operator/certs/tls.crt"
409+
cert_file: "/etc/operator/certs/tls.crt"
410+
key_file: "/etc/operator/certs/tls.key"
411+
exporters:
412+
prometheus:
413+
endpoint: "0.0.0.0:9464"
414+
tls:
415+
ca_file: "/etc/operator/certs/tls.crt"
416+
cert_file: "/etc/operator/certs/tls.crt"
417+
key_file: "/etc/operator/certs/tls.key"
418+
reload_interval: 10m
419+
send_timestamps: true
420+
metric_expiration: 180m
421+
enable_open_metrics: false
422+
resource_to_telemetry_conversion:
423+
enabled: false
424+
otlp:
425+
endpoint: stackgres-collector:4317
426+
tls:
427+
ca_file: "/etc/operator/certs/tls.crt"
428+
service:
429+
pipelines:
430+
metrics:
431+
receivers:
432+
- prometheus
433+
exporters:
434+
- prometheus
435+
prometheusOperator:
436+
allowDiscovery: true
388437
properties:
389438
name:
390439
type: string
@@ -526,20 +575,9 @@ spec:
526575
type: object
527576
x-kubernetes-preserve-unknown-fields: true
528577
description: Section to configure OpenTelemetry Collector Service specs. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#servicespec-v1-core
529-
default:
530-
type: ClusterIP
531-
ports:
532-
- name: prom-http
533-
protocol: TCP
534-
port: 9464
535-
targetPort: prom-http
536578
ports:
537579
type: array
538580
description: Section to configure OpenTelemetry Collector ports. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#containerport-v1-core
539-
default:
540-
- name: prom-http
541-
protocol: TCP
542-
containerPort: 9464
543581
items:
544582
type: object
545583
x-kubernetes-preserve-unknown-fields: true
@@ -559,41 +597,6 @@ spec:
559597
type: object
560598
x-kubernetes-preserve-unknown-fields: true
561599
description: Section to configure OpenTelemetry Collector Configuration. See https://opentelemetry.io/docs/collector/configuration
562-
default:
563-
config:
564-
receivers:
565-
otlp:
566-
protocols:
567-
grpc:
568-
endpoint: "0.0.0.0:4317"
569-
tls:
570-
ca_file: "/etc/operator/certs/tls.crt"
571-
cert_file: "/etc/operator/certs/tls.crt"
572-
key_file: "/etc/operator/certs/tls.key"
573-
exporters:
574-
prometheus:
575-
endpoint: "0.0.0.0:9464"
576-
tls:
577-
ca_file: "/etc/operator/certs/tls.crt"
578-
cert_file: "/etc/operator/certs/tls.crt"
579-
key_file: "/etc/operator/certs/tls.key"
580-
reload_interval: 10m
581-
send_timestamps: true
582-
metric_expiration: 180m
583-
enable_open_metrics: false
584-
resource_to_telemetry_conversion:
585-
enabled: false
586-
otlp:
587-
endpoint: stackgres-collector:4317
588-
tls:
589-
ca_file: "/etc/operator/certs/tls.crt"
590-
service:
591-
pipelines:
592-
metrics:
593-
receivers:
594-
- prometheus
595-
exporters:
596-
- prometheus
597600
prometheusOperator:
598601
type: object
599602
description: Section to configure OpenTelemetry Collector integration with Prometheus Operator.
@@ -1079,6 +1082,27 @@ spec:
10791082
description: |
10801083
If set, will use a host path volume with the specified path for the extensions cache
10811084
instead of a PersistentVolume
1085+
pga:
1086+
type: object
1087+
description: Section to configure PGA
1088+
properties:
1089+
repositoryUrls:
1090+
type: array
1091+
default:
1092+
- https://pga.sh
1093+
description: |
1094+
A list of PGA repository URLs used to retrieve images
1095+
1096+
To set a proxy for PGA repository add parameter proxyUrl to the URL:
1097+
`https://extensions.stackgres.io/postgres/repository?proxyUrl=<proxy scheme>%3A%2F%2F<proxy host>[%3A<proxy port>]` (URL encoded)
1098+
1099+
Other URL parameters are:
1100+
1101+
* `skipHostnameVerification`: set it to `true` in order to use a server or a proxy with a self signed certificate
1102+
* `retry`: set it to `<max retriex>[:<sleep before next retry>]` in order to retry a request on failure
1103+
* `setHttpScheme`: set it to `true` in order to force using HTTP scheme
1104+
items:
1105+
type: string
10821106
shardingSphere:
10831107
type: object
10841108
description: Section to configure integration with ShardingSphere operator
@@ -1149,6 +1173,12 @@ spec:
11491173
externalRestApiPort:
11501174
type: integer
11511175
description: Set the external REST API port
1176+
externalPgaIp:
1177+
type: string
1178+
description: Set the external PGA IP
1179+
externalPgaPort:
1180+
type: integer
1181+
description: Set the external PGA port
11521182
allowPullExtensionsFromImageRepository:
11531183
type: boolean
11541184
default: false

0 commit comments

Comments
 (0)