Skip to content
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

Keycloak deployment #203

Merged
merged 25 commits into from
Nov 25, 2023
Merged

Keycloak deployment #203

merged 25 commits into from
Nov 25, 2023

Conversation

dadiorchen
Copy link
Contributor

@dadiorchen dadiorchen commented Nov 6, 2023

Formally deploy keycloak to k8s
A customized docker image to change the UI sylte with Greenstand brand.

Copy link
Collaborator

@mckornfield mckornfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits and questions, ideally we could just use a base image and mount some scripts etc in as configmaps

keycloak/README.md Outdated Show resolved Hide resolved
keycloak/README.md Show resolved Hide resolved
echo "2. test"
echo "3. prod"
read -p "Enter your choice: " choice
deploy_env=$(node -e 'console.log(["dev", "test", "prod"][process.argv[1] - 1])' $choice)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this validate an invalid choice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't, I should have done this.

echo "The current k8s cluster is: ${current_k8s_cluster}"
#TODO here we use the name in config/context, it might be problematic
# maybe a cluster configmap is good to have: https://stackoverflow.com/questions/38242062/how-to-get-kubernetes-cluster-name-from-k8s-api
is_cluster_ok=$(node ./lib/js/checkK8sClusterNameByEnv.js ${deploy_env} ${current_k8s_cluster})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use doctl to switch the context for the user?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a script in this repo that does that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder

keycloak/lib/docker/Dockerfile Outdated Show resolved Hide resolved

WORKDIR /opt/keycloak

# Copy the theme
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these be configmaps and env vars instead of a docker image?

</script>

EOF
sed -i "s/dev-k8s.treetracker.org/${RAW_CLIENT_URL}/g" index.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be a configmap too

spec:
containers:
- name: treetracker-keycloak
image: dadiorchen/keycloak:1.5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above, could just use a configmap

@@ -0,0 +1,243 @@
<!doctype html>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file used for something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be used as tool to test keycloak, by runing it locally

@dadiorchen
Copy link
Contributor Author

@mckornfield thanks!

Can you explain your solution with configmap handling the docker customization:

What I need in this case is:
cp some files (in this pr) and overwrite it to some dir, and run the keycloak command.
How can I do so in the configmap?

@mckornfield
Copy link
Collaborator

You could mount those files in as a configmap instead to the relevant directory, and use the base image

@dadiorchen
Copy link
Contributor Author

@mckornfield that's a good idea, I will try it.

@dadiorchen dadiorchen merged commit c1052c4 into master Nov 25, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants