Skip to content

Commit ea28c0e

Browse files
committed
review updates
1 parent 38eeca6 commit ea28c0e

17 files changed

+188
-66
lines changed

.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
CONSOLE_IMAGE=quay.io/securesign/rhtas-console@sha256:75966d60ed709af33efd48c53b96ea7b2fcd4608f90ccc56885bf224e34b55f5
22
CONSOLE_UI_IMAGE=quay.io/securesign/rhtas-console-ui@sha256:c0b0b2d76548c05efadb2425baf93609cf6c40180f170cb531fbb7689a91db31
3-
CONSOLE_DB_IMAGE=mariadb:lts-ubi
4-
3+
CONSOLE_DB_IMAGE=registry.redhat.io/rhel9/mariadb-105@sha256:050dd5a7a32395b73b8680570e967e55050b152727412fdd73a25d8816e62d53

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,77 @@ Make sure the `ubi.repo` file has all repositories enabled `enabled = 1` and the
9292

9393
```
9494
rpm-lockfile-prototype --image $BASE_IMAGE rpms.in.yaml
95-
```
95+
```
96+
97+
## Deployment
98+
99+
The `deployment/` directory contains Kubernetes manifests organized into a `base/` directory and an `overlays/dev/` directory for deploying the RHTAS Console (UI, backend, and database) using [Kustomize](https://kustomize.io/). The `base/` directory includes:
100+
101+
- `console-backend-deploy.yaml`: Deployment configuration for the console backend.
102+
- `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.
105+
- `console-db-secret.yaml`: Secrets for database credentials.
106+
- `console-db-service.yaml`: Service definition for the database.
107+
- `console-serviceaccounts.yaml`: Service accounts for the console components.
108+
- `console-ui-deploy.yaml`: Deployment configuration for the console UI.
109+
- `console-ui-route.yaml`: Route configuration for the UI.
110+
- `console-ui-service.yaml`: Service definition for the UI.
111+
- `kustomization.yaml`: Kustomize configuration to orchestrate the deployment.
112+
113+
The `overlays/dev/` directory contains a `kustomization.yaml` for environment-specific customizations.
114+
115+
### Prerequisites
116+
117+
- A running OpenShift cluster.
118+
- `oc` CLI installed.
119+
- A running RHTAS instance to retrieve the TUF route URL.
120+
121+
### Deployment Steps
122+
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:
126+
127+
```bash
128+
oc get route tuf -o jsonpath='https://{.spec.host}{"\n"}'
129+
```
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+
135+
```bash
136+
export $(grep -v '^#' .env | xargs)
137+
```
138+
139+
3. **Apply the Deployment**:
140+
141+
Ensure that an RHTAS instance is properly deployed and running in the `trusted-artifact-signer` namespace.
142+
143+
Deploy the console using Kustomize with environment variable substitution:
144+
145+
```bash
146+
oc kustomize deployment/overlays/dev | envsubst '${CONSOLE_IMAGE} ${CONSOLE_UI_IMAGE} ${CONSOLE_DB_IMAGE}' | oc apply -f -
147+
```
148+
149+
4. **Verify the Deployment**:
150+
151+
Check the status of the deployed resources:
152+
153+
```bash
154+
oc get pods,services,routes -n trusted-artifact-signer
155+
```
156+
157+
You can access the console via a browser using the UI route:
158+
```bash
159+
oc get route console-ui -o jsonpath='https://{.spec.host}{"\n"}'
160+
```
161+
162+
5. **Deletion**:
163+
164+
To delete the deployed resources:
165+
166+
```bash
167+
oc kustomize deployment/overlays/dev | envsubst '${CONSOLE_IMAGE} ${CONSOLE_UI_IMAGE} ${CONSOLE_DB_IMAGE}' | oc delete -f -
168+
```

deployment/console-backend-deploy.yaml renamed to deployment/base/console-backend-deploy.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,32 @@ kind: Deployment
33
metadata:
44
name: console-backend
55
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
69
app.kubernetes.io/component: console-backend
7-
app.kubernetes.io/name: console-backend
810
spec:
911
replicas: 1
1012
selector:
1113
matchLabels:
12-
app.kubernetes.io/name: console-backend
14+
app.kubernetes.io/name: securesign-sample
15+
app.kubernetes.io/instance: securesign-sample
16+
app.kubernetes.io/part-of: trusted-artifact-signer
17+
app.kubernetes.io/component: console-backend
1318
strategy:
1419
type: Recreate
1520
template:
1621
metadata:
1722
labels:
18-
app.kubernetes.io/name: console-backend
23+
app.kubernetes.io/name: securesign-sample
24+
app.kubernetes.io/instance: securesign-sample
25+
app.kubernetes.io/part-of: trusted-artifact-signer
26+
app.kubernetes.io/component: console-backend
1927
spec:
2028
serviceAccountName: console-backend
2129
initContainers:
2230
- name: wait-for-console-db
23-
image: registry.redhat.io/rhel9/mariadb-105@sha256:050dd5a7a32395b73b8680570e967e55050b152727412fdd73a25d8816e62d53
31+
image: ${CONSOLE_DB_IMAGE}
2432
command:
2533
- /bin/sh
2634
- -c
@@ -31,7 +39,7 @@ spec:
3139
done
3240
containers:
3341
- name: console-backend
34-
image: quay.io/securesign/rhtas-console@sha256:75966d60ed709af33efd48c53b96ea7b2fcd4608f90ccc56885bf224e34b55f5
42+
image: ${CONSOLE_IMAGE}
3543
imagePullPolicy: IfNotPresent
3644
env:
3745
- name: TUF_REPO_URL
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: console-backend
5+
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
9+
app.kubernetes.io/component: console-backend
10+
spec:
11+
type: ClusterIP
12+
selector:
13+
app.kubernetes.io/name: securesign-sample
14+
app.kubernetes.io/instance: securesign-sample
15+
app.kubernetes.io/part-of: trusted-artifact-signer
16+
app.kubernetes.io/component: console-backend
17+
ports:
18+
- name: http
19+
port: 8080
20+
targetPort: http

