Skip to content

Commit 52783df

Browse files
authored
re-work ref impl to use path based routing instead (#169)
Signed-off-by: Manabu McCloskey <[email protected]>
1 parent db35227 commit 52783df

File tree

28 files changed

+285
-104
lines changed

28 files changed

+285
-104
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
},
99
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
1010
"workspaceFolder": "/home/vscode/idpbuilder",
11-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/idpbuilder,type=bind"
11+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/idpbuilder,type=bind",
12+
"hostRequirements": {
13+
"cpus": 4
14+
}
1215
}

examples/ref-implementation/README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ Ensure you have the following tools installed on your computer.
1818

1919
## Installation
2020

21+
**_NOTE:_**
22+
- If you'd like to run this in your web browser through Codespaces, please follow [the instructions here](./codespaces.md) to install instead.
23+
24+
- _This example assumes that you run the reference implementation with the default port configguration of 8443 for the idpBuilder.
25+
If you happen to configure a different host or port for the idpBuilder, the manifests in the reference example need to be updated
26+
and be configured with the new host and port. you can use the [replace.sh](replace.sh) to change the port as desired prior to applying the manifest as instructed in the command above._
27+
2128
Run the following command from the root of this repository.
2229

2330
```bash
24-
idpbuilder create --package-dir examples/ref-implementation
31+
idpbuilder create --use-path-routing --package-dir examples/ref-implementation
2532
```
2633

