diff --git a/.golangci.yaml b/.golangci.yaml index a95470b9b..5850830be 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -103,6 +103,10 @@ linters-settings: alias: pbConfigV1 - pkg: github.com/arangodb/kube-arangodb/integrations/config/v1 alias: pbImplConfigV1 + - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1/definition + alias: pbPongV1 + - pkg: github.com/arangodb/kube-arangodb/integrations/pong/v1 + alias: pbImplPongV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1/definition alias: pbSharedV1 - pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 50c394fb6..f684fd5d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - (Feature) ConfigV1 Integration Service - (Feature) Integration Service Authentication - (Improvement) Better panic handling +- (Feature) PongV1 Integration Service ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/Makefile b/Makefile index b576c01ec..b09a3e097 100644 --- a/Makefile +++ b/Makefile @@ -917,6 +917,6 @@ sync-charts: sync: sync-charts ci-check: - @$(MAKE) tidy vendor update-generated synchronize-v2alpha1-with-v1 generate-internal sync fmt yamlfmt license + @$(MAKE) tidy vendor generate update-generated synchronize-v2alpha1-with-v1 sync fmt yamlfmt license @git checkout -- go.sum # ignore changes in go.sum @if [ ! -z "$(git status --porcelain)" ]; then echo "There are uncommited changes!"; git status; exit 1; fi \ No newline at end of file diff --git a/README.md b/README.md index f22305d20..863f667b5 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,7 @@ Flags: --kubernetes.max-batch-size int Size of batch during objects read (default 256) --kubernetes.qps float32 Number of queries per second for k8s API (default 15) --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") - --log.level stringArray Set log levels in format or =. 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, http, inspector, integration-config-v1, integrations, k8s-client, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.level stringArray Set log levels in format or =. 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, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) --log.sampling If true, operator will try to minimize duplication of logging events (default true) --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes diff --git a/cmd/cmd_ops.go b/cmd/cmd_ops.go index e0ffa4ca1..1654ef61e 100644 --- a/cmd/cmd_ops.go +++ b/cmd/cmd_ops.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,11 +29,15 @@ import ( var ( cmdOps = cobra.Command{ - Use: "arangodb_ops", + Use: "arangodb_operator_ops", Run: executeUsage, } ) +func CommandOps() *cobra.Command { + return &cmdOps +} + func ExecuteOps() int { flag.CommandLine.AddGoFlagSet(goflag.CommandLine) diff --git a/cmd/integration/init.go b/cmd/integration/init.go new file mode 100644 index 000000000..a5203b3cc --- /dev/null +++ b/cmd/integration/init.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package integration + +import ( + goflag "flag" + + "github.com/spf13/cobra" + flag "github.com/spf13/pflag" + + "github.com/arangodb/kube-arangodb/pkg/integrations" +) + +var ( + cmd = cobra.Command{ + Use: "arangodb_operator_integration", + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Usage() + }, + } +) + +func init() { + if err := integrations.Register(&cmd); err != nil { + panic(err.Error()) + } + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) +} + +func Command() *cobra.Command { + return &cmd +} + +func Execute() int { + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) + + if err := cmd.Execute(); err != nil { + return 1 + } + + return 0 +} diff --git a/cmd/main-int/main_int.go b/cmd/main-int/main_int.go index 9dd27a376..78970bc96 100644 --- a/cmd/main-int/main_int.go +++ b/cmd/main-int/main_int.go @@ -21,40 +21,11 @@ package main import ( - goflag "flag" "os" - "github.com/spf13/cobra" - flag "github.com/spf13/pflag" - - "github.com/arangodb/kube-arangodb/pkg/integrations" + "github.com/arangodb/kube-arangodb/cmd/integration" ) -var ( - cmd = cobra.Command{ - Use: "arangodb_int", - RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Usage() - }, - } -) - -func init() { - if err := integrations.Register(&cmd); err != nil { - panic(err.Error()) - } -} - -func Execute() int { - flag.CommandLine.AddGoFlagSet(goflag.CommandLine) - - if err := cmd.Execute(); err != nil { - return 1 - } - - return 0 -} - func main() { - os.Exit(Execute()) + os.Exit(integration.Execute()) } diff --git a/docs/api/ArangoDeployment.V1.md b/docs/api/ArangoDeployment.V1.md index 8bbbf460d..06cb455a8 100644 --- a/docs/api/ArangoDeployment.V1.md +++ b/docs/api/ArangoDeployment.V1.md @@ -3043,9 +3043,15 @@ Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1. *** +### .spec.gateway.enabled + +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L24) + +*** + ### .spec.gateways.affinity -Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) +Type: `core.PodAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L156) Affinity specified additional affinity settings in ArangoDB Pod definitions @@ -3056,7 +3062,7 @@ Links: ### .spec.gateways.allowMemberRecreation -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L227) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L198) AllowMemberRecreation allows to recreate member. This setting changes the member recreation logic based on group: @@ -3067,7 +3073,7 @@ This setting changes the member recreation logic based on group: ### .spec.gateways.annotations -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L128) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L99) Annotations specified the annotations added to Pods in this group. Annotations are merged with `spec.annotations`. @@ -3076,7 +3082,7 @@ Annotations are merged with `spec.annotations`. ### .spec.gateways.annotationsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L101) AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored @@ -3084,7 +3090,7 @@ AnnotationsIgnoreList list regexp or plain definitions which annotations should ### .spec.gateways.annotationsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L132) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L103) AnnotationsMode Define annotations mode which should be use while overriding annotations @@ -3092,7 +3098,7 @@ AnnotationsMode Define annotations mode which should be use while overriding ann ### .spec.gateways.antiAffinity -Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) +Type: `core.PodAntiAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L152) AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions @@ -3103,7 +3109,7 @@ Links: ### .spec.gateways.args -Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L86) +Type: `[]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L57) Args setting specifies additional command-line arguments passed to all servers of this group. @@ -3113,7 +3119,7 @@ Default Value: `[]` ### .spec.gateways.count -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L78) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L49) Count setting specifies the number of servers to start for the given group. For the Agent group, this value must be a positive, odd number. @@ -3126,7 +3132,7 @@ as for the `dbservers` group. ### .spec.gateways.entrypoint -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L88) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L59) Entrypoint overrides container executable @@ -3168,7 +3174,7 @@ Links: ### .spec.gateways.exporterPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L240) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L211) ExporterPort define Port used by exporter @@ -3176,7 +3182,7 @@ ExporterPort define Port used by exporter ### .spec.gateways.extendedRotationCheck -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L210) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L181) ExtendedRotationCheck extend checks for rotation @@ -3184,7 +3190,7 @@ ExtendedRotationCheck extend checks for rotation ### .spec.gateways.externalPortEnabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L222) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L193) ExternalPortEnabled if external port should be enabled. If is set to false, ports needs to be exposed via sidecar. Only for ArangoD members @@ -3192,7 +3198,7 @@ ExternalPortEnabled if external port should be enabled. If is set to false, port ### .spec.gateways.indexMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L233) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L204) IndexMethod define group Indexing method @@ -3223,7 +3229,7 @@ Mode keep container replace mode ### .spec.gateways.internalPort -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L218) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) InternalPort define port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3231,7 +3237,7 @@ InternalPort define port used in internal communication, can be accessed over lo ### .spec.gateways.internalPortProtocol -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L220) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L191) InternalPortProtocol define protocol of port used in internal communication, can be accessed over localhost via sidecar. Only for ArangoD members @@ -3239,7 +3245,7 @@ InternalPortProtocol define protocol of port used in internal communication, can ### .spec.gateways.labels -Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L134) +Type: `object` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L105) Labels specified the labels added to Pods in this group. @@ -3247,7 +3253,7 @@ Labels specified the labels added to Pods in this group. ### .spec.gateways.labelsIgnoreList -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L136) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L107) LabelsIgnoreList list regexp or plain definitions which labels should be ignored @@ -3255,7 +3261,7 @@ LabelsIgnoreList list regexp or plain definitions which labels should be ignored ### .spec.gateways.labelsMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L138) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L109) LabelsMode Define labels mode which should be use while overriding labels @@ -3263,7 +3269,7 @@ LabelsMode Define labels mode which should be use while overriding labels ### .spec.gateways.maxCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L82) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L53) MaxCount specifies a maximum for the count of servers. If set, a specification is invalid if `count > maxCount`. @@ -3271,7 +3277,7 @@ MaxCount specifies a maximum for the count of servers. If set, a specification i ### .spec.gateways.memoryReservation -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L110) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L81) MemoryReservation determines the system reservation of memory while calculating `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` value. If this field is set, `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` is reduced by a specified value in percent. @@ -3286,7 +3292,7 @@ Default Value: `0` ### .spec.gateways.minCount -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L80) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L51) MinCount specifies a minimum for the count of servers. If set, a specification is invalid if `count < minCount`. @@ -3294,7 +3300,7 @@ MinCount specifies a minimum for the count of servers. If set, a specification i ### .spec.gateways.nodeAffinity -Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L189) +Type: `core.NodeAffinity` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L160) NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions @@ -3305,7 +3311,7 @@ Links: ### .spec.gateways.nodeSelector -Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L153) +Type: `map[string]string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L124) NodeSelector setting specifies a set of labels to be used as `nodeSelector` for Pods of this node. @@ -3346,7 +3352,7 @@ Default Value: `/usr/bin/numactl` ### .spec.gateways.overrideDetectedNumberOfCores -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L116) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L87) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` Container Environment Variable** @@ -3363,7 +3369,7 @@ Default Value: `true` ### .spec.gateways.overrideDetectedTotalMemory -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L104) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L75) > [!IMPORTANT] > **Values set by this feature override user-provided `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` Container Environment Variable** @@ -3392,7 +3398,7 @@ Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2 ### .spec.gateways.port -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L238) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L209) Port define Port used by member @@ -3400,7 +3406,7 @@ Port define Port used by member ### .spec.gateways.priorityClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L159) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L130) PriorityClassName specifies a priority class name Will be forwarded to the pod spec. @@ -3412,7 +3418,7 @@ Links: ### .spec.gateways.probes.livenessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L250) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L27) LivenessProbeDisabled if set to true, the operator does not generate a liveness probe for new pods belonging to this group @@ -3422,7 +3428,7 @@ Default Value: `false` ### .spec.gateways.probes.livenessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3434,7 +3440,7 @@ Default Value: `3` ### .spec.gateways.probes.livenessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3445,7 +3451,7 @@ Default Value: `2` ### .spec.gateways.probes.livenessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3456,7 +3462,7 @@ Default Value: `10` ### .spec.gateways.probes.livenessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3467,7 +3473,7 @@ Default Value: `1` ### .spec.gateways.probes.livenessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3478,7 +3484,7 @@ Default Value: `2` ### .spec.gateways.probes.ReadinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L257) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L34) > [!WARNING] > ***DEPRECATED*** @@ -3491,7 +3497,7 @@ OldReadinessProbeDisabled if true readinessProbes are disabled ### .spec.gateways.probes.readinessProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L259) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L36) ReadinessProbeDisabled override flag for probe disabled in good manner (lowercase) with backward compatibility @@ -3499,7 +3505,7 @@ ReadinessProbeDisabled override flag for probe disabled in good manner (lowercas ### .spec.gateways.probes.readinessProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3511,7 +3517,7 @@ Default Value: `3` ### .spec.gateways.probes.readinessProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3522,7 +3528,7 @@ Default Value: `2` ### .spec.gateways.probes.readinessProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3533,7 +3539,7 @@ Default Value: `10` ### .spec.gateways.probes.readinessProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3544,7 +3550,7 @@ Default Value: `1` ### .spec.gateways.probes.readinessProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3555,7 +3561,7 @@ Default Value: `2` ### .spec.gateways.probes.startupProbeDisabled -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L264) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L41) StartupProbeDisabled if true startupProbes are disabled @@ -3563,7 +3569,7 @@ StartupProbeDisabled if true startupProbes are disabled ### .spec.gateways.probes.startupProbeSpec.failureThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L300) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L77) FailureThreshold when a Pod starts and the probe fails, Kubernetes will try failureThreshold times before giving up. Giving up means restarting the container. @@ -3575,7 +3581,7 @@ Default Value: `3` ### .spec.gateways.probes.startupProbeSpec.initialDelaySeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L283) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L60) InitialDelaySeconds specifies number of seconds after the container has started before liveness or readiness probes are initiated. Minimum value is 0. @@ -3586,7 +3592,7 @@ Default Value: `2` ### .spec.gateways.probes.startupProbeSpec.periodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L287) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L64) PeriodSeconds How often (in seconds) to perform the probe. Minimum value is 1. @@ -3597,7 +3603,7 @@ Default Value: `10` ### .spec.gateways.probes.startupProbeSpec.successThreshold -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L295) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L72) SuccessThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Minimum value is 1. @@ -3608,7 +3614,7 @@ Default Value: `1` ### .spec.gateways.probes.startupProbeSpec.timeoutSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L291) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec_probe.go#L68) TimeoutSeconds specifies number of seconds after which the probe times out Minimum value is 1. @@ -3619,7 +3625,7 @@ Default Value: `2` ### .spec.gateways.pvcResizeMode -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L173) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L144) VolumeResizeMode specified resize mode for PVCs and PVs @@ -3631,7 +3637,7 @@ Possible Values: ### .spec.gateways.resources -Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L98) +Type: `core.ResourceRequirements` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L69) Resources holds resource requests & limits @@ -3642,7 +3648,7 @@ Links: ### .spec.gateways.schedulerName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L90) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L61) SchedulerName define scheduler name used for group @@ -3780,7 +3786,7 @@ sysctls: ### .spec.gateways.serviceAccountName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L149) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L120) ServiceAccountName setting specifies the `serviceAccountName` for the `Pods` created for each server of this group. If empty, it defaults to using the @@ -3795,7 +3801,7 @@ to that service account. ### .spec.gateways.shutdownDelay -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L216) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L187) ShutdownDelay define how long operator should delay finalizer removal after shutdown @@ -3803,7 +3809,7 @@ ShutdownDelay define how long operator should delay finalizer removal after shut ### .spec.gateways.shutdownMethod -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L214) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L185) ShutdownMethod describe procedure of member shutdown taken by Operator @@ -3811,7 +3817,7 @@ ShutdownMethod describe procedure of member shutdown taken by Operator ### .spec.gateways.sidecarCoreNames -Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L192) +Type: `array` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L163) SidecarCoreNames is a list of sidecar containers which must run in the pod. Some names (e.g.: "server", "worker") are reserved, and they don't have any impact. @@ -3820,7 +3826,7 @@ Some names (e.g.: "server", "worker") are reserved, and they don't have any impa ### .spec.gateways.sidecars -Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L196) +Type: `[]core.Container` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L167) Sidecars specifies a list of additional containers to be started @@ -3831,7 +3837,7 @@ Links: ### .spec.gateways.storageClassName -Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L94) +Type: `string` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L65) > [!WARNING] > ***DEPRECATED*** @@ -3844,7 +3850,7 @@ StorageClassName specifies the classname for storage of the servers. ### .spec.gateways.terminationGracePeriodSeconds -Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L229) +Type: `integer` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L200) TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for pods - via silent rotation @@ -3852,7 +3858,7 @@ TerminationGracePeriodSeconds override default TerminationGracePeriodSeconds for ### .spec.gateways.tolerations -Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L125) +Type: `[]core.Toleration` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L96) Tolerations specifies the tolerations added to Pods in this group. By default, suitable tolerations are set for the following keys with the `NoExecute` effect: @@ -3868,7 +3874,7 @@ Links: ### .spec.gateways.volumeAllowShrink -Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) +Type: `boolean` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L148) > [!WARNING] > ***DEPRECATED*** @@ -3881,7 +3887,7 @@ VolumeAllowShrink allows shrinking of the volume ### .spec.gateways.volumeClaimTemplate -Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L168) +Type: `core.PersistentVolumeClaim` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L139) VolumeClaimTemplate specifies a volumeClaimTemplate used by operator to create to volume claims for pods of this group. This setting is not available for group `coordinators`, `syncmasters` & `syncworkers`. @@ -3897,7 +3903,7 @@ Links: ### .spec.gateways.volumeMounts -Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L206) +Type: `[]ServerGroupSpecVolumeMount` [\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/server_group_spec.go#L177) VolumeMounts define list of volume mounts mounted into server container diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 000000000..8b6a37cab --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,6 @@ +--- +layout: page +has_children: true +title: Binaries +has_toc: false +--- \ No newline at end of file diff --git a/docs/cli/arangodb_operator.md b/docs/cli/arangodb_operator.md new file mode 100644 index 000000000..e9629d728 --- /dev/null +++ b/docs/cli/arangodb_operator.md @@ -0,0 +1,122 @@ +--- +layout: page +parent: Binaries +title: arangodb_operator +--- + +# ArangoDB Operator Command + +[START_INJECT]: # (arangodb_operator_cmd) +``` +Usage: + arangodb_operator [flags] + arangodb_operator [command] + +Available Commands: + admin Administration operations + completion Generate the autocompletion script for the specified shell + crd CRD operations + debug-package Generate debug package for debugging + exporter + features Describe all operator features + help Help about any command + integration + storage + task + version + +Flags: + --action.PVCResize.concurrency int Define limit of concurrent PVC Resizes on the cluster (default 32) + --agency.refresh-delay duration The Agency refresh delay (0 = no delay) (default 500ms) + --agency.refresh-interval duration The Agency refresh interval (0 = do not refresh) + --agency.retries int The Agency retries (0 = no retries) (default 1) + --api.enabled Enable operator HTTP and gRPC API (default true) + --api.grpc-port int gRPC API port to listen on (default 8728) + --api.http-port int HTTP API port to listen on (default 8628) + --api.jwt-key-secret-name string Name of secret containing key used to sign JWT. If there is no such secret present, value will be saved here (default "arangodb-operator-api-jwt-key") + --api.jwt-secret-name string Name of secret which will contain JWT to authenticate API requests. (default "arangodb-operator-api-jwt") + --api.tls-secret-name string Name of secret containing tls.crt & tls.key for HTTPS API (if empty, self-signed certificate is used) + --backup-concurrent-uploads int Number of concurrent uploads per deployment (default 4) + --chaos.allowed Set to allow chaos in deployments. Only activated when allowed and enabled in deployment + --crd.install Install missing CRD if access is possible (default true) + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. To apply for all, use crd-name 'all'. + --crd.validation-schema stringArray Overrides default set of CRDs which should have validation schema enabled =. To apply for all, use crd-name 'all'. + --deployment.feature.agency-poll Enable Agency Poll for Enterprise deployments - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.all Enable ALL Features + --deployment.feature.async-backup-creation Create backups asynchronously to avoid blocking the operator and reaching the timeout - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.backup-cleanup Cleanup imported backups if required - Required ArangoDB 3.8.0 or higher + --deployment.feature.deployment-spec-defaults-restore Restore defaults from last accepted state of deployment - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.enforced-resign-leadership Enforce ResignLeadership and ensure that Leaders are moved from restarted DBServer - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.ephemeral-volumes Enables ephemeral volumes for apps and tmp directory - Required ArangoDB 3.8.0 or higher + --deployment.feature.failover-leadership Support for leadership in fail-over mode - Required ArangoDB 3.8.0 or higher + --deployment.feature.init-containers-copy-resources Copy resources spec to built-in init containers if they are not specified - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.init-containers-upscale-resources Copy resources spec to built-in init containers if they are not specified or lower - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.local-storage.pass-reclaim-policy [LocalStorage] Pass ReclaimPolicy from StorageClass instead of using hardcoded Retain - Required ArangoDB 3.8.0 or higher + --deployment.feature.local-volume-replacement-check Replace volume for local-storage if volume is unschedulable (ex. node is gone) - Required ArangoDB 3.8.0 or higher + --deployment.feature.random-pod-names Enables generating random pod names - Required ArangoDB 3.8.0 or higher + --deployment.feature.rebalancer-v2 Rebalancer V2 feature - Required ArangoDB 3.10.0 or higher + --deployment.feature.restart-policy-always Allow to restart containers with always restart policy - Required ArangoDB 3.8.0 or higher + --deployment.feature.secured-containers Create server's containers with non root privileges. It enables 'ephemeral-volumes' feature implicitly - Required ArangoDB 3.8.0 or higher + --deployment.feature.sensitive-information-protection Hide sensitive information from metrics and logs - Required ArangoDB 3.8.0 or higher + --deployment.feature.short-pod-names Enable Short Pod Names - Required ArangoDB 3.8.0 or higher + --deployment.feature.timezone-management Enable timezone management for pods - Required ArangoDB 3.8.0 or higher + --deployment.feature.tls-sni TLS SNI Support - Required ArangoDB EE 3.8.0 or higher (default true) + --deployment.feature.upgrade-version-check Enable initContainer with pre version check - Required ArangoDB 3.8.0 or higher (default true) + --deployment.feature.upgrade-version-check-v2 Enable initContainer with pre version check based by Operator - Required ArangoDB 3.8.0 or higher + --features-config-map-name string Name of the Feature Map ConfigMap (default "arangodb-operator-feature-config-map") + -h, --help help for arangodb_operator + --http1.keep-alive If false, disables HTTP keep-alives and will only use the connection to the server for a single HTTP request (default true) + --http1.transport.dial-timeout duration Maximum amount of time a dial will wait for a connect to complete (default 30s) + --http1.transport.idle-conn-timeout duration Maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit (default 1m30s) + --http1.transport.idle-conn-timeout-short duration Maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit (default 100ms) + --http1.transport.keep-alive-timeout duration Interval between keep-alive probes for an active network connection (default 1m30s) + --http1.transport.keep-alive-timeout-short duration Interval between keep-alive probes for an active network connection (default 100ms) + --http1.transport.max-idle-conns int Maximum number of idle (keep-alive) connections across all hosts. Zero means no limit (default 100) + --http1.transport.tls-handshake-timeout duration Maximum amount of time to wait for a TLS handshake. Zero means no timeout (default 10s) + --image.discovery.status Discover Operator Image from Pod Status by default. When disabled Pod Spec is used. (default true) + --image.discovery.timeout duration Timeout for image discovery process (default 1m0s) + --internal.scaling-integration Enable Scaling Integration + --kubernetes.burst int Burst for the k8s API (default 30) + --kubernetes.max-batch-size int Size of batch during objects read (default 256) + --kubernetes.qps float32 Number of queries per second for k8s API (default 15) + --log.format string Set log format. Allowed values: 'pretty', 'JSON'. If empty, default format is used (default "pretty") + --log.level stringArray Set log levels in format or =. 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, http, inspector, integration-config-v1, integrations, k8s-client, kubernetes-informer, monitor, networking-route-operator, operator, operator-arangojob-handler, operator-v2, operator-v2-event, operator-v2-worker, panics, pod_compare, root, root-event-recorder, server, server-authentication (default [info]) + --log.sampling If true, operator will try to minimize duplication of logging events (default true) + --memory-limit uint Define memory limit for hard shutdown and the dump of goroutines. Used for testing + --metrics.excluded-prefixes stringArray List of the excluded metrics prefixes + --mode.single Enable single mode in Operator. WARNING: There should be only one replica of Operator, otherwise Operator can take unexpected actions + --operator.analytics Enable to run the Analytics operator + --operator.apps Enable to run the ArangoApps operator + --operator.backup Enable to run the ArangoBackup operator + --operator.deployment Enable to run the ArangoDeployment operator + --operator.deployment-replication Enable to run the ArangoDeploymentReplication operator + --operator.ml Enable to run the ArangoML operator + --operator.networking Enable to run the Networking operator + --operator.reconciliation.retry.count int Count of retries during Object Update operations in the Reconciliation loop (default 25) + --operator.reconciliation.retry.delay duration Delay between Object Update operations in the Reconciliation loop (default 1s) + --operator.storage Enable to run the ArangoLocalStorage operator + --operator.version Enable only version endpoint in Operator + --reconciliation.delay duration Delay between reconciliation loops (<= 0 -> Disabled) + --scope string Define scope on which Operator works. Legacy - pre 1.1.0 scope with limited cluster access (default "legacy") + --server.admin-secret-name string Name of secret containing username + password for login to the dashboard (default "arangodb-operator-dashboard") + --server.allow-anonymous-access Allow anonymous access to the dashboard + --server.host string Host to listen on (default "0.0.0.0") + --server.port int Port to listen on (default 8528) + --server.tls-secret-name string Name of secret containing tls.crt & tls.key for HTTPS server (if empty, self-signed certificate is used) + --shutdown.delay duration The delay before running shutdown handlers (default 2s) + --shutdown.timeout duration Timeout for shutdown handlers (default 30s) + --timeout.agency duration The Agency read timeout (default 10s) + --timeout.arangod duration The request timeout to the ArangoDB (default 5s) + --timeout.arangod-check duration The version check request timeout to the ArangoDB (default 2s) + --timeout.backup-arangod duration The request timeout to the ArangoDB during backup calls (default 30s) + --timeout.backup-upload duration The request timeout to the ArangoDB during uploading files (default 5m0s) + --timeout.force-delete-pod-grace-period duration Default period when ArangoDB Pod should be forcefully removed after all containers were stopped - set to 0 to disable forceful removals (default 15m0s) + --timeout.k8s duration The request timeout to the kubernetes (default 2s) + --timeout.pod-scheduling-grace-period duration Default period when ArangoDB Pod should be deleted in case of scheduling info change - set to 0 to disable (default 15s) + --timeout.reconciliation duration The reconciliation timeout to the ArangoDB CR (default 1m0s) + --timeout.shard-rebuild duration Timeout after which particular out-synced shard is considered as failed and rebuild is triggered (default 1h0m0s) + --timeout.shard-rebuild-retry duration Timeout after which rebuild shards retry flow is triggered (default 4h0m0s) + +Use "arangodb_operator [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_cmd) diff --git a/docs/cli/arangodb_operator_integration.md b/docs/cli/arangodb_operator_integration.md new file mode 100644 index 000000000..d97513f28 --- /dev/null +++ b/docs/cli/arangodb_operator_integration.md @@ -0,0 +1,101 @@ +--- +layout: page +parent: Binaries +title: arangodb_operator_integration +--- + +# ArangoDB Operator Integration Command + +[START_INJECT]: # (arangodb_operator_integration_cmd) +``` +Usage: + arangodb_operator_integration [flags] + arangodb_operator_integration [command] + +Available Commands: + client + completion Generate the autocompletion script for the specified shell + help Help about any command + +Flags: + --health.address string Address to expose health service (default "0.0.0.0:9091") + --health.auth.token string Token for health service (when auth service is token) + --health.auth.type string Auth type for health service (default "None") + --health.shutdown.enabled Determines if shutdown service should be enabled and exposed (default true) + -h, --help help for arangodb_operator_integration + --integration.authentication.v1 Enable AuthenticationV1 Integration Service + --integration.authentication.v1.enabled Defines if Authentication is enabled (default true) + --integration.authentication.v1.external Defones if External access to service authentication.v1 is enabled + --integration.authentication.v1.internal Defones if Internal access to service authentication.v1 is enabled (default true) + --integration.authentication.v1.path string Path to the JWT Folder + --integration.authentication.v1.token.allowed strings Allowed users for the Token + --integration.authentication.v1.token.max-size uint16 Max Token max size in bytes (default 64) + --integration.authentication.v1.token.ttl.default duration Default Token TTL (default 1h0m0s) + --integration.authentication.v1.token.ttl.max duration Max Token TTL (default 1h0m0s) + --integration.authentication.v1.token.ttl.min duration Min Token TTL (default 1m0s) + --integration.authentication.v1.token.user string Default user of the Token (default "root") + --integration.authentication.v1.ttl duration TTL of the JWT cache (default 15s) + --integration.authorization.v0 Enable AuthorizationV0 Integration Service + --integration.authorization.v0.external Defones if External access to service authorization.v0 is enabled + --integration.authorization.v0.internal Defones if Internal access to service authorization.v0 is enabled (default true) + --integration.config.v1 Enable ConfigV1 Integration Service + --integration.config.v1.external Defones if External access to service config.v1 is enabled + --integration.config.v1.internal Defones if Internal access to service config.v1 is enabled (default true) + --integration.config.v1.module strings Module in the reference = + --integration.envoy.auth.v3 Enable EnvoyAuthV3 Integration Service + --integration.envoy.auth.v3.external Defones if External access to service envoy.auth.v3 is enabled + --integration.envoy.auth.v3.internal Defones if Internal access to service envoy.auth.v3 is enabled (default true) + --integration.scheduler.v1 SchedulerV1 Integration + --integration.scheduler.v1.external Defones if External access to service scheduler.v1 is enabled + --integration.scheduler.v1.internal Defones if Internal access to service scheduler.v1 is enabled (default true) + --integration.scheduler.v1.namespace string Kubernetes Namespace (default "default") + --integration.scheduler.v1.verify-access Verify the CRD Access (default true) + --integration.shutdown.v1 ShutdownV1 Handler + --integration.shutdown.v1.external Defones if External access to service shutdown.v1 is enabled + --integration.shutdown.v1.internal Defones if Internal access to service shutdown.v1 is enabled (default true) + --integration.storage.v1 StorageBucket Integration + --integration.storage.v1.external Defones if External access to service storage.v1 is enabled + --integration.storage.v1.internal Defones if Internal access to service storage.v1 is enabled (default true) + --integration.storage.v1.s3.access-key string Path to file containing S3 AccessKey + --integration.storage.v1.s3.allow-insecure If set to true, the Endpoint certificates won't be checked + --integration.storage.v1.s3.bucket string Bucket name + --integration.storage.v1.s3.ca-crt string Path to file containing CA certificate to validate endpoint connection + --integration.storage.v1.s3.ca-key string Path to file containing keyfile to validate endpoint connection + --integration.storage.v1.s3.disable-ssl If set to true, the SSL won't be used when connecting to Endpoint + --integration.storage.v1.s3.endpoint string Endpoint of S3 API implementation + --integration.storage.v1.s3.region string Region + --integration.storage.v1.s3.secret-key string Path to file containing S3 SecretKey + --integration.storage.v1.type string Type of the Storage Integration (default "s3") + --services.address string Address to expose internal services (default "127.0.0.1:9092") + --services.auth.token string Token for internal service (when auth service is token) + --services.auth.type string Auth type for internal service (default "None") + --services.enabled Defines if internal access is enabled (default true) + --services.external.address string Address to expose external services (default "0.0.0.0:9093") + --services.external.auth.token string Token for external service (when auth service is token) + --services.external.auth.type string Auth type for external service (default "None") + --services.external.enabled Defines if external access is enabled + +Use "arangodb_operator_integration [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_integration_cmd) + +# ArangoDB Operator Integration Client Subcommand + +[START_INJECT]: # (arangodb_operator_integration_cmd_client) +``` +Usage: + arangodb_operator_integration client [command] + +Available Commands: + health + pong + shutdown + +Flags: + --address string GRPC Service Address (default "127.0.0.1:8080") + -h, --help help for client + --token string GRPC Token + +Use "arangodb_operator_integration client [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_integration_cmd_client) diff --git a/docs/cli/arangodb_operator_ops.md b/docs/cli/arangodb_operator_ops.md new file mode 100644 index 000000000..95041fc8e --- /dev/null +++ b/docs/cli/arangodb_operator_ops.md @@ -0,0 +1,88 @@ +--- +layout: page +parent: Binaries +title: arangodb_operator_ops +--- + +# ArangoDB Operator Ops Command + +[START_INJECT]: # (arangodb_operator_ops_cmd) +``` +Usage: + arangodb_operator_ops [flags] + arangodb_operator_ops [command] + +Available Commands: + completion Generate the autocompletion script for the specified shell + crd CRD operations + help Help about any command + task + +Flags: + -h, --help help for arangodb_operator_ops + +Use "arangodb_operator_ops [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd) + +# ArangoDB Operator Ops CRD Subcommand + +[START_INJECT]: # (arangodb_operator_ops_cmd_crd) +``` +CRD operations + +Usage: + arangodb_operator_ops crd [flags] + arangodb_operator_ops crd [command] + +Available Commands: + generate Generates YAML of all required CRDs + install Install and update all required CRDs + +Flags: + --crd.force-update Enforce CRD Schema update + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. + --crd.validation-schema stringArray Controls which CRD should have validation schema =. + -h, --help help for crd + +Use "arangodb_operator_ops crd [command] --help" for more information about a command. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd_crd) + +# ArangoDB Operator Ops CRD Install Subcommand + +[START_INJECT]: # (arangodb_operator_ops_cmd_crd_install) +``` +Install and update all required CRDs + +Usage: + arangodb_operator_ops crd install [flags] + +Flags: + -h, --help help for install + +Global Flags: + --crd.force-update Enforce CRD Schema update + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. + --crd.validation-schema stringArray Controls which CRD should have validation schema =. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd_crd_install) + +# ArangoDB Operator Ops CRD Generate Subcommand + +[START_INJECT]: # (arangodb_operator_ops_cmd_crd_generate) +``` +Generates YAML of all required CRDs + +Usage: + arangodb_operator_ops crd generate [flags] + +Flags: + -h, --help help for generate + +Global Flags: + --crd.force-update Enforce CRD Schema update + --crd.preserve-unknown-fields stringArray Controls which CRD should have enabled preserve unknown fields in validation schema =. + --crd.validation-schema stringArray Controls which CRD should have validation schema =. +``` +[END_INJECT]: # (arangodb_operator_ops_cmd_crd_generate) diff --git a/integrations/pong/v1/definition/consts.go b/integrations/pong/v1/definition/consts.go new file mode 100644 index 000000000..6e6df329d --- /dev/null +++ b/integrations/pong/v1/definition/consts.go @@ -0,0 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package definition + +const ( + Name = "pong.v1" +) diff --git a/integrations/pong/v1/definition/pong.pb.go b/integrations/pong/v1/definition/pong.pb.go new file mode 100644 index 000000000..2466d3c5a --- /dev/null +++ b/integrations/pong/v1/definition/pong.pb.go @@ -0,0 +1,186 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.1 +// source: integrations/pong/v1/definition/pong.proto + +package definition + +import ( + definition "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PongV1 Ping Call Response +type PongV1PingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Current time in UTC + Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *PongV1PingResponse) Reset() { + *x = PongV1PingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_integrations_pong_v1_definition_pong_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PongV1PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PongV1PingResponse) ProtoMessage() {} + +func (x *PongV1PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_integrations_pong_v1_definition_pong_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PongV1PingResponse.ProtoReflect.Descriptor instead. +func (*PongV1PingResponse) Descriptor() ([]byte, []int) { + return file_integrations_pong_v1_definition_pong_proto_rawDescGZIP(), []int{0} +} + +func (x *PongV1PingResponse) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +var File_integrations_pong_v1_definition_pong_proto protoreflect.FileDescriptor + +var file_integrations_pong_v1_definition_pong_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, + 0x6f, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x70, 0x6f, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x70, 0x6f, + 0x6e, 0x67, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x44, 0x0a, 0x12, 0x50, 0x6f, 0x6e, 0x67, 0x56, 0x31, 0x50, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x39, 0x0a, 0x06, 0x50, 0x6f, 0x6e, 0x67, + 0x56, 0x31, 0x12, 0x2f, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x70, 0x6f, 0x6e, 0x67, + 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x56, 0x31, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2d, + 0x61, 0x72, 0x61, 0x6e, 0x67, 0x6f, 0x64, 0x62, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x6f, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_integrations_pong_v1_definition_pong_proto_rawDescOnce sync.Once + file_integrations_pong_v1_definition_pong_proto_rawDescData = file_integrations_pong_v1_definition_pong_proto_rawDesc +) + +func file_integrations_pong_v1_definition_pong_proto_rawDescGZIP() []byte { + file_integrations_pong_v1_definition_pong_proto_rawDescOnce.Do(func() { + file_integrations_pong_v1_definition_pong_proto_rawDescData = protoimpl.X.CompressGZIP(file_integrations_pong_v1_definition_pong_proto_rawDescData) + }) + return file_integrations_pong_v1_definition_pong_proto_rawDescData +} + +var file_integrations_pong_v1_definition_pong_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_integrations_pong_v1_definition_pong_proto_goTypes = []interface{}{ + (*PongV1PingResponse)(nil), // 0: pong.PongV1PingResponse + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp + (*definition.Empty)(nil), // 2: shared.Empty +} +var file_integrations_pong_v1_definition_pong_proto_depIdxs = []int32{ + 1, // 0: pong.PongV1PingResponse.time:type_name -> google.protobuf.Timestamp + 2, // 1: pong.PongV1.Ping:input_type -> shared.Empty + 0, // 2: pong.PongV1.Ping:output_type -> pong.PongV1PingResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_integrations_pong_v1_definition_pong_proto_init() } +func file_integrations_pong_v1_definition_pong_proto_init() { + if File_integrations_pong_v1_definition_pong_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_integrations_pong_v1_definition_pong_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PongV1PingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_integrations_pong_v1_definition_pong_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_integrations_pong_v1_definition_pong_proto_goTypes, + DependencyIndexes: file_integrations_pong_v1_definition_pong_proto_depIdxs, + MessageInfos: file_integrations_pong_v1_definition_pong_proto_msgTypes, + }.Build() + File_integrations_pong_v1_definition_pong_proto = out.File + file_integrations_pong_v1_definition_pong_proto_rawDesc = nil + file_integrations_pong_v1_definition_pong_proto_goTypes = nil + file_integrations_pong_v1_definition_pong_proto_depIdxs = nil +} diff --git a/integrations/pong/v1/definition/pong.proto b/integrations/pong/v1/definition/pong.proto new file mode 100644 index 000000000..ecd4505f6 --- /dev/null +++ b/integrations/pong/v1/definition/pong.proto @@ -0,0 +1,43 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +syntax = "proto3"; + +package pong; + +import "google/protobuf/timestamp.proto"; + +import "integrations/shared/v1/definition/empty.proto"; + +option go_package = "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition"; + +// PongV1 Service implementation +service PongV1 { + rpc Ping(shared.Empty) returns (PongV1PingResponse); +} + +// Responses + + +// PongV1 Ping Call Response +message PongV1PingResponse { + // Current time in UTC + google.protobuf.Timestamp time = 1; +} \ No newline at end of file diff --git a/integrations/pong/v1/definition/pong_grpc.pb.go b/integrations/pong/v1/definition/pong_grpc.pb.go new file mode 100644 index 000000000..9e3a04386 --- /dev/null +++ b/integrations/pong/v1/definition/pong_grpc.pb.go @@ -0,0 +1,106 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.1 +// source: integrations/pong/v1/definition/pong.proto + +package definition + +import ( + context "context" + definition "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PongV1Client is the client API for PongV1 service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PongV1Client interface { + Ping(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*PongV1PingResponse, error) +} + +type pongV1Client struct { + cc grpc.ClientConnInterface +} + +func NewPongV1Client(cc grpc.ClientConnInterface) PongV1Client { + return &pongV1Client{cc} +} + +func (c *pongV1Client) Ping(ctx context.Context, in *definition.Empty, opts ...grpc.CallOption) (*PongV1PingResponse, error) { + out := new(PongV1PingResponse) + err := c.cc.Invoke(ctx, "/pong.PongV1/Ping", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PongV1Server is the server API for PongV1 service. +// All implementations must embed UnimplementedPongV1Server +// for forward compatibility +type PongV1Server interface { + Ping(context.Context, *definition.Empty) (*PongV1PingResponse, error) + mustEmbedUnimplementedPongV1Server() +} + +// UnimplementedPongV1Server must be embedded to have forward compatible implementations. +type UnimplementedPongV1Server struct { +} + +func (UnimplementedPongV1Server) Ping(context.Context, *definition.Empty) (*PongV1PingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (UnimplementedPongV1Server) mustEmbedUnimplementedPongV1Server() {} + +// UnsafePongV1Server may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PongV1Server will +// result in compilation errors. +type UnsafePongV1Server interface { + mustEmbedUnimplementedPongV1Server() +} + +func RegisterPongV1Server(s grpc.ServiceRegistrar, srv PongV1Server) { + s.RegisterService(&PongV1_ServiceDesc, srv) +} + +func _PongV1_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(definition.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PongV1Server).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pong.PongV1/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PongV1Server).Ping(ctx, req.(*definition.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// PongV1_ServiceDesc is the grpc.ServiceDesc for PongV1 service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PongV1_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pong.PongV1", + HandlerType: (*PongV1Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _PongV1_Ping_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "integrations/pong/v1/definition/pong.proto", +} diff --git a/integrations/pong/v1/impl.go b/integrations/pong/v1/impl.go new file mode 100644 index 000000000..e595574b6 --- /dev/null +++ b/integrations/pong/v1/impl.go @@ -0,0 +1,60 @@ +// +// DISCLAIMER +// +// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "time" + + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/timestamppb" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + pbShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/svc" +) + +func New() svc.Handler { + return &impl{} +} + +var _ pbPongV1.PongV1Server = &impl{} +var _ svc.Handler = &impl{} + +type impl struct { + pbPongV1.UnimplementedPongV1Server +} + +func (i *impl) Name() string { + return pbShutdownV1.Name +} + +func (i *impl) Health() svc.HealthState { + return svc.Healthy +} + +func (i *impl) Register(registrar *grpc.Server) { + pbPongV1.RegisterPongV1Server(registrar, i) +} +func (i *impl) Ping(context.Context, *pbSharedV1.Empty) (*pbPongV1.PongV1PingResponse, error) { + return &pbPongV1.PongV1PingResponse{Time: timestamppb.New(time.Now().UTC())}, nil +} diff --git a/integrations/pong/v1/service_test.go b/integrations/pong/v1/service_test.go new file mode 100644 index 000000000..d696b7675 --- /dev/null +++ b/integrations/pong/v1/service_test.go @@ -0,0 +1,63 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package v1 + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/svc" + "github.com/arangodb/kube-arangodb/pkg/util/tests/tgrpc" +) + +func Client(t *testing.T, ctx context.Context) pbPongV1.PongV1Client { + local := svc.NewService(svc.Configuration{ + Address: "127.0.0.1:0", + }, New()) + + start := local.Start(ctx) + + client := tgrpc.NewGRPCClient(t, ctx, pbPongV1.NewPongV1Client, start.Address()) + + return client +} + +func Test_Ping(t *testing.T) { + ctx, c := context.WithCancel(context.Background()) + defer c() + + client := Client(t, ctx) + + r1, err := client.Ping(ctx, &pbSharedV1.Empty{}) + require.NoError(t, err) + + time.Sleep(100 * time.Millisecond) + + r2, err := client.Ping(ctx, &pbSharedV1.Empty{}) + require.NoError(t, err) + + require.True(t, r2.GetTime().AsTime().After(r1.GetTime().AsTime())) +} diff --git a/internal/md/sections.go b/internal/md/sections.go index ad46ada8a..49d2d03f7 100644 --- a/internal/md/sections.go +++ b/internal/md/sections.go @@ -81,16 +81,10 @@ func ReplaceSection(in, replace, section string) (string, error) { return "", errors.Errorf("END_INJECT sections is missing for section %s. Note that newline is required at the end and before tag", section) } - if strings.HasSuffix(replace, "\n\n") { - // if section ends with empty line, we don't need to write newline for END marker - end = strings.TrimLeft(end, "\n") - } else { - end = "\n" + end - } + in = moveString(in, endID+len(end)) b.WriteString(end) - in = moveString(in, endID+len(end)) } return b.String(), nil diff --git a/internal/readme.go b/internal/readme.go index bd7747bd5..402e91426 100644 --- a/internal/readme.go +++ b/internal/readme.go @@ -144,23 +144,16 @@ func GenerateReadme(root string) error { return nil } -func GenerateHelp(cmd *cobra.Command) (string, error) { +func GenerateHelp(cmd *cobra.Command, args ...string) (string, error) { var lines []string lines = append(lines, "```", "Flags:") - buff := bytes.NewBuffer(nil) - - cmd.SetOut(buff) - - cmd.SetArgs([]string{"--help"}) - - if err := cmd.Execute(); err != nil { + help, err := GenerateHelpRaw(cmd, args...) + if err != nil { return "", err } - help := buff.String() - for _, line := range strings.Split(help, "\n") { if strings.HasPrefix(line, " --") { lines = append(lines, line) @@ -172,6 +165,29 @@ func GenerateHelp(cmd *cobra.Command) (string, error) { return md.WrapWithNewLines(md.WrapWithNewLines(strings.Join(lines, "\n"))), nil } +func GenerateHelpQuoted(cmd *cobra.Command, args ...string) (string, error) { + h, err := GenerateHelpRaw(cmd, args...) + if err != nil { + return "", err + } + + return fmt.Sprintf("```\n%s```\n", h), nil +} + +func GenerateHelpRaw(cmd *cobra.Command, args ...string) (string, error) { + buff := bytes.NewBuffer(nil) + + cmd.SetOut(buff) + + cmd.SetArgs(append(args, "--help")) + + if err := cmd.Execute(); err != nil { + return "", err + } + + return buff.String(), nil +} + func GenerateReadmeFeatures(root, basePath string, eeOnly bool) (string, error) { feature := md.NewColumn("Feature", md.ColumnLeftAlign) introduced := md.NewColumn("Introduced", md.ColumnLeftAlign) diff --git a/internal/readme_cli.go b/internal/readme_cli.go new file mode 100644 index 000000000..3e2e61c20 --- /dev/null +++ b/internal/readme_cli.go @@ -0,0 +1,101 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package internal + +import ( + "path" + + "github.com/arangodb/kube-arangodb/cmd" + "github.com/arangodb/kube-arangodb/cmd/integration" + "github.com/arangodb/kube-arangodb/internal/md" +) + +func GenerateCLIArangoDBOperatorReadme(root string) error { + readmeSections := map[string]string{} + + if section, err := GenerateHelpQuoted(cmd.Command()); err != nil { + return err + } else { + readmeSections["arangodb_operator_cmd"] = section + } + + if err := md.ReplaceSectionsInFile(path.Join(root, "docs", "cli", "arangodb_operator.md"), readmeSections); err != nil { + return err + } + + return nil +} + +func GenerateCLIArangoDBOperatorOpsReadme(root string) error { + readmeSections := map[string]string{} + + if section, err := GenerateHelpQuoted(cmd.CommandOps()); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd"] = section + } + + if section, err := GenerateHelpQuoted(cmd.CommandOps(), "crd"); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd_crd"] = section + } + + if section, err := GenerateHelpQuoted(cmd.CommandOps(), "crd", "install"); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd_crd_install"] = section + } + + if section, err := GenerateHelpQuoted(cmd.CommandOps(), "crd", "generate"); err != nil { + return err + } else { + readmeSections["arangodb_operator_ops_cmd_crd_generate"] = section + } + + if err := md.ReplaceSectionsInFile(path.Join(root, "docs", "cli", "arangodb_operator_ops.md"), readmeSections); err != nil { + return err + } + + return nil +} + +func GenerateCLIArangoDBOperatorIntegrationReadme(root string) error { + readmeSections := map[string]string{} + + if section, err := GenerateHelpQuoted(integration.Command()); err != nil { + return err + } else { + readmeSections["arangodb_operator_integration_cmd"] = section + } + + if section, err := GenerateHelpQuoted(integration.Command(), "client"); err != nil { + return err + } else { + readmeSections["arangodb_operator_integration_cmd_client"] = section + } + + if err := md.ReplaceSectionsInFile(path.Join(root, "docs", "cli", "arangodb_operator_integration.md"), readmeSections); err != nil { + return err + } + + return nil +} diff --git a/internal/readme_test.go b/internal/readme_test.go index 76f958110..a2be90f9c 100644 --- a/internal/readme_test.go +++ b/internal/readme_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,3 +32,21 @@ func Test_GenerateReadme(t *testing.T) { require.NoError(t, GenerateReadme(root)) } + +func Test_GenerateCli_ArangoDBOperator(t *testing.T) { + root := os.Getenv("ROOT") + + require.NoError(t, GenerateCLIArangoDBOperatorReadme(root)) +} + +func Test_GenerateCli_ArangoDBOperatorOps(t *testing.T) { + root := os.Getenv("ROOT") + + require.NoError(t, GenerateCLIArangoDBOperatorOpsReadme(root)) +} + +func Test_GenerateCli_ArangoDBOperatorIntegration(t *testing.T) { + root := os.Getenv("ROOT") + + require.NoError(t, GenerateCLIArangoDBOperatorIntegrationReadme(root)) +} diff --git a/pkg/integrations/clients/pong_v1.go b/pkg/integrations/clients/pong_v1.go new file mode 100644 index 000000000..239c77a69 --- /dev/null +++ b/pkg/integrations/clients/pong_v1.go @@ -0,0 +1,67 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package clients + +import ( + "github.com/spf13/cobra" + + pbPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1/definition" + pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition" + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" +) + +func init() { + registerer.MustRegister("pong/v1", func(cfg *Config) Client { + return &pongV1{ + cfg: cfg, + } + }) +} + +type pongV1 struct { + cfg *Config +} + +func (s *pongV1) Name() string { + return "pong" +} + +func (s *pongV1) Version() string { + return "v1" +} + +func (s *pongV1) Register(cmd *cobra.Command) error { + cmd.RunE = func(cmd *cobra.Command, args []string) error { + client, c, err := client(shutdown.Context(), s.cfg, pbPongV1.NewPongV1Client) + if err != nil { + return err + } + defer c.Close() + + _, err = client.Ping(shutdown.Context(), &pbSharedV1.Empty{}) + if err != nil { + return err + } + + return nil + } + return nil +} diff --git a/pkg/integrations/pong_test.go b/pkg/integrations/pong_test.go new file mode 100644 index 000000000..772188467 --- /dev/null +++ b/pkg/integrations/pong_test.go @@ -0,0 +1,62 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package integrations + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/shutdown" +) + +func Test_Pong(t *testing.T) { + c, health, internal, external := startService(t) + defer c.Require(t) + + t.Run("Pong", func(t *testing.T) { + t.Run("health", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", health), + "--token=", + "client", + "pong", + "v1")) + }) + t.Run("internal", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", internal), + "--token=", + "client", + "pong", + "v1")) + }) + t.Run("external", func(t *testing.T) { + require.NoError(t, executeSync(t, shutdown.Context(), + fmt.Sprintf("--address=127.0.0.1:%d", external), + "--token=", + "client", + "pong", + "v1")) + }) + }) +} diff --git a/pkg/integrations/register.go b/pkg/integrations/register.go index 6827ebcf9..5482126c4 100644 --- a/pkg/integrations/register.go +++ b/pkg/integrations/register.go @@ -30,6 +30,7 @@ import ( "github.com/spf13/cobra" "google.golang.org/grpc" + pbImplPongV1 "github.com/arangodb/kube-arangodb/integrations/pong/v1" pbImplShutdownV1 "github.com/arangodb/kube-arangodb/integrations/shutdown/v1" "github.com/arangodb/kube-arangodb/pkg/integrations/clients" "github.com/arangodb/kube-arangodb/pkg/util" @@ -170,7 +171,13 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance return errors.Wrapf(err, "Unable to parse external config") } - var internalHandlers, externalHandlers []svc.Handler + var internalHandlers, externalHandlers, healthHandlers []svc.Handler + + pong := pbImplPongV1.New() + + internalHandlers = append(internalHandlers, pong) + externalHandlers = append(externalHandlers, pong) + healthHandlers = append(healthHandlers, pong) for _, handler := range c.registered { if ok, err := cmd.Flags().GetBool(fmt.Sprintf("integration.%s", handler.Name())); err != nil { @@ -209,13 +216,11 @@ func (c *configuration) runWithContext(ctx context.Context, cancel context.Cance } } - var healthServices []svc.Handler - if c.health.shutdownEnabled { - healthServices = append(healthServices, pbImplShutdownV1.New(cancel)) + healthHandlers = append(healthHandlers, pbImplShutdownV1.New(cancel)) } - health := svc.NewHealthService(healthConfig, svc.Readiness, healthServices...) + health := svc.NewHealthService(healthConfig, svc.Readiness, healthHandlers...) internalHandlers = append(internalHandlers, health) externalHandlers = append(externalHandlers, health)