Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitabe0263

Browse files
authored
Feedback
Replacing default namespace 'codefresh' by environment variable to make it easier to copy/paste commandsReplace -Fc option for pg_ restore for -Fc
1 parenta6237ac commitabe0263

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

‎_docs/administration/codefresh-on-prem-upgrade.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,13 @@ From version **1.4.0 and higher**, we have deprecated support for the `Codefresh
477477

478478
Obtain the PostgresSQL administrator password:
479479
```shell
480-
export PGPASSWORD=$(kubectl get secret --namespace codefresh cf-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode)
480+
NAMESPACE=codefresh
481+
export PGPASSWORD=$(kubectl get secret --namespace $NAMESPACE cf-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode)
481482
```
482483

483484
Forward the PostgreSQL service port and place the process in the background:
484485
```shell
485-
kubectl port-forward --namespacecodefresh svc/cf-postgresql 5432:5432 &
486+
kubectl port-forward --namespace$NAMESPACE svc/cf-postgresql 5432:5432 &
486487
```
487488

488489
Create a directory for the backup files and make it the current working directory:
@@ -503,18 +504,18 @@ Here, the *--net* parameter lets the Docker container use the host's network sta
503504

504505
Create an environment variable with the password for the new stateful set:
505506
```shell
506-
export PGPASSWORD=$(kubectl get secret --namespacecodefresh cf-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode)
507+
export PGPASSWORD=$(kubectl get secret --namespace$NAMESPACE cf-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode)
507508
```
508509

509510
Forward the PostgreSQL service port for the new stateful set and place the process in the background:
510511
```shell
511-
kubectl port-forward --namespacecodefresh svc/cf-postgresql 5432:5432
512+
kubectl port-forward --namespace$NAMESPACE svc/cf-postgresql 5432:5432
512513
```
513514

514515
Restore the contents of the backup into the new release using the *pg_restore* tool. If this tool is not available on your system, mount the directory containing the backup files as a volume in Bitnami's PostgreSQL Docker container and use the *pg_restore* client tool in the container image to import the backup into the new cluster, as shown below:
515516
```shell
516517
cd psqlbackup
517-
docker run --rm --name postgresql-backup -e PGPASSWORD=$PGPASSWORD -v $(pwd):/app --net="host" bitnami/postgresql:13 pg_restore --Fc --create --dbname postgres -h host.docker.internal -p 5432 /app/audit.dump
518+
docker run --rm --name postgresql-backup -e PGPASSWORD=$PGPASSWORD -v $(pwd):/app --net="host" bitnami/postgresql:13 pg_restore -Fc --create --dbname postgres -h host.docker.internal -p 5432 /app/audit.dump
518519
```
519520

520521
##### Backup and restore via Helm hooks
@@ -553,12 +554,13 @@ From version **1.4.0 and higher**, we have deprecated support for the `Codefresh
553554

554555
Obtain the MongoDB administrator password:
555556
```shell
556-
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace codefresh cf-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
557+
NAMESPACE=codefresh
558+
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace $NAMESPACE cf-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
557559
```
558560

559561
Forward the MongoDB service port and place the process in the background:
560562
```shell
561-
kubectl port-forward --namespacecodefresh svc/mongodb 27017:27017 &
563+
kubectl port-forward --namespace$NAMESPACE svc/mongodb 27017:27017 &
562564
```
563565

564566
Create a directory for the backup files and make it the current working directory:
@@ -579,14 +581,14 @@ Here, the *--net* parameter lets the Docker container use the host's network sta
579581

580582
Create an environment variable with the password for the new stateful set:
581583
```shell
582-
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespacecodefresh cf-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
584+
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace$NAMESPACE cf-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
583585
```
584586

585587
Forward the MongoDB service port for the new stateful set and place the process in the background:
586588

587589
(**Note!** Default service address was changed)
588590
```shell
589-
kubectl port-forward --namespacecodefresh svc/cf-mongodb 27017:27017 &
591+
kubectl port-forward --namespace$NAMESPACE svc/mongodb 27017:27017 &
590592
```
591593

592594
Restore the contents of the backup into the new release using the *mongorestore* tool. If this tool is not available on your system, mount the directory containing the backup files as a volume in Bitnami's MongoDB Docker container and use the *mongorestore* client tool in the container image to import the backup into the new cluster, as shown below:
@@ -599,7 +601,7 @@ Stop the service port forwarding by terminating the background process.
599601

600602
Connect to the new stateful set and confirm that your data has been successfully restored:
601603
```shell
602-
kubectl run --namespacecodefresh mongodb-new-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mongodb:4.2 --command -- mongo codefresh --host cf-mongodb --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD --eval "db.accounts.find()"
604+
kubectl run --namespace$NAMESPACE mongodb-new-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mongodb:4.2 --command -- mongo codefresh --host cf-mongodb --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD --eval "db.accounts.find()"
603605
```
604606

605607
##### Backup and restore via Helm hooks

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp