1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

GT-465 Fix debug mode in non TLS mode (#1391)

This commit is contained in:
jwierzbo 2023-08-25 12:28:56 +02:00 committed by GitHub
parent 8c465a8ba7
commit 344924bfc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 9 deletions

View file

@ -5,6 +5,7 @@
- (Feature) PVCResize action concurrency limit
- (Feature) Optional Assertions
- (Feature) Deprecate Actions
- (Bugfix) Debug mode
## [1.2.32](https://github.com/arangodb/kube-arangodb/tree/1.2.32) (2023-08-07)
- (Feature) Backup lifetime - remove Backup once its lifetime has been reached

View file

@ -44,7 +44,7 @@ rules:
verbs: ["list"]
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get", "ist"]
verbs: ["get", "list"]
{{- end }}
{{- if .Values.rbac.extensions.monitoring }}
- apiGroups: ["monitoring.coreos.com"]

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 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.
@ -205,10 +205,12 @@ func getDeploymentAndCredentials(ctx context.Context,
}
var secrets = kubeCli.CoreV1().Secrets(d.GetNamespace())
certCA, err = getCACertificate(ctx, secrets, d.GetAcceptedSpec().TLS.GetCASecretName())
if err != nil {
err = errors.WithMessage(err, "failed to get CA certificate")
return
if d.GetAcceptedSpec().TLS.IsSecure() {
certCA, err = getCACertificate(ctx, secrets, d.GetAcceptedSpec().TLS.GetCASecretName())
if err != nil {
err = errors.WithMessage(err, "failed to get CA certificate")
return
}
}
if d.GetAcceptedSpec().IsAuthenticated() {

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 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.
@ -42,7 +42,7 @@ func init() {
var debugPackage = &cobra.Command{
Use: "debugPackage",
Short: "[WiP] Generate debug package for debugging",
Short: "Generate debug package for debugging",
RunE: debugPackageFunc,
}
@ -63,7 +63,7 @@ func debugPackageStdOut(cmd *cobra.Command) (returnError error) {
}
func debugPackageFile(cmd *cobra.Command) (returnError error) {
out, err := os.OpenFile("./out.tar.gz", os.O_TRUNC|os.O_WRONLY|os.O_CREATE, 0644)
out, err := os.OpenFile(debugPackageInput.Output, os.O_TRUNC|os.O_WRONLY|os.O_CREATE, 0644)
if err != nil {
return err
}

View file

@ -24,3 +24,7 @@
- [Force rebuild out-synced Shards with broken Merkle Tree](./features/rebuild_out_synced_shards.md)
- [Failover Leader service](./features/failover_leader_service.md)
- [Restore defaults from last accepted state of deployment](./features/deployment_spec_defaults.md)
## Debugging
- [Collecting debug info](./debugging.md)
-

31
docs/design/debugging.md Normal file
View file

@ -0,0 +1,31 @@
# Collecting debug data
## Agency dump
To collect only agency dump, run:
```shell
kubectl exec -ti {POD_kube-arangodb-operator} -- /usr/bin/arangodb_operator admin agency dump > agency_dump.json
```
## Deployment debug package
To collect debug package, which contains things like:
- deployment pod logs
- operator pod logs
- kubernetes events
- deployment yaml files
- agency dump
Ensure you have debug mode enabled in the operator deployment:
```shell
```bash
helm upgrade --install kube-arangodb \
https://github.com/arangodb/kube-arangodb/releases/download/$VER/kube-arangodb-$VER.tgz \
--set "rbac.extensions.debug=true"
```
Then run:
```shell
kubectl exec -ti {POD_kube-arangodb-operator} -- /usr/bin/arangodb_operator debugPackage --namespace {namespace} -o - > db.tar.gz
```