27-
This will take ~6 minutes for everything to come up. To track the progress, you can go to the [ArgoCD UI](https://argocd.cnoe.localtest.me:8443/applications).
28-
29-
**_NOTE:_**: _This example assumes that you run the reference implementation with the default port configguration of 8443 for the idpBuilder. If you happen to configure a different port for the idpBuilder, the manifests in the reference example need to be updated and be configured with the new port. you can use the [replace-port.sh](replace-port.sh) to change the port as desired prior to applying the manifest as instructed in the command above._
34+
This will take ~6 minutes for everything to come up. To track the progress, you can go to the [ArgoCD UI](https://cnoe.localtest.me:8443/argocd/applications).
3035

3136
### What was installed?
3237

@@ -49,15 +54,15 @@ The only package that cannot be removed this way is Keycloak because other packa
4954

5055

5156
#### Accessing UIs
52-
- Argo CD: https://argocd.cnoe.localtest.me:8443
53-
- Argo Workflows: https://argo.cnoe.localtest.me:8443
54-
- Backstage: https://backstage.cnoe.localtest.me:8443
55-
- Gitea: https://gitea.cnoe.localtest.me:8443
56-
- Keycloak: https://keycloak.cnoe.localtest.me:8443/admin/master/console/
57+
- Argo CD: https://cnoe.localtest.me:8443/argocd
58+
- Argo Workflows: https://cnoe.localtest.me:8443/argo
59+
- Backstage: https://cnoe.localtest.me:8443/
60+
- Gitea: https://cnoe.localtest.me:8443/gitea
61+
- Keycloak: https://cnoe.localtest.me:8443/keycloak/admin/master/console/
5762

5863
# Using it
5964

60-
For this example, we will walk through a few demonstrations. Once applications are ready, go to the [backstage URL](https://backstage.cnoe.localtest.me:8443).
65+
For this example, we will walk through a few demonstrations. Once applications are ready, go to the [backstage URL](https://cnoe.localtest.me:8443).
6166

6267
Click on the Sign-In button, you will be asked to log into the Keycloak instance. There are two users set up in this
6368
configuration, and their password can be retrieved with the following command:
@@ -73,7 +78,7 @@ Both users use the same password retrieved above.
7378

7479
If you want to create a new user or change existing users:
7580

76-
1. Go to the [Keycloak UI](https://keycloak.cnoe.localtest.me:8443/admin/master/console/).
81+
1. Go to the [Keycloak UI](https://cnoe.localtest.me:8443/keycloak/admin/master/console/).
7782
Login with the username `cnoe-admin`. Password is the `KEYCLOAK_ADMIN_PASSWORD` field from the command above.
7883
2. Select `cnoe` from the realms drop down menu.
7984
3. Select users tab.
@@ -100,9 +105,9 @@ You can click on the ArgoCD Application name to see more details.
100105

101106
### What just happened?
102107

103-
1. Backstage created [a git repository](https://gitea.cnoe.localtest.me:8443/giteaAdmin/demo), then pushed templated contents to it.
104-
2. Backstage created [an ArgoCD Application](https://argocd.cnoe.localtest.me:8443/applications/argocd/demo?) and pointed it to the git repository.
105-
3. Backstage registered the application as [a component](https://gitea.cnoe.localtest.me:8443/giteaAdmin/demo/src/branch/main/catalog-info.yaml) in Backstage.
108+
1. Backstage created [a git repository](https://cnoe.localtest.me:8443/gitea/giteaAdmin/demo), then pushed templated contents to it.
109+
2. Backstage created [an ArgoCD Application](https://cnoe.localtest.me:8443/argocd/applications/argocd/demo?) and pointed it to the git repository.
110+
3. Backstage registered the application as [a component](https://cnoe.localtest.me:8443/gitea/giteaAdmin/demo/src/branch/main/catalog-info.yaml) in Backstage.
106111
4. ArgoCD deployed the manifests stored in the repo to the cluster.
107112
5. Backstage retrieved application health from ArgoCD API, then displayed it.
108113

examples/ref-implementation/argo-workflows/manifests/dev/ingress.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@ kind: Ingress
33
metadata:
44
name: argo-workflows-ingress
55
namespace: argo
6+
annotations:
7+
nginx.ingress.kubernetes.io/use-regex: "true"
8+
nginx.ingress.kubernetes.io/rewrite-target: /$2
69
spec:
710
ingressClassName: "nginx"
811
rules:
9-
- host: argo.cnoe.localtest.me
12+
- host: localhost
1013
http:
1114
paths:
12-
- path: /
13-
pathType: Prefix
15+
- path: /argo-workflows(/|$)(.*)
16+
pathType: ImplementationSpecific
17+
backend:
18+
service:
19+
name: argo-server
20+
port:
21+
name: web
22+
- host: cnoe.localtest.me
23+
http:
24+
paths:
25+
- path: /argo-workflows(/|$)(.*)
26+
pathType: ImplementationSpecific
1427
backend:
1528
service:
1629
name: argo-server

examples/ref-implementation/argo-workflows/manifests/dev/patches/cm-argo-workflows.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ data:
77
config: |
88
sso:
99
insecureSkipVerify: true
10-
issuer: https://keycloak.cnoe.localtest.me:8443/realms/cnoe
10+
issuer: https://cnoe.localtest.me:8443/keycloak/realms/cnoe
1111
clientId:
1212
name: keycloak-oidc
1313
key: client-id
1414
clientSecret:
1515
name: keycloak-oidc
1616
key: secret-key
17-
redirectUrl: https://argo.cnoe.localtest.me:8443/oauth2/callback
17+
redirectUrl: https://cnoe.localtest.me:8443/argo-workflows/oauth2/callback
1818
rbac:
1919
enabled: true
2020
scopes:

examples/ref-implementation/argo-workflows/manifests/dev/patches/deployment-argo-server.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ spec:
1313
path: /
1414
port: 2746
1515
scheme: HTTP
16+
env:
17+
- name: BASE_HREF
18+
value: "/argo-workflows/"
1619
args:
1720
- server
1821
- --configmap=workflow-controller-configmap

examples/ref-implementation/backstage-templates.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ spec:
2121
- CreateNamespace=true
2222
automated:
2323
selfHeal: true
24-

examples/ref-implementation/backstage-templates/entities/app-with-bucket/skeleton/catalog-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
backstage.io/kubernetes-namespace: default
2020
argocd/app-name: ${{values.name | dump}}
2121
links:
22-
- url: https://gitea.cnoe.localtest.me:8443
22+
- url: https://cnoe.localtest.me:8443/gitea
2323
title: Repo URL
2424
icon: github
2525
spec:

examples/ref-implementation/backstage-templates/entities/app-with-bucket/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ spec:
100100
input:
101101
description: This is an example app
102102
# Hard coded value for this demo purposes only.
103-
repoUrl: gitea.cnoe.localtest.me:8443?repo=${{parameters.name}}
103+
repoUrl: cnoe.localtest.me:8443/gitea?repo=${{parameters.name}}
104104
defaultBranch: main
105105
- id: create-argocd-app
106106
name: Create ArgoCD App

examples/ref-implementation/backstage-templates/entities/argo-workflows/skeleton/catalog-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
apache-spark.cnoe.io/label-selector: env=dev,entity-id=${{values.name}}
1414
apache-spark.cnoe.io/cluster-name: local
1515
links:
16-
- url: https://gitea.cnoe.localtest.me:8443
16+
- url: https://cnoe.localtest.me:8443/gitea
1717
title: Repo URL
1818
icon: github
1919
spec:

examples/ref-implementation/backstage-templates/entities/argo-workflows/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
input:
3636
description: This is an example app
3737
# Hard coded value for this demo purposes only.
38-
repoUrl: gitea.cnoe.localtest.me:8443?repo=${{parameters.name}}
38+
repoUrl: cnoe.localtest.me:8443/gitea?repo=${{parameters.name}}
3939
defaultBranch: main
4040
- id: create-argocd-app
4141
name: Create ArgoCD App

0 commit comments

Comments
 (0)