-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reference implementation example #138
Conversation
Signed-off-by: Manabu Mccloskey <[email protected]>
1e27fa9
to
7c314f1
Compare
Signed-off-by: Manabu McCloskey <[email protected]>
Signed-off-by: Manabu McCloskey <[email protected]>
Question: As the goal of this project = idpbuilder is to help the developers when they create/design an IDP platform, will the backstage app installed with the example include the needed "plugins" able to show the following views: argocd, keycloak, etc ? |
Can you please link the issue #142 to this PR's description ? |
|
||
This example creates a local version of the CNOE reference implementation. | ||
|
||
## Installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a prerequisite section as I suspect that we need:
- kubectl installed + kube OIDC login plugin (?),
- idpbuilder version 0.x (the x should be defined ;-))
- An account on Amazon and S3 bucket,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also do we need something to put in there with regards to system specs? or at least memory requirements. my 16G core i7 cant handle it well.
Can we please add also cert manager ? |
Yeah plugins are baked in with the image. Source is available here: https://github.com/cnoe-io/backstage-app
I mentioned it in the description but this issue is a bit different so I won't close the issue.
I left it out because it's heavy as-is, in terms of resource utilization. |
Signed-off-by: Manabu McCloskey <[email protected]>
f3cf639
to
bfe0585
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great. some minor comments from me
|
||
This example creates a local version of the CNOE reference implementation. | ||
|
||
## Installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also do we need something to put in there with regards to system specs? or at least memory requirements. my 16G core i7 cant handle it well.
3. **Crossplane**, AWS providers, and basic compositions for deploying cloud related resources (needs your credentials for this to work) | ||
4. **External Secrets** to generate secrets and coordinate secrets between applications. | ||
5. **Keycloak** as the identity provider for applications. | ||
6. **Spark Operator** to demonstrate an example Spark workload through Backstage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone doesnt want Spark for example, is it as easy as removing the manifests for it? or is there extra configuration in other components that they need to tweak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also do we need something to put in there with regards to system specs? or at least memory requirements. my 16G core i7 cant handle it well.
That's actually concerning. On my Ubuntu machine it consumes about 5GB memory. How much resources are you allocating to Docker Desktop VM?
if someone doesnt want Spark for example, is it as easy as removing the manifests for it? or is there extra configuration in other components that they need to tweak?
yea just need to remove the argocd app spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use Apache Spark as example ? AFAIK, there is no backstage plugin, so what could be the added value to propose it as example ?
Remark: Should we instead propose as example a microservice such as Spring Boot, Quarkus, Nodejs or combination ?
|
||
![img.png](images/demo2-entity.png) | ||
|
||
Deployment processes are the same as the first example. Instead of deploying a pod, we deployed a workflow to create a Spark job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we link to the location in the git repo where this workflow can be found
@@ -0,0 +1,35 @@ | |||
{%- if values.awsResources %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about splitting the example applications into a separate folder, so we have one folder for a vanilla reference implementation, and another to deploy the example apps. doing something like the following in the readme:
idpbuilder create --package-dir examples/ref-implementation --package-dir examples/sample-apps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather just have one command to deploy everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should dissociate the process to install the reference implementation (= components A + B + C etc) from the step to install an example top of the reference platform. Why ? As the goal of the tool is to provision a cluster, than such implementation
should be used for different purposes, to allow the users to deploy also their own examples, or examples defined in a lab project, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah +1 on what Charles said above.
curl -sS -H "Content-Type: application/json" \ | ||
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ | ||
-X PUT --data @/tmp/user-password-to-be-applied.json \ | ||
http://keycloak.keycloak.svc.cluster.local:8080/admin/realms/cnoe/users/${USER1ID}/reset-password | ||
|
||
curl -sS -H "Content-Type: application/json" \ | ||
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ | ||
-X PUT --data @/tmp/user-password-to-be-applied.json \ | ||
http://keycloak.keycloak.svc.cluster.local:8080/admin/realms/cnoe/users/${USER2ID}/reset-password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a note in the README that both user1 and user2 get the same password and how maybe that can be tweaked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated documentation
Signed-off-by: Manabu McCloskey <[email protected]>
3. **Crossplane**, AWS providers, and basic compositions for deploying cloud related resources (needs your credentials for this to work) | ||
4. **External Secrets** to generate secrets and coordinate secrets between applications. | ||
5. **Keycloak** as the identity provider for applications. | ||
6. **Spark Operator** to demonstrate an example Spark workload through Backstage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use Apache Spark as example ? AFAIK, there is no backstage plugin, so what could be the added value to propose it as example ?
Remark: Should we instead propose as example a microservice such as Spring Boot, Quarkus, Nodejs or combination ?
@@ -0,0 +1,35 @@ | |||
{%- if values.awsResources %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should dissociate the process to install the reference implementation (= components A + B + C etc) from the step to install an example top of the reference platform. Why ? As the goal of the tool is to provision a cluster, than such implementation
should be used for different purposes, to allow the users to deploy also their own examples, or examples defined in a lab project, etc
BACKSTAGE_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \ | ||
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ | ||
-X GET http://keycloak.keycloak.svc.cluster.local:8080/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret') | ||
|
||
ARGOCD_PASSWORD=$(./kubectl -n argocd get secret argocd-initial-admin-secret -o go-template='{{.data.password | base64decode }}') | ||
|
||
ARGOCD_SESSION_TOKEN=$(curl -k -sS https://argocd-server.argocd.svc.cluster.local:443/api/v1/session -d "{\"username\":\"admin\",\"password\":\"${ARGOCD_PASSWORD}\"}" | jq -r .token) | ||
|
||
echo \ | ||
"apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: keycloak-clients | ||
namespace: keycloak | ||
type: Opaque | ||
stringData: | ||
ARGO_WORKFLOWS_CLIENT_SECRET: ${ARGO_WORKFLOWS_CLIENT_SECRET} | ||
ARGO_WORKFLOWS_CLIENT_ID: argo-workflows | ||
ARGOCD_SESSION_TOKEN: ${ARGOCD_SESSION_TOKEN} | ||
BACKSTAGE_CLIENT_SECRET: ${BACKSTAGE_CLIENT_SECRET} | ||
BACKSTAGE_CLIENT_ID: backstage | ||
" > /tmp/secret.yaml | ||
|
||
./kubectl apply -f /tmp/secret.yaml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the backstage secret created here within keycloak stuffs ? Such a step should be included within the backstage folder and documented to let the users to figure out how they could expand/override their app-config.yaml ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use Apache Spark as example ? AFAIK, there is no backstage plugin, so what could be the added value to propose it as example ?
Remark: Should we instead propose as example a microservice such as Spring Boot, Quarkus, Nodejs or combination ?
We do have a pugin for the Spark operator. This was included in the original reference implementation and thus it's included here. The purpose of it is to show that IDP does not necessary be for applications only.
I think that we should dissociate the process to install the reference implementation (= components A + B + C etc) from the step to install an example top of the reference platform. Why ? As the goal of the tool is to provision a cluster, than such implementation should be used for different purposes, to allow the users to deploy also their own examples, or examples defined in a lab project, etc
I think we need a guide to show this part, but not in this PR. The primary goal of this PR is to showcase what you can build with idpbuilder, even complicated stuff like this. If we want to create a guide for developing Backstage stuff, it should be separate.
Why is the backstage secret created here within keycloak stuffs ? Such a step should be included within the backstage folder and documented to let the users to figure out how they could expand/override their app-config.yaml ;-)
These are for SSO configuration stuff. Keycloak client secrets are generated by Keycloak upon creation of a client. We need a way to export this to client applications (backstage and argo workflows). We could include this in Backstage stuff but it becomes a bit of a mess because we now need to do the same for other apps like argocd and argo workflows.
As many of the backstage examples rely on scaffolding a project (spring boot, nodejs, quarkus, etc) on github, how will it be possible for a user to provide its GitHub Personal Access Token which is needed to configure such app-config.yaml field ?
|
GitHub integration stuff is left out intentionally. It's hard to automate and I did not want to make users worry about external stuff. I wanted everything to stay local. If they want integrations with external stuff like GitHub and AWS, they can look at the Terraform version. What I wanted to enable for this was to show how you can bring up a solution with just one command. |
@nabuskey k logs -n argo argo-server-6d8dbf6b99-2jdqh
|
deleting the argo-server pod, made it work with the new pod |
Signed-off-by: Manabu McCloskey <[email protected]>
problems with keycloak got fix by the latest update to the image to 22.0.3 🙌 |
@nabuskey |
nope, it looks like using keycloak
|
![img.png](images/backstage-templates.png) | ||
|
||
|
||
In the next screen, type `demo` for the name field, then click create. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next screen, type `demo` for the name field, then click create. | |
In the next screen, type `demo` for the name field, then click Review, then Create. |
Signed-off-by: Manabu McCloskey <[email protected]>
27b05e2
to
2783cda
Compare
Signed-off-by: Manabu McCloskey <[email protected]>
Adds an example for the cnoe ref implementation. Related to #142