Skip to content

Commit ce4bfe6

Browse files
committed
review updates
1 parent 9720b0f commit ce4bfe6

File tree

5 files changed

+34
-21
lines changed

5 files changed

+34
-21
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ The `deployment/` directory contains Kubernetes manifests organized into a `base
100100

101101
- `console-backend-deploy.yaml`: Deployment configuration for the console backend.
102102
- `console-backend-service.yaml`: Service definition for the backend.
103-
- `console-db-deploy.yaml`: Deployment configuration for the console database.
104-
- `console-db-pvc.yaml`: Persistent Volume Claim for the database.
103+
- `console-db-statefulset.yaml`: StatefulSet configuration for the console database.
105104
- `console-db-secret.yaml`: Secrets for database credentials.
106105
- `console-db-service.yaml`: Service definition for the database.
107106
- `console-serviceaccounts.yaml`: Service accounts for the console components.
@@ -120,30 +119,30 @@ The `overlays/dev/` directory contains a `kustomization.yaml` for environment-sp
120119

121120
### Deployment Steps
122121

123-
1. **Update the TUF Repository URL**:
124-
125-
Before deploying, update the `TUF_REPO_URL` environment variable in `deployment/base/console-backend-deploy.yaml`. The default value is `https://tuf-repo-cdn.sigstore.dev`, but it must be replaced with the actual TUF route URL from your running RHTAS instance. To retrieve the correct URL, run:
122+
1. **Set TUF_REPO_URL using a ConfigMap**:
126123

124+
Before deploying, you need to retrieve the TUF repository URL from your running RHTAS instance. This value should be stored in a ConfigMap that the console backend can consume.
125+
126+
* Retrieve the TUF route URL from your running RHTAS instance:
127127
```bash
128128
oc get tuf -o jsonpath='{.items[0].status.url}'
129129
```
130-
Edit `deployment/base/console-backend-deploy.yaml` and replace the TUF_REPO_URL value with the output from the above command.
131-
132-
2. **Set Environment Variables**:
133-
The `.env` file contains the required image variables (`CONSOLE_IMAGE, CONSOLE_UI_IMAGE, CONSOLE_DB_IMAGE`). Load the environment variables:
134-
130+
131+
* Create a ConfigMap with the retrieved URL:
135132
```bash
136-
export $(grep -v '^#' .env | xargs)
133+
oc create configmap tuf-repo-config \
134+
--from-literal=TUF_REPO_URL=<output-from-above-command> \
135+
-n trusted-artifact-signer
137136
```
138137

139-
3. **Apply the Deployment**:
138+
2. **Apply the Deployment**:
140139

141140
Ensure that an RHTAS instance is properly deployed and running in the `trusted-artifact-signer` namespace.
142141

143-
Deploy the console using Kustomize with environment variable substitution:
142+
Deploy the console using Kustomize:
144143

145144
```bash
146-
oc kustomize deployment/overlays/dev | envsubst '${CONSOLE_IMAGE} ${CONSOLE_UI_IMAGE} ${CONSOLE_DB_IMAGE}' | oc apply -f -
145+
oc apply -k deployment/overlays/dev/
147146
```
148147

149148
4. **Verify the Deployment**:
@@ -164,5 +163,5 @@ The `overlays/dev/` directory contains a `kustomization.yaml` for environment-sp
164163
To delete the deployed resources:
165164

166165
```bash
167-
oc kustomize deployment/overlays/dev | envsubst '${CONSOLE_IMAGE} ${CONSOLE_UI_IMAGE} ${CONSOLE_DB_IMAGE}' | oc delete -f -
166+
oc delete -k deployment/overlays/dev/
168167
```

deployment/base/console-backend-deploy.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
serviceAccountName: console-backend
2929
initContainers:
3030
- name: wait-for-console-db
31-
image: ${CONSOLE_DB_IMAGE}
31+
image: default/console-db-image
3232
command:
3333
- /bin/sh
3434
- -c
@@ -39,11 +39,14 @@ spec:
3939
done
4040
containers:
4141
- name: console-backend
42-
image: ${CONSOLE_IMAGE}
42+
image: default/console-image
4343
imagePullPolicy: IfNotPresent
4444
env:
4545
- name: TUF_REPO_URL
46-
value: https://tuf-repo-cdn.sigstore.dev
46+
valueFrom:
47+
configMapKeyRef:
48+
name: tuf-repo-config
49+
key: TUF_REPO_URL
4750
- name: DB_DSN
4851
valueFrom:
4952
secretKeyRef:

deployment/base/console-db-statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
serviceAccountName: console-db
2929
containers:
3030
- name: console-db
31-
image: ${CONSOLE_DB_IMAGE}
31+
image: default/console-db-image
3232
imagePullPolicy: IfNotPresent
3333
command: ["run-mysqld"]
3434
env:

deployment/base/console-ui-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
serviceAccountName: console-ui
2727
initContainers:
2828
- name: wait-for-backend
29-
image: ${CONSOLE_UI_IMAGE}
29+
image: default/console-ui-image
3030
command:
3131
- /bin/sh
3232
- -c
@@ -44,7 +44,7 @@ spec:
4444
done
4545
containers:
4646
- name: console-ui
47-
image: ${CONSOLE_UI_IMAGE}
47+
image: default/console-ui-image
4848
imagePullPolicy: IfNotPresent
4949
env:
5050
- name: CONSOLE_API_URL

deployment/overlays/dev/kustomization.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@ kind: Kustomization
33

44
resources:
55
- ../../base
6+
7+
images:
8+
- name: default/console-image
9+
newName: quay.io/securesign/rhtas-console
10+
digest: sha256:75966d60ed709af33efd48c53b96ea7b2fcd4608f90ccc56885bf224e34b55f5
11+
- name: default/console-ui-image
12+
newName: quay.io/securesign/rhtas-console-ui
13+
digest: sha256:c0b0b2d76548c05efadb2425baf93609cf6c40180f170cb531fbb7689a91db31
14+
- name: default/console-db-image
15+
newName: registry.redhat.io/rhel9/mariadb-105
16+
digest: sha256:050dd5a7a32395b73b8680570e967e55050b152727412fdd73a25d8816e62d53

0 commit comments

Comments
 (0)