deployment/console-db-deploy.yaml renamed to deployment/base/console-db-deploy.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,32 @@ kind: Deployment
33
metadata:
44
name: console-db
55
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
69
app.kubernetes.io/component: console-db
7-
app.kubernetes.io/name: console-db
810
spec:
911
replicas: 1
1012
selector:
1113
matchLabels:
12-
app.kubernetes.io/name: console-db
14+
app.kubernetes.io/name: securesign-sample
15+
app.kubernetes.io/instance: securesign-sample
16+
app.kubernetes.io/part-of: trusted-artifact-signer
17+
app.kubernetes.io/component: console-db
1318
strategy:
1419
type: Recreate
1520
template:
1621
metadata:
1722
labels:
18-
app.kubernetes.io/name: console-db
23+
app.kubernetes.io/name: securesign-sample
24+
app.kubernetes.io/instance: securesign-sample
25+
app.kubernetes.io/part-of: trusted-artifact-signer
26+
app.kubernetes.io/component: console-db
1927
spec:
2028
serviceAccountName: console-db
2129
containers:
2230
- name: console-db
23-
image: registry.redhat.io/rhel9/mariadb-105@sha256:050dd5a7a32395b73b8680570e967e55050b152727412fdd73a25d8816e62d53
31+
image: ${CONSOLE_DB_IMAGE}
2432
imagePullPolicy: IfNotPresent
2533
command: ["run-mysqld"]
2634
env:

deployment/console-db-pvc.yaml renamed to deployment/base/console-db-pvc.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ kind: PersistentVolumeClaim
33
metadata:
44
name: console-mysql
55
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
69
app.kubernetes.io/component: console-db
7-
app.kubernetes.io/name: console-db
810
spec:
911
accessModes:
1012
- ReadWriteOnce

deployment/console-db-secret.yaml renamed to deployment/base/console-db-secret.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ kind: Secret
33
metadata:
44
name: console-db-connection
55
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
69
app.kubernetes.io/component: console-db
7-
app.kubernetes.io/name: console-db
810
type: Opaque
911
stringData:
1012
mysql-user: mysql
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: console-db
5+
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
9+
app.kubernetes.io/component: console-db
10+
spec:
11+
type: ClusterIP
12+
selector:
13+
app.kubernetes.io/name: securesign-sample
14+
app.kubernetes.io/instance: securesign-sample
15+
app.kubernetes.io/part-of: trusted-artifact-signer
16+
app.kubernetes.io/component: console-db
17+
ports:
18+
- name: mysql
19+
port: 3306
20+
targetPort: mysql

deployment/console-ui-deploy.yaml renamed to deployment/base/console-ui-deploy.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,30 @@ kind: Deployment
33
metadata:
44
name: console-ui
55
labels:
6+
app.kubernetes.io/name: securesign-sample
7+
app.kubernetes.io/instance: securesign-sample
8+
app.kubernetes.io/part-of: trusted-artifact-signer
69
app.kubernetes.io/component: console-ui
7-
app.kubernetes.io/name: console-ui
810
spec:
911
replicas: 1
1012
selector:
1113
matchLabels:
12-
app.kubernetes.io/name: console-ui
14+
app.kubernetes.io/name: securesign-sample
15+
app.kubernetes.io/instance: securesign-sample
16+
app.kubernetes.io/part-of: trusted-artifact-signer
17+
app.kubernetes.io/component: console-ui
1318
template:
1419
metadata:
1520
labels:
16-
app.kubernetes.io/name: console-ui
21+
app.kubernetes.io/name: securesign-sample
22+
app.kubernetes.io/instance: securesign-sample
23+
app.kubernetes.io/part-of: trusted-artifact-signer
24+
app.kubernetes.io/component: console-ui
1725
spec:
1826
serviceAccountName: console-ui
1927
initContainers:
2028
- name: wait-for-backend
21-
image: quay.io/securesign/rhtas-console-ui@sha256:c0b0b2d76548c05efadb2425baf93609cf6c40180f170cb531fbb7689a91db31
29+
image: ${CONSOLE_UI_IMAGE}
2230
command:
2331
- /bin/sh
2432
- -c
@@ -36,7 +44,7 @@ spec:
3644
done
3745
containers:
3846
- name: console-ui
39-
image: quay.io/securesign/rhtas-console-ui@sha256:c0b0b2d76548c05efadb2425baf93609cf6c40180f170cb531fbb7689a91db31
47+
image: ${CONSOLE_UI_IMAGE}
4048
imagePullPolicy: IfNotPresent
4149
env:
4250
- name: CONSOLE_API_URL

0 commit comments

Comments
 (0)