Conversation
There was a problem hiding this comment.
Pull Request Overview
Updates Kubernetes deployment templates and CI/CD workflow to use environment variable substitution and add support for 'fix' branch deployments.
- Replaced hardcoded placeholder tokens (#APP#, #NAMESPACE#, #IMAGE#) with environment variable syntax
- Added 'fix' branch to trigger development builds and deployments
- Migrated from remote Kubernetes cluster to local KinD cluster for development deployments
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| kubernetes/deployment.yaml | Replaced placeholder tokens with environment variables and hardcoded app name |
| .github/workflows/ci-cd.yml | Added 'fix' branch support and switched to KinD cluster setup |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app |
There was a problem hiding this comment.
The app name 'mentora-app' is hardcoded in multiple places. Consider using an environment variable like ${APP_NAME} to maintain consistency with the other environment variable substitutions and make the deployment more configurable.
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app |
There was a problem hiding this comment.
The app name 'mentora-app' is hardcoded in multiple places. Consider using an environment variable like ${APP_NAME} to maintain consistency with the other environment variable substitutions and make the deployment more configurable.
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app |
There was a problem hiding this comment.
The app name 'mentora-app' is hardcoded in multiple places. Consider using an environment variable like ${APP_NAME} to maintain consistency with the other environment variable substitutions and make the deployment more configurable.
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app |
There was a problem hiding this comment.
The app name 'mentora-app' is hardcoded in multiple places. Consider using an environment variable like ${APP_NAME} to maintain consistency with the other environment variable substitutions and make the deployment more configurable.
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app |
There was a problem hiding this comment.
The app name 'mentora-app' is hardcoded in multiple places. Consider using an environment variable like ${APP_NAME} to maintain consistency with the other environment variable substitutions and make the deployment more configurable.
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app |
There was a problem hiding this comment.
The app name 'mentora-app' is hardcoded in multiple places. Consider using an environment variable like ${APP_NAME} to maintain consistency with the other environment variable substitutions and make the deployment more configurable.
| on: | ||
| push: | ||
| branches: [ main, dev ] | ||
| branches: [ main, dev, 'fix' ] |
There was a problem hiding this comment.
Using a literal branch name 'fix' in the trigger is not maintainable. Consider using a pattern like 'fix/*' to support multiple fix branches, or remove this if it's temporary debugging code.
| branches: [ main, dev, 'fix' ] | |
| branches: [ main, dev, 'fix/*' ] |
| - name: Debug kubectl config | ||
| run: | | ||
| echo "--- Kubeconfig file content ---" | ||
| cat $HOME/.kube/config || echo "Using KinD default kubeconfig" | ||
| echo "--- kubectl config view ---" | ||
| kubectl config view | ||
|
|
There was a problem hiding this comment.
Debug steps should be removed from production CI/CD workflows as they can expose sensitive configuration information and add unnecessary execution time.
| - name: Debug kubectl config | |
| run: | | |
| echo "--- Kubeconfig file content ---" | |
| cat $HOME/.kube/config || echo "Using KinD default kubeconfig" | |
| echo "--- kubectl config view ---" | |
| kubectl config view | |
| # Debug step removed to avoid exposing sensitive information |
No description provided.