Skip to content

Commit 11aaa7d

Browse files
committed
refactor
1 parent 0c88573 commit 11aaa7d

File tree

5 files changed

+76
-251
lines changed

5 files changed

+76
-251
lines changed

platform/eks/README-ECR-REGISTRY.md

Lines changed: 7 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -48,106 +48,6 @@ aws ecr create-repository --repository-name odm-decisionserverconsole --image-sc
4848
manifest.yaml
4949
```
5050

51-
> NOTE: This example will set up an external database so the dbserver image won't be needed.
52-
53-
- Check that you can run a docker command.
54-
```bash
55-
docker ps
56-
```
57-
58-
- Load the images to your local registry.
59-
60-
```bash
61-
for name in images/*.tar.gz; do echo $name && docker image load --input $name; done
62-
```
63-
64-
For more information, refer to the [ODM knowledge center](hhttps://www.ibm.com/docs/en/odm/8.11.0?topic=production-installing-helm-release-odm).
65-
66-
#### d. Tag and push the images to the ECR registry
67-
68-
- Tag the images to the ECR registry previously created
69-
70-
```bash
71-
export REGION=<region>
72-
export AWSACCOUNTID=<AWS-AccountId>
73-
docker tag odm-decisioncenter:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.1-amd64
74-
docker tag odm-decisionserverruntime:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.1-amd64
75-
docker tag odm-decisionserverconsole:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.1-amd64
76-
docker tag odm-decisionrunner:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.1-amd64
77-
```
78-
79-
- Push the images to the ECR registry
80-
81-
```bash
82-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.0-amd64
83-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.0-amd64
84-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.0-amd64
85-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.0-amd64
86-
```
87-
88-
#### e. Create a pull secret for the ECR registry
89-
90-
```bash
91-
kubectl create secret docker-registry ecrodm --docker-server=<AWS-AccountId>.dkr.ecr.<region>.amazonaws.com --docker-username=AWS --docker-password=$(aws ecr get-login-password --region <region>)
92-
```
93-
images/odm-decisioncenter_8.11.0.1-amd64.tar.gz
94-
images/dbserver_8.11.0.1-amd64.tar.gz
95-
manifest.json
96-
manifest.yaml
97-
```
98-
99-
> NOTE: This example will set up an external database so the dbserver image won't be needed.
100-
101-
- Check that you can run a docker command.
102-
```bash
103-
docker ps
104-
```
105-
106-
- Load the images to your local registry.
107-
108-
```bash
109-
for name in images/*.tar.gz; do echo $name && docker image load --input $name; done
110-
```
111-
112-
For more information, refer to the [ODM knowledge center](hhttps://www.ibm.com/docs/en/odm/8.11.0?topic=production-installing-helm-release-odm).
113-
114-
#### d. Tag and push the images to the ECR registry
115-
116-
- Tag the images to the ECR registry previously created
117-
118-
```bash
119-
export REGION=<region>
120-
export AWSACCOUNTID=<AWS-AccountId>
121-
docker tag odm-decisioncenter:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.1-amd64
122-
docker tag odm-decisionserverruntime:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.1-amd64
123-
docker tag odm-decisionserverconsole:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.1-amd64
124-
docker tag odm-decisionrunner:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.1-amd64
125-
```
126-
127-
- Push the images to the ECR registry
128-
129-
```bash
130-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.0-amd64
131-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.0-amd64
132-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.0-amd64
133-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.0-amd64
134-
```
135-
136-
#### e. Create a pull secret for the ECR registry
137-
138-
```bash
139-
kubectl create secret docker-registry ecrodm --docker-server=<AWS-AccountId>.dkr.ecr.<region>.amazonaws.com --docker-username=AWS --docker-password=$(aws ecr get-login-password --region <region>)
140-
```
141-
images/odm-decisionserverruntime_8.11.0.1-amd64.tar.gz
142-
images/odm-decisionrunner_8.11.0.1-amd64.tar.gz
143-
images/odm-decisioncenter_8.11.0.1-amd64.tar.gz
144-
images/dbserver_8.11.0.1-amd64.tar.gz
145-
manifest.json
146-
manifest.yaml
147-
```
148-
149-
> NOTE: This example will set up an external database so the dbserver image won't be needed.
150-
15151
- Check that you can run a docker command.
15252
```bash
15353
docker ps
@@ -188,87 +88,13 @@ kubectl create secret docker-registry ecrodm --docker-server=<AWS-AccountId>.dkr
18888
```bash
18989
kubectl create secret docker-registry ecrodm --docker-server=<AWS-AccountId>.dkr.ecr.<region>.amazonaws.com --docker-username=AWS --docker-password=$(aws ecr get-login-password --region <region>)
19090
```
191-
charts/ibm-odm-prod-22.1.0.tgz
192-
images/odm-decisionserverconsole_8.11.0.1-amd64.tar.gz
193-
images/odm-decisionserverruntime_8.11.0.1-amd64.tar.gz
194-
images/odm-decisionrunner_8.11.0.1-amd64.tar.gz
195-
images/odm-decisioncenter_8.11.0.1-amd64.tar.gz
196-
images/dbserver_8.11.0.1-amd64.tar.gz
197-
manifest.json
198-
manifest.yaml
199-
```
200-
201-
> NOTE: This example will set up an external database so the dbserver image won't be needed.
202-
203-
- Check that you can run a docker command.
204-
```bash
205-
docker ps
206-
```
207-
208-
- Load the images to your local registry.
209-
210-
```bash
211-
for name in images/*.tar.gz; do echo $name && docker image load --input $name; done
212-
```
213-
214-
#### d. Tag and push the images to the ECR registry
215-
216-
- Tag the images to the ECR registry previously created
217-
218-
```bash
219-
export REGION=<region>
220-
export AWSACCOUNTID=<AWS-AccountId>
221-
docker tag odm-decisioncenter:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.1-amd64
222-
docker tag odm-decisionserverruntime:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.1-amd64
223-
docker tag odm-decisionserverconsole:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.1-amd64
224-
docker tag odm-decisionrunner:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.1-amd64
225-
```
226-
227-
- Push the images to the ECR registry
228-
229-
```bash
230-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.0-amd64
231-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.0-amd64
232-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.0-amd64
233-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.0-amd64
234-
```
235-
236-
#### e. Create a pull secret for the ECR registry
237-
238-
239-
- Load the images to your local registry.
240-
241-
```bash
242-
for name in images/*.tar.gz; do echo $name && docker image load --input $name; done
243-
```
244-
245-
For more information, refer to the [ODM knowledge center](hhttps://www.ibm.com/docs/en/odm/8.11.0?topic=production-installing-helm-release-odm).
246-
247-
#### d. Tag and push the images to the ECR registry
248-
249-
- Tag the images to the ECR registry previously created
250-
251-
```bash
252-
export REGION=<region>
253-
export AWSACCOUNTID=<AWS-AccountId>
254-
docker tag odm-decisioncenter:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.1-amd64
255-
docker tag odm-decisionserverruntime:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.1-amd64
256-
docker tag odm-decisionserverconsole:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.1-amd64
257-
docker tag odm-decisionrunner:8.11.0.1-amd64 $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.1-amd64
258-
```
259-
260-
- Push the images to the ECR registry
261-
262-
```bash
263-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisioncenter:8.11.0.0-amd64
264-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverconsole:8.11.0.0-amd64
265-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionserverruntime:8.11.0.0-amd64
266-
docker push $AWSACCOUNTID.dkr.ecr.$REGION.amazonaws.com/odm-decisionrunner:8.11.0.0-amd64
267-
```
268-
269-
#### e. Create a pull secret for the ECR registry
91+
> NOTE: `ecrodm` is the name of the secret that will be used to pull the images in EKS.
27092
93+
#### f. Install ODM with the following parameters
94+
27195
```bash
272-
kubectl create secret docker-registry ecrodm --docker-server=<AWS-AccountId>.dkr.ecr.<region>.amazonaws.com --docker-username=AWS --docker-password=$(aws ecr get-login-password --region <region>)
96+
helm install mycompany charts/ibm-odm-prod-22.1.0.tgz \
97+
--set image.pullSecrets=ecrodm \
98+
--set image.repository=<AWS-AccountId>.dkr.ecr.<region>.amazonaws.com \
99+
-f eks-values.yaml
273100
```
274-
> NOTE: `ecrodm` is the name of the secret that will be used to pull the images in EKS.

platform/eks/README.md

Lines changed: 33 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,7 @@ The AWS Load Balancer Controller creates Application Load Balancers (ALBs) and t
100100
To get access to the ODM material, you must have an IBM entitlement registry key to pull the images from the IBM Entitled registry.
101101
It's what will be used in the next step of this tutorial.
102102

103-
But, you can also download the ODM on Kubernetes package (.tgz file) from Passport Advantage® (PPA) and then push the contained images to the EKS Container Registry (ECR). If yu prefer to manage ODM images this way, find the explanation [here](README-ECR-REGISTRY.md)
104-
105-
* To access the images from IBM entitlement registry, follow the instructions in the section [Using the IBM Entitled registry with your IBMid](#option-a-using-the-ibm-entitled-registry-with-your-ibmid)
106-
107-
* To download the PPA and push the images in the EKS Container Registry, follow the instructions in the section [Push the ODM images from the PPA to the ECR](#option-b-push-the-odm-images-from-the-ppa-to-the-ecr)
108-
kubectl create secret docker-registry--docker-server=cp.icr.io
109-
#### Option A: Using the IBM Entitled registry with your IBMid
103+
But, you can also download the ODM on Kubernetes package (.tgz file) from Passport Advantage® (PPA) and then push the contained images to the EKS Container Registry (ECR). If you prefer to manage ODM images this way, find the explanation [here](README-ECR-REGISTRY.md)
110104

111105
#### a. Retrieve your entitled registry key
112106
- Log in to [MyIBM Container Software Library](https://myibm.ibm.com/products-services/containerlibrary) with the IBMid and password that are associated with the entitled software.
@@ -116,12 +110,11 @@ kubectl create secret docker-registry--docker-server=cp.icr.io
116110
#### b. Create a pull secret by running a kubectl create secret command.
117111

118112
```console
119-
kubectl create secret docker-registry <REGISTRY_SECRET> --docker-server=cp.icr.io \
113+
kubectl create secret docker-registry my-odm-docker-registry --docker-server=cp.icr.io \
120114
--docker-username=cp --docker-password="<API_KEY_GENERATED>" --docker-email=<USER_EMAIL>
121115
```
122116

123117
where:
124-
* <REGISTRY_SECRET> is the secret name
125118
* <API_KEY_GENERATED> is the entitlement key from the previous step. Make sure you enclose the key in double-quotes.
126119
* <USER_EMAIL> is the email address associated with your IBMid.
127120

@@ -144,11 +137,14 @@ NAME CHART VERSION APP VERSION DESCRIPTION
144137
ibmcharts/ibm-odm-prod 22.1.0 8.11.0.1 IBM Operational Decision Manager
145138
```
146139

147-
You can now proceed to the [Create an RDS database (20 min)](#3-create-an-rds-database-20-min).
140+
### 3. (Optional) Create an RDS database (20 min)
141+
142+
ODM on K8s is provided with a ready to use internal database based on PostgreSQL that can be used empty or with pre-populated samples.
143+
If you want to install an ODM demo quickly, you can use this internal database.
148144

149-
### 3. Create an RDS database (20 min)
145+
But, if you prefer to be more on a entreprise mode, follow the next step explaining how to use an AWS RDS database.
150146

151-
This project uses PostgreSQL but the procedure is valid for any database supported by ODM.
147+
This following step is using PostgreSQL but the procedure is valid for any database supported by ODM.
152148

153149
To set up the database, follow the procedure described here [RDS PostgreSQL database](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html).
154150

@@ -161,6 +157,21 @@ To set up the database, follow the procedure described here [RDS PostgreSQL data
161157
162158
Once the RDS PostgreSQL database is available, take a note of the database endpoint. It will be referred as `RDS_POSTGRESQL_SERVERNAME` in the next sections.
163159

160+
To secure access to the database, you must create a secret that encrypts the database user and password before you install the Helm release.
161+
162+
```bash
163+
kubectl create secret generic <odm-db-secret> \
164+
--from-literal=db-user=<rds-postgresql-user-name> \
165+
--from-literal=db-password=<rds-postgresql-password>
166+
```
167+
168+
Example:
169+
```
170+
kubectl create secret generic odm-db-secret \
171+
--from-literal=db-user=postgres \
172+
--from-literal=db-password=postgres
173+
```
174+
164175
### 4. Manage a  digital certificate (10 min)
165176

166177
#### a. (Optional) Generate a self-signed certificate
@@ -199,50 +210,25 @@ The output of the command is:
199210
200211
### 5. Install an IBM Operational Decision Manager release (10 min)
201212

202-
#### a. Prerequisites
203-
204-
- Create a database secret
205-
206-
To secure access to the database, you must create a secret that encrypts the database user and password before you install the Helm release.
207-
208-
```bash
209-
kubectl create secret generic <odm-db-secret> \
210-
--from-literal=db-user=<rds-postgresql-user-name> \
211-
--from-literal=db-password=<rds-postgresql-password> 
212-
```
213+
Install a Kubernetes release with the default configuration and a name of `mycompany`.
213214

214-
Example:
215-
```
216-
kubectl create secret generic odm-db-secret \
217-
--from-literal=db-user=postgres \
218-
--from-literal=db-password=postgres
219-
```
215+
If you want to install ODM as a demo mode with the ODM postgreSQL internal data base :
220216

221-
#### b. Install an ODM Helm release
217+
```bash
218+
helm install mycompany ibmcharts/ibm-odm-prod --version 22.1.0 -f eks-values.yaml
219+
```
222220

223-
Install a Kubernetes release with the default configuration and a name of `mycompany`.
221+
If you want to install ODM with the AWS RDS postgreSQL database created in step 3 :
224222

225-
- Get the [eks-values.yaml](./eks-values.yaml) file and replace the following keys:
226-
- `<REGISTRY_SECRET>` is the name of the secret containing the IBM Entitled registry key
223+
- Get the [eks-rds-values.yaml](./eks-rds-values.yaml) file and replace the following keys:
227224
- `<AWS-AccountId>` is your AWS Account Id
228225
- `<RDS_DB_ENDPOINT>` is your database server endpoint (of the form: `db-server-name-1.********.<region>.rds.amazonaws.com`)
229226
- `<RDS_DATABASE_NAME>` is the initial database name defined when creating the RDS database
230227

231-
- If you choose to use Entitled Registry for images and to download the Helm chart from IBM's public Helm charts repository [(option A above)](#option-a-using-the-ibm-entitled-registry-with-your-ibmid):
232-
233-
```bash
234-
helm install mycompany ibmcharts/ibm-odm-prod --version 22.1.0 \
235-
--set image.repository=cp.icr.io/cp/cp4a/odm \
236-
-f eks-values.yaml
237-
```
238-
239-
- If you downloaded the PPA archive and prefer to use the Helm chart archive from it [(option B above)](#option-b-push-the-odm-images-from-the-ppa-to-the-ecr):
240228

241-
```bash
242-
helm install mycompany charts/ibm-odm-prod-22.1.0.tgz \
243-
--set image.repository=<AWS-AccountId>.dkr.ecr.<region>.amazonaws.com \
244-
-f eks-values.yaml
245-
```
229+
```bash
230+
helm install mycompany ibmcharts/ibm-odm-prod --version 22.1.0 -f eks-rds-values.yaml
231+
```
246232

247233
> NOTE: If you choose to use the NGINX Ingress Controller, refer to [Install an ODM release with NGINX Ingress Controller](README-NGINX.md#install-an-odm-release-with-nginx-ingress-controller).
248234

platform/eks/eks-nginx-values.yaml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ usersPassword: "odmAdmin"
33

44
image:
55
pullSecrets:
6-
- <REGISTRY_SECRET>
6+
- my-odm-docker-registry
77

88
service:
99
ingress:
@@ -12,18 +12,8 @@ service:
1212
kubernetes.io/ingress.class: nginx
1313
nginx.ingress.kubernetes.io/backend-protocol: https
1414

15-
externalDatabase:
16-
type: postgres
17-
secretCredentials: odm-db-secret
18-
port: 5432
19-
serverName: <RDS_DB_ENDPOINT>
20-
databaseName: <RDS_DATABASE_NAME>
21-
22-
# As an alternative to the RDS postgres externalDatabase
23-
# You can use the postgreSQL internalDatabase
24-
# Remove/Comment previous externalDatabase section and uncomment internalDatabase section
25-
#internalDatabase:
26-
# populateSampleData: true
27-
# persistence:
28-
# enabled: false
29-
# useDynamicProvisioning: true
15+
internalDatabase:
16+
populateSampleData: true
17+
persistence:
18+
enabled: false
19+
useDynamicProvisioning: true

platform/eks/eks-rds-values.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
license: true
2+
usersPassword: "odmAdmin"
3+
4+
image:
5+
repository: cp.icr.io/cp/cp4a/odm
6+
pullSecrets:
7+
- my-odm-docker-registry
8+
9+
service:
10+
ingress:
11+
enabled: true
12+
annotations:
13+
kubernetes.io/ingress.class: alb
14+
alb.ingress.kubernetes.io/scheme: internet-facing
15+
alb.ingress.kubernetes.io/backend-protocol: "HTTPS"
16+
alb.ingress.kubernetes.io/certificate-arn: "arn:aws:iam::<AWS-AccountId>:server-certificate/mycompany"
17+
18+
externalDatabase:
19+
type: postgres
20+
secretCredentials: odm-db-secret
21+
port: 5432
22+
serverName: <RDS_DB_ENDPOINT>
23+
databaseName: <RDS_DATABASE_NAME>

0 commit comments

Comments
 (0)