-
Notifications
You must be signed in to change notification settings - Fork 22
Some How-Tos i found helpful #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hc2p
wants to merge
2
commits into
kubermatic:master
Choose a base branch
from
hc2p:add-some-howtos
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# How to get latest backups | ||
|
||
## Set restic envs | ||
export AWS_DEFAULT_REGION="eu-central-1" | ||
export RESTIC_REPOSITORY="s3:http://127.0.0.1:9000/kubermatic-master-backups" | ||
export AWS_ACCESS_KEY_ID="<look at minio section in values.yaml>" | ||
export AWS_SECRET_ACCESS_KEY="<look at minio section in values.yaml>" | ||
export RESTIC_PASSWORD="<configured in restic-config secret of backup-restic KubeOne addon>" | ||
|
||
|
||
## Port forward minio | ||
kubectl -n minio port-forward deployment/minio 9000:9000 | ||
|
||
## Locate latest snapshot | ||
restic snapshots -r s3:http://127.0.0.1:9000/kubermatic-master-backups --verbose | ||
|
||
## Unlock repo if needed | ||
restic unlock -r s3:http://127.0.0.1:9000/kubermatic-master-backups --remove-all | ||
|
||
## Restore latest snapshot | ||
restic -r s3:http://127.0.0.1:9000/kubermatic-master-backups restore f2d639e3 --target ./kubermatic-master-backups/snapshot-f2d639e3 -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# How to migrate MinIO storage | ||
https://docs.kubermatic.com/kubermatic/v2.23/installation/upgrading/upgrade-from-2.22-to-2.23/#minio-upgrade | ||
|
||
## boot new deployment | ||
|
||
Get the deployment, svc, and pvc yaml files | ||
```bash | ||
kubectl -n minio get deployments.apps minio -o yaml > deployment.yaml | ||
kubectl -n minio get svc minio -o yaml > svc.yaml | ||
kubectl -n minio get pvc minio-data -o yaml > pvc.yaml | ||
``` | ||
Change the name of the deployment, pod spec and pvc to minio-new | ||
But don't change the namespace! | ||
|
||
apply them: | ||
```bash | ||
kubectl -n minio apply -f deployment.yaml | ||
kubectl -n minio apply -f svc.yaml | ||
kubectl -n minio apply -f pvc.yaml | ||
``` | ||
|
||
## Start debug container on cluster | ||
e.g. busybox, then install mc cli | ||
|
||
```bash | ||
kubectl run busybox --image busybox -it --rm -- sh | ||
``` | ||
|
||
```bash | ||
curl https://dl.min.io/client/mc/release/linux-amd64/mc \ | ||
--create-dirs \ | ||
-o $HOME/minio-binaries/mc | ||
|
||
chmod +x $HOME/minio-binaries/mc | ||
export PATH=$PATH:$HOME/minio-binaries/ | ||
|
||
mc --help | ||
``` | ||
|
||
## Setup alias | ||
|
||
```bash | ||
mc alias set ALIAS http://minio:9000 <access-key> <access-secret> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. se above example could also get injected via env var ... just FYI |
||
mc alias set ALIAS-NEW http://minio-new:9000 <access-key> <access-secret> | ||
``` | ||
|
||
## Transfer config according to MinIO docs | ||
|
||
```bash | ||
mc admin config export ALIAS > config.txt | ||
mc admin config import ALIAS-NEW < config.txt | ||
mc admin service restart ALIAS-NEW | ||
mc admin cluster bucket export ALIAS-NEW | ||
mc admin cluster bucket import ALIAS-NEW ALIAS-NEW-bucket-metadata.zip | ||
``` | ||
|
||
|
||
## Copy data | ||
```bash | ||
mc mirror --preserve --watch ALIAS ALIAS-NEW | ||
``` | ||
This will take a while and never stop, since it waits for new data to be copied. Cancel it with ctrl+c. | ||
|
||
Make sure that the data is copied correctly. | ||
``` | ||
mc du ALIAS | ||
mc du ALIAS-NEW | ||
``` | ||
Both needs to be the same. | ||
|
||
|
||
## Scale down both deployments | ||
```bash | ||
kubectl -n minio scale deployment minio --replicas=0 | ||
kubectl -n minio scale deployment minio-new --replicas=0 | ||
``` | ||
|
||
## delete old pvc | ||
```bash | ||
kubectl -n minio delete pvc minio-data | ||
``` | ||
|
||
## Delete old, Rename new pvc | ||
|
||
Use https://github.com/stackitcloud/rename-pvc | ||
|
||
```bash | ||
kubectl -n minio delete pvc minio-data | ||
kubectl -n minio rename-pvc minio-data-new minio-data | ||
``` | ||
|
||
## Change release of deployment | ||
```bash | ||
kubectl -n minio edit deployment minio | ||
``` | ||
|
||
## Scale up old deployment | ||
```bash | ||
kubectl -n minio scale deployment minio --replicas=1 | ||
``` | ||
|
||
## Delete new deployment | ||
```bash | ||
kubectl -n minio delete deployment minio-new | ||
kubectl -n minio delete svc minio-new | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use directly the minio image as well, I using locally ofte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, i tried it but struggled to get into a shell, which is actually more convenient to do all the steps. Would be much better than needing to install something