Skip to content

Commit

Permalink
Merge pull request #5697 from EnterpriseDB/pgd4k/improvements
Browse files Browse the repository at this point in the history
Pgd4k/improvements
  • Loading branch information
gvasquezvargas authored May 31, 2024
2 parents edb8a67 + 1d89112 commit b4b3901
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Assembling a deployment command'
---

For a quick installation with the aim of testing the product, see the [Quick start](/postgres_distributed_for_kubernetes/latest/quickstart/).
For a quick installation with the aim of testing the product, see the [Quick start](../quickstart/).

For more targeted testing or production purposes, this overview describes how to assemble a command to deploy
EDB Postgres Distributed for Kubernetes with the operand and proxy image versions of your choice.
Expand All @@ -11,12 +11,12 @@ EDB Postgres Distributed for Kubernetes with the operand and proxy image version

Gather the following information:

* [Repository name](/postgres_distributed_for_kubernetes/latest/private_registries/#which-repository-to-choose)
* [Your repository token](/postgres_distributed_for_kubernetes/latest/private_registries/#how-to-retrieve-the-token)
* [Operand image name](/postgres_distributed_for_kubernetes/latest/identify_images/identify_image_name/#operand-image-name)
* [Proxy image name](/postgres_distributed_for_kubernetes/latest/identify_images/identify_image_name/#proxy-image-name)
* [Repository name](private_registries/#which-repository-to-choose)
* [Your repository token](private_registries/#how-to-retrieve-the-token)
* [Operand image name](identify_image_name/#operand-image-name)
* [Proxy image name](identify_image_name/#proxy-image-name)

## Assemble your command
## Assembling your command

Replace the placeholders in `<...>` with the gathered information:

Expand All @@ -27,41 +27,96 @@ helm upgrade --dependency-update \
--create-namespace \
edb/edb-postgres-distributed-for-kubernetes \
--set edb-postgres-for-kubernetes.enabled=true \
--set image.repository=docker.enterprisedb.com/<repository_name>/pg4k-pgd \
--set edb-postgres-for-kubernetes.image.repository=docker.enterprisedb.com/<repository_name>/edb-postgres-for-kubernetes \
--set config.data.PGD_IMAGE_NAME=docker.enterprisedb.com/<repository_name>/<operand_image_name> \
--set config.data.PGD_PROXY_IMAGE_NAME=docker.enterprisedb.com/<repository_name>/<proxy_image_name>
--set image.imageCredentials.username=<repository_name> \
--set image.imageCredentials.password=<your_repository_token>
--set image.repository=docker.enterprisedb.com/<REPOSITORY_NAME>/pg4k-pgd \
--set edb-postgres-for-kubernetes.image.repository=docker.enterprisedb.com/<REPOSITORY_NAME>/edb-postgres-for-kubernetes \
--set config.data.PGD_IMAGE_NAME=docker.enterprisedb.com/<REPOSITORY_NAME>/<OPERAND_NAME> \
--set config.data.PGD_PROXY_IMAGE_NAME=docker.enterprisedb.com/<REPOSITORY_NAME>/<PGD-PROXY>
--set image.imageCredentials.username=<REPOSITORY_NAME> \
--set image.imageCredentials.password=<EDB_SUBSCRIPTION_TOKEN>
```

After assembling the command with the required images,
see [Installation](/postgres_distributed_for_kubernetes/latest/installation_upgrade/) for instructions on how to add the repository,
see [Installation](../installation_upgrade) for instructions on how to add the repository,
deploy the images, and create a certificate issuer.

## Example
For more information about how to assemble your command, see the examples:

The example command:
### Examples

* Pulls images from the `k8s_enterprise_pgd` repository.
* Uses EBD Postgres Advanced Server 15.6.2 as the Postgres option.
* Uses PGD 5.4.1 as the Postgres Distributed version.
* Uses 5.4.0 as the PGD Proxy version.
These example commands:

!!! Note Token
Before running the command, replace the token placeholder.
* Pull images from the `k8s_enterprise_pgd` repository.
* Use EBD Postgres Advanced Server 15.6.2 as the Postgres option.
* Use PGD 5.4.1 as the Postgres Distributed version.
* Use 5.4.0 as the PGD Proxy version.

```
helm upgrade --dependency-update \
--install edb-pg4k-pgd \
--namespace pgd-operator-system \
--create-namespace \
edb/edb-postgres-distributed-for-kubernetes \
--set edb-postgres-for-kubernetes.enabled=true \
--set image.repository=docker.enterprisedb.com/k8s_enterprise_pgd/pg4k-pgd \
--set edb-postgres-for-kubernetes.image.repository=docker.enterprisedb.com/k8s_enterprise_pgd/edb-postgres-for-kubernetes \
--set config.data.PGD_IMAGE_NAME=docker.enterprisedb.com/k8s_enterprise_pgd/edb-postgres-advanced-pgd:15.6.0-5.4.1-1 \
--set config.data.PGD_PROXY_IMAGE_NAME=docker.enterprisedb.com/k8s_enterprise_pgd/edb-pgd-proxy:5.4.0
--set image.imageCredentials.username=k8s_enterprise_pgd \
--set image.imageCredentials.password=<your_repository_token>
```
#### Example 1: Setting the environment variables before you run the deployment command

Set the environment variables for the deployment command:

1. Set the environment variable to pull images from the `k8s_enterprise_pgd` repository:

```
export REPOSITORY_NAME=k8s_enterprise_pgd
```

1. Set the environment variable to use [your personal token](private_registries/#how-to-retrieve-the-token):

```
export EDB_SUBSCRIPTION_TOKEN=<my_registry_token>
```

1. Set the environment variable to use EBD Postgres Advanced Server 15.6.2 as the Postgres option,
and PGD 5.4.1 as the Postgres Distributed version:

```
export OPERAND_NAME=edb-postgres-advanced-pgd:15.6.2-5.4.1-1
```

1. Set the environment variable to use 5.4.0 as the PGD Proxy version:

```
export PGD-PROXY=edb-pgd-proxy:5.4.0
```

1. Run the deployment command:

```
helm upgrade --dependency-update \
--install edb-pg4k-pgd \
--namespace pgd-operator-system \
--create-namespace \
edb/edb-postgres-distributed-for-kubernetes \
--set edb-postgres-for-kubernetes.enabled=true \
--set image.repository=docker.enterprisedb.com/${REPOSITORY_NAME}/pg4k-pgd \
--set edb-postgres-for-kubernetes.image.repository=docker.enterprisedb.com/${REPOSITORY_NAME}/edb-postgres-for-kubernetes \
--set config.data.PGD_IMAGE_NAME=docker.enterprisedb.com/${REPOSITORY_NAME}/${OPERAND_NAME} \
--set config.data.PGD_PROXY_IMAGE_NAME=docker.enterprisedb.com/${REPOSITORY_NAME}/${PGD-PROXY}
--set image.imageCredentials.username=${REPOSITORY_NAME} \
--set image.imageCredentials.password=${EDB_SUBSCRIPTION_TOKEN}
```

#### Example 2: Replacing the placeholders manually

1. Set the environment variable to use [your personal token](private_registries/#how-to-retrieve-the-token):

```
export EDB_SUBSCRIPTION_TOKEN=<my_registry_token>
```

1. Insert the repository, image and proxy names into the command:

```
helm upgrade --dependency-update \
--install edb-pg4k-pgd \
--namespace pgd-operator-system \
--create-namespace \
edb/edb-postgres-distributed-for-kubernetes \
--set edb-postgres-for-kubernetes.enabled=true \
--set image.repository=docker.enterprisedb.com/k8s_enterprise_pgd/pg4k-pgd \
--set edb-postgres-for-kubernetes.image.repository=docker.enterprisedb.com/k8s_enterprise_pgd/edb-postgres-for-kubernetes \
--set config.data.PGD_IMAGE_NAME=docker.enterprisedb.com/k8s_enterprise_pgd/edb-postgres-advanced-pgd:15.6.2-5.4.1-1 \
--set config.data.PGD_PROXY_IMAGE_NAME=docker.enterprisedb.com/k8s_enterprise_pgd/edb-pgd-proxy:5.4.0
--set image.imageCredentials.username=k8s_enterprise_pgd \
--set image.imageCredentials.password=${EDB_SUBSCRIPTION_TOKEN}
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: 'Identifying image names'
---

For a quick installation with the aim of testing the product, see the [Quick start](/postgres_distributed_for_kubernetes/latest/quickstart/).
For a quick installation with the aim of testing the product, see the [Quick start](../quickstart/).
For more targeted testing or production purposes,
this overview describes how to select a specific operand and proxy image version that's appropriate for your Postgres distribution.

## Operand image name

See [Operand images](/postgres_distributed_for_kubernetes/latest/private_registries/#operand-images) for general information about the images.
See [Operand images](private_registries/#operand-images) for general information about the images.

### Name elements

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
title: 'Installation images and repositories'
navigation:
- private_registries
- identify_image_name
- assemble_command
---

If you plan on deploying a specific version of Postgres Distributed or a specific Postgres distribution or version, you will need to select the appropriate images and image versions.
Before [installing EDB Postgres Distributed for Kubernetes](/postgres_distributed_for_kubernetes/latest/installation_upgrade):
Before [installing EDB Postgres Distributed for Kubernetes](../installation_upgrade):

1. Identify your repository name and retrieve your user token as explained in [EDB private image registries](../private_registries).
1. Identify your repository name and retrieve your user token as explained in [EDB private image registries](private_registries).
1. [Identify the image names for your environment](identify_image_name).
1. [Assemble your deployment command](assemble_command).
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'EDB private image registries'
title: "EDB's private image registries"
originalFilePath: 'src/private_registries.md'
---

Expand Down Expand Up @@ -103,4 +103,4 @@ The table shows the image name prefix for each Postgres distribution.

!!! Note Image naming
For more information on operand image naming and proxy image naming,
see [Identify your image name](identify_images/identify_image_name/).
see [Identify your image name](identify_image_name/).
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ helm repo add edb \
https://enterprisedb.github.io/edb-postgres-for-kubernetes-charts/
```

## Set the environment variables

Set the environment variables for the `REPOSITORY_NAME` and `REPOSITORY_NAME`:

1. Set `REPOSITORY_NAME` to the name of the repository. In this example, the images come from the `k8s_enterprise_pgd` repository:

```
export REPOSITORY_NAME=k8s_enterprise_pgd
```

1. Set `EDB_SUBSCRIPTION_TOKEN` to use your personal token:

```
export EDB_SUBSCRIPTION_TOKEN=<my_registry_token>
```

## Deploy the images

!!! Important
Expand All @@ -56,17 +72,10 @@ helm upgrade --dependency-update \
--namespace pgd-operator-system \
--create-namespace \
edb/edb-postgres-distributed-for-kubernetes \
--set image.imageCredentials.username=<repository_name> \
--set image.imageCredentials.password=<your_repository_token>
--set image.imageCredentials.username=${REPOSITORY_NAME} \
--set image.imageCredentials.password=${EDB_SUBSCRIPTION_TOKEN}
```

In particular:

- Set `<repository_name>` to the name of the repository, as explained in [Which repository to
choose?](private_registries.md#which-repository-to-choose).
- Set `<your_repository_token>` to the repository token for your EDB account, as explained in
[How to retrieve the token](private_registries.md#how-to-retrieve-the-token).

## Create a certificate issuer

Be sure to create a cert issuer before you start deploying PGD clusters.
Expand Down

1 comment on commit b4b3901

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.