이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 8. Backup and disaster recovery


This section describes aspects of the CodeReady Workspaces backup and disaster recovery.

8.1. External database setup

The PostgreSQL database is used by the CodeReady Workspaces server for persisting data about the state of CodeReady Workspaces. It contains information about user accounts, workspaces, preferences, and other details.

By default, the CodeReady Workspaces Operator creates and manages the database deployment.

However, the CodeReady Workspaces Operator does not support full life-cycle capabilities, such as backups and recovery.

For a business-critical setup, configure an external database with the following recommended disaster-recovery options:

  • High Availability (HA)
  • Point In Time Recovery (PITR)

Configure an external PostgreSQL instance on-premises or use a cloud service, such as Amazon Relational Database Service (Amazon RDS). With Amazon RDS, it is possible to deploy production databases in a Multi-Availability Zone configuration for a resilient disaster recovery strategy with daily and on-demand snapshots.

The recommended configuration of the example database is:

Expand
ParameterValue

Instance class

db.t2.small

vCPU

1

RAM

2 GB

Multi-az

true, 2 replicas

Engine version

9.6.11

TLS

enabled

Automated backups

enabled (30 days)

8.1.1. Configuring external PostgreSQL

Procedure

  1. Use the following SQL script to create user and database for the CodeReady Workspaces server to persist workspaces metadata etc:

    CREATE USER <database-user> WITH PASSWORD '<database-password>' 
    1
     
    2
    
    CREATE DATABASE <database>                                      
    3
    
    GRANT ALL PRIVILEGES ON DATABASE <database> TO <database-user>
    ALTER USER <database-user> WITH SUPERUSER
    Copy to Clipboard Toggle word wrap
    1
    CodeReady Workspaces server database username
    2
    CodeReady Workspaces server database password
    3
    CodeReady Workspaces server database name
  2. Use the following SQL script to create database for RH-SSO back end to persist user information:

    CREATE USER keycloak WITH PASSWORD '<identity-database-password>' 
    1
    
    CREATE DATABASE keycloak
    GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak
    Copy to Clipboard Toggle word wrap
    1
    RH-SSO database password

8.1.2. Configuring CodeReady Workspaces to work with an external PostgreSQL

Prerequisites

  • The oc tool is available.

Procedure

  1. Pre-create a project for CodeReady Workspaces:

    $ oc create namespace openshift-workspaces
    Copy to Clipboard Toggle word wrap
  2. Create a secret to store CodeReady Workspaces server database credentials:

    $ oc create secret generic <server-database-credentials> \ 
    1
    
    --from-literal=user=<database-user> \                            
    2
    
    --from-literal=password=<database-password> \                    
    3
    
    -n openshift-workspaces
    Copy to Clipboard Toggle word wrap
    1
    Secret name to store CodeReady Workspaces server database credentials
    2
    CodeReady Workspaces server database username
    3
    CodeReady Workspaces server database password
  3. Create a secret to store RH-SSO database credentials:

    $ oc create secret generic <identity-database-credentials> \ 
    1
    
    --from-literal=password=<identity-database-password> \             
    2
    
    -n openshift-workspaces
    Copy to Clipboard Toggle word wrap
    1
    Secret name to store RH-SSO database credentials
    2
    RH-SSO database password
  4. Deploy Red Hat CodeReady Workspaces by executing the crwctl command with applying a patch. For example:

    $ crwctl server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
    Copy to Clipboard Toggle word wrap

patch.yaml should contain the following to make the Operator skip deploying a database and pass connection details of an existing database to a CodeReady Workspaces server:

spec:
  database:
    externalDb: true
    chePostgresHostName: <hostname>                     
1

    chePostgresPort: <port>                             
2

    chePostgresSecret: <server-database-credentials>    
3

    chePostgresDb: <database>                           
4

spec:
  auth:
    identityProviderPostgresSecret: <identity-database-credentials> 
5
Copy to Clipboard Toggle word wrap
1
External database hostname
2
External database port
3
Secret name with CodeReady Workspaces server database credentials
4
CodeReady Workspaces server database name
5
Secret name with RH-SSO database credentials

Additional resources

8.2. Persistent Volumes backups

Persistent Volumes (PVs) store the CodeReady Workspaces workspace data similarly to how workspace data is stored for desktop IDEs on the local hard disk drive.

To prevent data loss, back up PVs periodically. The recommended approach is to use storage-agnostic tools for backing up and restoring OpenShift resources, including PVs.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat