Skip to content

Commit 598b6f5

Browse files
authored
[Feature] [Platform] Storage Debug (#1928)
1 parent dd01c7b commit 598b6f5

28 files changed

+462
-64
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
4+
- (Feature) (Platform) Storage Debug
45

56
## [1.2.50](https://github.com/arangodb/kube-arangodb/tree/1.2.50) (2025-07-04)
67
- (Feature) (Platform) MetaV1 Integration Service

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Flags:
204204
--kubernetes.qps float32 Number of queries per second for k8s API (default 32)
205205
--leader.label.skip Skips Leader Label for the Pod
206206
--log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty")
207-
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, generic-parent-operator, helm, http, inspector, integration-authn-v1, integration-config-v1, integration-envoy-auth-v3, integration-envoy-auth-v3-impl-auth-bearer, integration-envoy-auth-v3-impl-auth-cookie, integration-envoy-auth-v3-impl-custom-openid, integration-envoy-auth-v3-impl-pass-mode, integration-meta-v1, integration-scheduler-v2, integration-storage-v1-s3, integration-storage-v2, integrations, k8s-client, kubernetes, kubernetes-access, kubernetes-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, platform-chart-operator, platform-pod-shutdown, platform-service-operator, platform-storage-operator, pod_compare, root, root-event-recorder, scheduler-batchjob-operator, scheduler-cronjob-operator, scheduler-deployment-operator, scheduler-pod-operator, scheduler-profile-operator, server, server-authentication, webhook (default [info])
207+
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, generic-parent-operator, helm, http, inspector, integration-authn-v1, integration-config-v1, integration-envoy-auth-v3, integration-envoy-auth-v3-impl-auth-bearer, integration-envoy-auth-v3-impl-auth-cookie, integration-envoy-auth-v3-impl-custom-openid, integration-envoy-auth-v3-impl-pass-mode, integration-meta-v1, integration-scheduler-v2, integration-shutdown-v1, integration-storage-v1-s3, integration-storage-v2, integrations, k8s-client, kubernetes, kubernetes-access, kubernetes-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, platform-chart-operator, platform-pod-shutdown, platform-service-operator, platform-storage-operator, pod_compare, root, root-event-recorder, scheduler-batchjob-operator, scheduler-cronjob-operator, scheduler-deployment-operator, scheduler-pod-operator, scheduler-profile-operator, server, server-authentication, webhook (default [info])
208208
--log.sampling If true, operator will try to minimize duplication of logging events (default true)
209209
--log.stdout If true, operator will log to the stdout (default true)
210210
--memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func Command() *cobra.Command {
282282
func Execute() int {
283283
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
284284

285-
if err := cmdMain.Execute(); err != nil {
285+
if err := cmdMain.ExecuteContext(shutdown.Context()); err != nil {
286286
var v cli.CommandExitCode
287287
if errors.As(err, &v) {
288288
return v.ExitCode

cmd/cmd_ops.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
flag "github.com/spf13/pflag"
2828

2929
"github.com/arangodb/kube-arangodb/pkg/util/cli"
30+
"github.com/arangodb/kube-arangodb/pkg/util/shutdown"
3031
)
3132

3233
var (
@@ -43,7 +44,7 @@ func CommandOps() *cobra.Command {
4344
func ExecuteOps() int {
4445
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
4546

46-
if err := cmdOps.Execute(); err != nil {
47+
if err := cmdOps.ExecuteContext(shutdown.Context()); err != nil {
4748
return 1
4849
}
4950

cmd/integration/init.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
integrations "github.com/arangodb/kube-arangodb/pkg/integrations"
3030
"github.com/arangodb/kube-arangodb/pkg/util/cli"
31+
"github.com/arangodb/kube-arangodb/pkg/util/shutdown"
3132
)
3233

3334
var (
@@ -51,7 +52,7 @@ func Command() *cobra.Command {
5152
func Execute() int {
5253
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
5354

54-
if err := cmd.Execute(); err != nil {
55+
if err := cmd.ExecuteContext(shutdown.Context()); err != nil {
5556
return 1
5657
}
5758

cmd/main-platform/main_int.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/arangodb/kube-arangodb/pkg/logging"
2828
"github.com/arangodb/kube-arangodb/pkg/platform"
2929
"github.com/arangodb/kube-arangodb/pkg/util/cli"
30+
"github.com/arangodb/kube-arangodb/pkg/util/shutdown"
3031
)
3132

3233
func main() {
@@ -50,7 +51,7 @@ func mainE() error {
5051
return err
5152
}
5253

53-
if err := c.Execute(); err != nil {
54+
if err := c.ExecuteContext(shutdown.Context()); err != nil {
5455
return err
5556
}
5657

docs/cli/arangodb_operator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Flags:
8686
--kubernetes.qps float32 Number of queries per second for k8s API (default 32)
8787
--leader.label.skip Skips Leader Label for the Pod
8888
--log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty")
89-
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, generic-parent-operator, helm, http, inspector, integration-authn-v1, integration-config-v1, integration-envoy-auth-v3, integration-envoy-auth-v3-impl-auth-bearer, integration-envoy-auth-v3-impl-auth-cookie, integration-envoy-auth-v3-impl-custom-openid, integration-envoy-auth-v3-impl-pass-mode, integration-meta-v1, integration-scheduler-v2, integration-storage-v1-s3, integration-storage-v2, integrations, k8s-client, kubernetes, kubernetes-access, kubernetes-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, platform-chart-operator, platform-pod-shutdown, platform-service-operator, platform-storage-operator, pod_compare, root, root-event-recorder, scheduler-batchjob-operator, scheduler-cronjob-operator, scheduler-deployment-operator, scheduler-pod-operator, scheduler-profile-operator, server, server-authentication, webhook (default [info])
89+
--log.level stringArray Set log levels in format <level> or <logger>=<level>. Possible loggers: action, agency, api-server, assertion, backup-operator, chaos-monkey, crd, deployment, deployment-ci, deployment-reconcile, deployment-replication, deployment-resilience, deployment-resources, deployment-storage, deployment-storage-pc, deployment-storage-service, generic-parent-operator, helm, http, inspector, integration-authn-v1, integration-config-v1, integration-envoy-auth-v3, integration-envoy-auth-v3-impl-auth-bearer, integration-envoy-auth-v3-impl-auth-cookie, integration-envoy-auth-v3-impl-custom-openid, integration-envoy-auth-v3-impl-pass-mode, integration-meta-v1, integration-scheduler-v2, integration-shutdown-v1, integration-storage-v1-s3, integration-storage-v2, integrations, k8s-client, kubernetes, kubernetes-access, kubernetes-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, platform-chart-operator, platform-pod-shutdown, platform-service-operator, platform-storage-operator, pod_compare, root, root-event-recorder, scheduler-batchjob-operator, scheduler-cronjob-operator, scheduler-deployment-operator, scheduler-pod-operator, scheduler-profile-operator, server, server-authentication, webhook (default [info])
9090
--log.sampling If true, operator will try to minimize duplication of logging events (default true)
9191
--log.stdout If true, operator will log to the stdout (default true)
9292
--memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing

docs/cli/arangodb_operator_integration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Flags:
7474
--integration.scheduler.v2.internal Defines if Internal access to service scheduler.v2 is enabled (Env: INTEGRATION_SCHEDULER_V2_INTERNAL) (default true)
7575
--integration.scheduler.v2.namespace string Kubernetes Namespace (Env: INTEGRATION_SCHEDULER_V2_NAMESPACE) (default "default")
7676
--integration.shutdown.v1 ShutdownV1 Handler (Env: INTEGRATION_SHUTDOWN_V1)
77+
--integration.shutdown.v1.debug.enabled Defines if debug extension is enabled (Env: INTEGRATION_SHUTDOWN_V1_DEBUG_ENABLED)
78+
--integration.shutdown.v1.debug.path string Path of the Debug Directory (Env: INTEGRATION_SHUTDOWN_V1_DEBUG_PATH) (default "/debug")
79+
--integration.shutdown.v1.debug.timeout duration Timeout of the Debug action (Env: INTEGRATION_SHUTDOWN_V1_DEBUG_TIMEOUT) (default 1m0s)
7780
--integration.shutdown.v1.external Defines if External access to service shutdown.v1 is enabled (Env: INTEGRATION_SHUTDOWN_V1_EXTERNAL)
7881
--integration.shutdown.v1.internal Defines if Internal access to service shutdown.v1 is enabled (Env: INTEGRATION_SHUTDOWN_V1_INTERNAL) (default true)
7982
--integration.storage.v2 StorageBucket V2 Integration (Env: INTEGRATION_STORAGE_V2)

docs/integration-sidecar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Integration Sidecar is supported in a few resources managed by Operator:
1919
- ArangoSchedulerCronJob (scheduler.arangodb.com/v1beta1)
2020
- ArangoSchedulerPod (scheduler.arangodb.com/v1beta1)
2121

22+
Standard Kubernetes Resources (like Pod) are also supported with Webhook extension is enabled.
23+
2224
To enable integration sidecar for specific deployment label needs to be defined:
2325

2426
```yaml
@@ -97,6 +99,9 @@ To enable:
9799
metadata:
98100
labels:
99101
integration.profiles.arangodb.com/storage: v1
102+
103+
# Optionally, enable DebugPackage integration
104+
storage.integration.profiles.arangodb.com/debug: "enabled"
100105
```
101106
102107
#### [Storage V2](./integration/storage.v2.md)

docs/integration/shutdown.v1.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ spec:
3131
```
3232
3333
Pod will receive shutdown request on port `port1` if containers `app` and `app2` will be in non running state.
34+
35+
## Extensions
36+
37+
### DebugPackage PreShutdown Hook
38+
39+
Example:
40+
41+
```yaml
42+
metadata:
43+
labels:
44+
core.shutdown.arangodb.com/app: "wait"
45+
```

0 commit comments

Comments
 (0)