Skip to content

Commit

Permalink
chore: updates and AWS managed deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Nov 25, 2024
1 parent 40aa219 commit d671078
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 8 deletions.
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@ Use it as default:
kubectl config set-context --current --namespace=trustify
```

Evaluate the application domain:
Evaluate the application domain and namespace:

```bash
NAMESPACE=trustify
APP_DOMAIN=.$(minikube ip).nip.io
```

Install the infrastructure services:

```bash
helm upgrade --install --dependency-update -n trustify infrastructure charts/trustify-infrastructure --values values-minikube.yaml --set-string keycloak.ingress.hostname=sso$APP_DOMAIN --set-string appDomain=$APP_DOMAIN
helm upgrade --install --dependency-update -n $NAMESPACE infrastructure charts/trustify-infrastructure --values values-minikube.yaml --set-string keycloak.ingress.hostname=sso$APP_DOMAIN --set-string appDomain=$APP_DOMAIN
```

Then deploy the application:

```bash
helm upgrade --install -n trustify trustify charts/trustify --values values-minikube.yaml --set-string appDomain=$APP_DOMAIN
helm upgrade --install -n $NAMESPACE trustify charts/trustify --values values-minikube.yaml --set-string appDomain=$APP_DOMAIN
```

### Kind
Expand Down Expand Up @@ -71,30 +72,41 @@ Create a new namespace:
oc new-project trustify
```

Evaluate the application domain:
Evaluate the application domain and namespace:

```bash
APP_DOMAIN=-trustify.$(oc -n openshift-ingress-operator get ingresscontrollers.operator.openshift.io default -o jsonpath='{.status.domain}')
NAMESPACE=trustify
APP_DOMAIN=-$NAMESPACE.$(oc -n openshift-ingress-operator get ingresscontrollers.operator.openshift.io default -o jsonpath='{.status.domain}')
```

Provide the trust anchor:

```bash
oc get secret -n openshift-ingress router-certs-default -o go-template='{{index .data "tls.crt"}}' | base64 -d > tls.crt
oc get secret -n openshift-ingress router-certs-default -o go-template='{{index .data "tls.crt"}}' | base64 -d > tls.crt
oc create configmap crc-trust-anchor --from-file=tls.crt -n trustify
rm tls.crt
```

Deploy the infrastructure:

```bash
helm upgrade --install --dependency-update -n trustify infrastructure charts/trustify-infrastructure --values values-ocp-no-aws.yaml --set-string keycloak.ingress.hostname=sso$APP_DOMAIN --set-string appDomain=$APP_DOMAIN
helm upgrade --install --dependency-update -n $NAMESPACE infrastructure charts/trustify-infrastructure --values values-ocp-no-aws.yaml --set-string keycloak.ingress.hostname=sso$APP_DOMAIN --set-string appDomain=$APP_DOMAIN
```

Deploy the application:

```bash
helm upgrade --install -n trustify trustify charts/trustify --values values-ocp-no-aws.yaml --set-string appDomain=$APP_DOMAIN --values values-crc.yaml
helm upgrade --install -n $NAMESPACE trustify charts/trustify --values values-ocp-no-aws.yaml --set-string appDomain=$APP_DOMAIN --values values-crc.yaml
```

## OpenShift with AWS resources

Instead of using Keycloak and the filesystem storage, it is also possible to use AWS Cognito and S3.

Deploy only the application:

```bash
helm upgrade --install -n $NAMESPACE trustify charts/trustify --values values-ocp-aws.yaml --set-string appDomain=$APP_DOMAIN
```

## From a released chart
Expand Down
98 changes: 98 additions & 0 deletions values-ocp-aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
appDomain: change-me # <1>

ingress:
className: openshift-default

authenticator:
type: cognito
cognitoDomainUrl: <cognito-domain-url> # <3>

storage:
s3:
region: <region> # <2>
bucket: trustify-jreimann
accessKey:
valueFrom:
secretKeyRef:
name: storage-credentials
key: aws_access_key_id
secretKey:
valueFrom:
secretKeyRef:
name: storage-credentials
key: aws_secret_access_key

database:
host:
valueFrom:
secretKeyRef:
name: postgresql-credentials
key: db.host
port:
valueFrom:
secretKeyRef:
name: postgresql-credentials
key: db.port
name:
valueFrom:
secretKeyRef:
name: postgresql-credentials
key: db.name
username:
valueFrom:
secretKeyRef:
name: postgresql-credentials
key: db.user
password:
valueFrom:
secretKeyRef:
name: postgresql-credentials
key: db.port

createDatabase:
name:
valueFrom:
secretKeyRef:
name: postgresql-admin-credentials
key: db.name
username:
valueFrom:
secretKeyRef:
name: postgresql-admin-credentials
key: db.user
password:
valueFrom:
secretKeyRef:
name: postgresql-admin-credentials
key: db.password

migrateDatabase:
username:
valueFrom:
secretKeyRef:
name: postgresql-admin-credentials
key: db.user
password:
valueFrom:
secretKeyRef:
name: postgresql-admin-credentials
key: db.password

modules:
createDatabase:
enabled: true
migrateDatabase:
enabled: true

oidc:
issuerUrl: <issuer-url> # <4>
clients:
frontend:
clientId: <client-id> # <5>
cli:
clientId: <client-id> # <6>
clientSecret:
valueFrom:
secretKeyRef:
name: oidc-cli
key: client-secret

0 comments on commit d671078

Please sign in to comment.