stashed / project

Enhancements & Issues
7 stars 2 forks source link

Stash debugging helper #18

Open hossainemruz opened 3 years ago

hossainemruz commented 3 years ago

We can have some command in stash kubectl plugin that will help us for debugging. For example,

# For backup
kubectl stash debug backup --backupconfig=<backupconfig name> -n <namespace>
kubectl stash debug backup --backupsession=<backupsession name> -n <namespace>

# For restore
kubectl stash debug restore --restoresession=<restoresession name> -n <namespace>

The debug command will intelligently perform the action we often need to do for debugging for example, checking log, describing respective pod/backupconfig/backupsession etc.

It will also check for some common mistakes for example, new line in the secret, missing storage secret, check for network policy etc.

hossainemruz commented 3 years ago

Viewing Log

If we want to see log of a backup/restore pod, we can just issue,

# For backup
kubectl stash log --backupsession=<backupsession name> -n <namespace>

# For restore
kubectl stash log --restoresession=<restoresession name> -n <namespace>
hossainemruz commented 3 years ago

Fixing Secret

If the storage secret has newline in it, we can have some fix command.

kubectl stash fix secret --name=<secret name> -n <namespace>
hossainemruz commented 3 years ago

Checking Database Connection

If we want to check whether the information provided in AppBinding is sufficient to connect with the database, we can use:

kubectl stash ping --appbinding=<appbinding>