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

k8s: Use configmap for API deployment #324

Merged
merged 6 commits into from
Sep 1, 2023

Conversation

JenySadadia
Copy link
Collaborator

@JenySadadia JenySadadia commented Aug 11, 2023

Kubernetes provides ConfigMap mechanism used to configure pods efficiently.

Use ConfigMap for providing environment variables to API deployment.

Instead of adding environment variable values for Redis hostname and Mongo DB URL directly into api deployment file, reference ConfigMap to read values.

  • Added manifest file to generate configmap
  • Updated api deployment file to reference configmap variables
  • Renamed directory from hack to scripts
  • Added command to generate configmap to scripts/apply-all.sh

@JenySadadia JenySadadia changed the title [ k8s ] Generate configmap for API deployment k8s: Generate configmap for API deployment Aug 11, 2023
@JenySadadia JenySadadia changed the title k8s: Generate configmap for API deployment k8s: Use configmap for API deployment Aug 11, 2023
@JenySadadia JenySadadia requested a review from gctucker August 11, 2023 07:56
@JenySadadia
Copy link
Collaborator Author

Renamed script apply-all.sh to deploy.sh.

@gctucker
Copy link
Contributor

@nuclearcat @sbdtu5498 Hello, could you please take a look and review this PR?

@sbdtu5498
Copy link
Contributor

sbdtu5498 commented Aug 30, 2023

Everything seems fine to me. Just a small nit. @JenySadadia if we can change the name of clean-all.sh to tear.sh. It sounds more resonating with deploy.sh.

@@ -137,15 +137,15 @@ kubectly apply -f api-deployment.yaml

## Cleaning up everything afterwards

To clean up everything simply use the ```clean-all.sh``` script provided in the root of the kube/minikube/hack folder by running
To clean up everything simply use the ```clean-all.sh``` script provided in the root of the kube/minikube/scripts folder by running
Copy link
Contributor

Choose a reason for hiding this comment

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

@JenySadadia how about calling clean-all.sh tear.sh instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

delete-resources.sh looks more suitable to me.

@nuclearcat
Copy link
Member

I guess its need rebase now, as minkube changed to minikube

Jeny Sadadia added 4 commits September 1, 2023 11:54
Fix a typo in a command to run `api` deployment.

Fixes
Signed-off-by: Jeny Sadadia <[email protected]>
Use `ConfigMap` to provide configuration for
redis host and DB service URL.
Add a manifest file to generate `configmap`
named `kernelci-api-config`.
API deployment will reference `REDIS_HOST`
and `MONGO_SERVICE` from the configmap.

Signed-off-by: Jeny Sadadia <[email protected]>
Reference configmap `kernelci-api-config` to get environment
variables for redis hostname and DB service URL.

Signed-off-by: Jeny Sadadia <[email protected]>
Add `kubectl` command to generate `ConfigMap`
for API deployment.

Signed-off-by: Jeny Sadadia <[email protected]>
@JenySadadia
Copy link
Collaborator Author

I guess its need rebase now, as minkube changed to minikube

Rebased it.

Jeny Sadadia added 2 commits September 1, 2023 16:26
Rename directory name containing scripts to
automate deployment from `hack` to `scripts`.
Update `README.md` accordingly.

Signed-off-by: Jeny Sadadia <[email protected]>
Rename script from `apply-all.sh` to `deploy.sh`.
The script can be used to automate API deployment
in k8s.

Signed-off-by: Jeny Sadadia <[email protected]>
@nuclearcat nuclearcat added this pull request to the merge queue Sep 1, 2023
Merged via the queue into kernelci:main with commit 53d4582 Sep 1, 2023
4 checks passed
@JenySadadia JenySadadia deleted the api-configmap branch September 4, 2023 04:35
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.

4 participants