Closed rhanka closed 4 months ago
This update enhances Kubernetes deployment scripts and configurations, focusing on environment variable management and refining deployment targets. Notable changes include the integration of new variables for Kubernetes configurations and storage, updates to deployment names and settings in Elasticsearch, and adjustments in front-end configurations to align with backend services.
File | Change Summary |
---|---|
Makefile |
Enhanced environment variable exports and updated deployment targets for Kubernetes resources. |
k8s/elasticsearch.yaml |
Overhauled Elasticsearch deployment with new init containers, updated environment variables, and a new persistent volume claim. |
k8s/frontend.yaml |
Updated container ports and environment variables to improve alignment with backend services. |
🐰✨ In the land of code and kube, A rabbit hopped with a vibrant tube. Changes made with a gentle tweak, Now the clusters run oh-so sleek. Hop, hop, hooray, let's celebrate, For our services now communicate! 🎉🐇
k8s/frontend.yaml (3)
`22-23`: Setting the `PORT` environment variable directly in the deployment configuration is a good practice for clarity and maintainability. --- `29-29`: Changing the `ES_HOST` value to a static "elasticsearch" simplifies the configuration and reduces dependency on variable substitution, which can enhance stability and predictability in deployments. --- `99-99`: Using the `${PORT}` variable for `targetPort` aligns the service port configuration with the container port, ensuring consistency across the deployment.k8s/elasticsearch.yaml (9)
`14-14`: Renaming the deployment to `elasticsearch-deployment` standardizes the naming convention, which can improve clarity when managing multiple components. --- `19-19`: Updating the `app` label to `elasticsearch` in the deployment selector ensures that the deployment's pods are correctly associated with the service and other resources. --- `23-23`: Consistency in labeling across the deployment and its pods aids in straightforward resource management and querying within Kubernetes. --- `30-37`: The commands in the `sysctl` init container are crucial for setting necessary system parameters for Elasticsearch. Ensure these settings are compatible with your cluster's security policies. --- `59-156`: The addition of the `restore-snapshot` init container for Elasticsearch snapshot restoration is a significant enhancement. It is crucial to ensure that the commands and environment variables in this container are correctly configured to avoid errors during the restoration process. --- `158-158`: Renaming the container to `elasticsearch` aligns with the standardized naming convention used in the deployment, enhancing consistency. --- `193-211`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [181-211] Adding a `PersistentVolumeClaim` for `elasticsearch-data` ensures data persistence across pod restarts and failures, which is crucial for maintaining state in a stateful application like Elasticsearch. --- `11-190`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [187-196] Configuring the service for Elasticsearch with the correct port and selector ensures that it can be accessed reliably within the cluster. --- `203-204`: Labeling the `PersistentVolumeClaim` with `app: elasticsearch` helps in associating the PVC with the Elasticsearch deployment, aiding in management and resource tracking.Makefile (5)
`118-119`: Adding `KUBECONFIG` and `ES_MEM_KUBE` as environment variables enhances the flexibility and configurability of Kubernetes and Elasticsearch memory settings, respectively. --- `116-116`: Updating the `KUBE_NAMESPACE` to dynamically include the app group, app name, and Git branch helps in organizing resources better in multi-branch deployments. --- `170-171`: Exporting base64-encoded storage access and secret keys as environment variables is a secure way to handle sensitive information, ensuring that plain text keys are not exposed in the configuration files. --- `164-164`: Updating the `SCW_IMAGE_ID` ensures that the latest and most appropriate image is used for deployments, which can lead to better performance and security. --- `529-566`: The modifications to the deployment targets to handle the new and updated environment variables ensure that deployments are consistent with the current configuration state. It's important to verify that these targets function as expected in a live environment.
Summary by CodeRabbit
New Features
PersistentVolumeClaim
for Elasticsearch data storage.Refactor
Bug Fixes