-
Notifications
You must be signed in to change notification settings - Fork 1.3k
added k8s manifests #6
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||||||
| apiVersion: apps/v1 | ||||||||||||||||||||
| kind: Deployment | ||||||||||||||||||||
| metadata: | ||||||||||||||||||||
| name: backend-deployment | ||||||||||||||||||||
| namespace: chat-app | ||||||||||||||||||||
|
|
||||||||||||||||||||
| spec: | ||||||||||||||||||||
| replicas: 1 | ||||||||||||||||||||
| selector: | ||||||||||||||||||||
| matchLabels: | ||||||||||||||||||||
| app: backend | ||||||||||||||||||||
| template: | ||||||||||||||||||||
| metadata: | ||||||||||||||||||||
| name: backend-pod | ||||||||||||||||||||
| namespace: chat-app | ||||||||||||||||||||
| labels: | ||||||||||||||||||||
| app: backend | ||||||||||||||||||||
| spec: | ||||||||||||||||||||
| containers: | ||||||||||||||||||||
| - name: chatapp-backend | ||||||||||||||||||||
| image: swarnendukar123/chatapp-backend:latest | ||||||||||||||||||||
| ports: | ||||||||||||||||||||
| - containerPort: 5001 | ||||||||||||||||||||
|
Comment on lines
+19
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add Addresses CKV_K8S_20 and CKV_K8S_23. containers:
- name: chatapp-backend
image: swarnendukar123/chatapp-backend:latest
+ securityContext:
+ runAsNonRoot: true
+ allowPrivilegeEscalation: false🧰 Tools🪛 YAMLlint (1.37.1)[warning] 21-21: too many spaces after colon (colons) 🤖 Prompt for AI Agents |
||||||||||||||||||||
| env: | ||||||||||||||||||||
| - name: NODE_ENV | ||||||||||||||||||||
| value: production | ||||||||||||||||||||
| - name: MONGODB_URI | ||||||||||||||||||||
| value: mongodb://mongoadmin:secret@mongodb:27017/dbname?authSource=admin | ||||||||||||||||||||
| - name: JWT_SECRET | ||||||||||||||||||||
|
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move DB credentials out of the manifest. Hard-coding - - name: MONGODB_URI
- value: mongodb://mongoadmin:secret@mongodb:27017/dbname?authSource=admin
+ - name: MONGODB_URI
+ valueFrom:
+ secretKeyRef:
+ name: chatapp-secrets
+ key: mongodb_uri📝 Committable suggestion
Suggested change
🧰 Tools🪛 Checkov (3.2.334)[MEDIUM] 28-29: Basic Auth Credentials (CKV_SECRET_4) 🤖 Prompt for AI Agents |
||||||||||||||||||||
| valueFrom: | ||||||||||||||||||||
| secretKeyRef: | ||||||||||||||||||||
| name: chatapp-secrets | ||||||||||||||||||||
| key: jwt | ||||||||||||||||||||
| - name: PORT | ||||||||||||||||||||
| value: "5001" | ||||||||||||||||||||
This file was deleted.
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.
Remove
namespacefrom the Pod template — it is invalid inspec.template.metadata.spec.template.metadatamust not contain anamespacefield. Its presence prevents the Deployment from being created.- namespace: chat-app🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 16-16: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents