-
Notifications
You must be signed in to change notification settings - Fork 0
Staging #119
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
Merged
Merged
Staging #119
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
43dd827
feat(infra): add kubernetes manifests
Shashank0701-byte ecb11ee
Merge pull request #118 from Shashank0701-byte/feature/re-evaluate
Shashank0701-byte 377504e
fix(ci): disable k8s server validation in dry-run
Shashank0701-byte 9ce557f
Merge pull request #120 from Shashank0701-byte/feature/re-evaluate
Shashank0701-byte 29dfd09
fix(ci): provide dummy kubeconfig for manifest validation
Shashank0701-byte 349b2b3
Merge pull request #121 from Shashank0701-byte/feature/re-evaluate
Shashank0701-byte 7a784c7
fix(ci): provide dummy kubeconfig for manifest validation
Shashank0701-byte 22ef388
Merge pull request #122 from Shashank0701-byte/feature/re-evaluate
Shashank0701-byte ee31de2
fix(ci): provide dummy kubeconfig for manifest validation
Shashank0701-byte 71bd590
Merge pull request #123 from Shashank0701-byte/feature/re-evaluate
Shashank0701-byte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Kubernetes: The Infrastructure Finale | ||
|
|
||
| SystemCraft's journey started with **Docker** for isolation, moved to **Nginx** for reverse proxying, and now concludes with **Kubernetes** for robust orchestration. | ||
|
|
||
| ## 📁 Manifests Structure | ||
| - `deployment.yaml`: Defing a 3-replica stateful-ready application with resource limits. | ||
| - `service.yaml`: Internal connectivity via `ClusterIP`. | ||
| - `ingress.yaml`: External routing via Nginx Ingress Controller (completing the Nginx journey). | ||
|
|
||
| ## 🚀 Deployment Strategy | ||
| The CI/CD pipeline in `.github/workflows/ci.yml` is now integrated with these manifests: | ||
| 1. **Validation**: Every PR dry-runs the manifests to ensure zero syntax errors. | ||
| 2. **Build**: Docker images are pushed to GitHub Container Registry (GHCR). | ||
| 3. **Deploy**: Push to `main` triggers the deployment notification. | ||
|
|
||
| ## 🛠️ Local Testing (Minikube/Kind) | ||
| To test the manifests locally: | ||
|
|
||
| ```bash | ||
| # Create namespace | ||
| kubectl create namespace system-craft | ||
|
|
||
| # Apply manifests | ||
| kubectl apply -f kubernetes/ -n system-craft | ||
|
|
||
| # Verify pods | ||
| kubectl get pods -n system-craft | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| *This completes the full cycle: Dev -> Containerize -> Proxy -> Orchestrate.* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: system-craft | ||
| labels: | ||
| app: system-craft | ||
| spec: | ||
| replicas: 3 | ||
| selector: | ||
| matchLabels: | ||
| app: system-craft | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: system-craft | ||
| spec: | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| containers: | ||
| - name: system-craft | ||
| image: ghcr.io/shashank0701-byte/system-craft/systemcraft-web:latest | ||
| ports: | ||
| - containerPort: 3000 | ||
| resources: | ||
| limits: | ||
| cpu: "500m" | ||
| memory: "512Mi" | ||
| requests: | ||
| cpu: "250m" | ||
| memory: "256Mi" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: ["ALL"] | ||
| env: | ||
| - name: NODE_ENV | ||
| value: "production" | ||
| - name: MONGODB_URL | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: mongodb-secret | ||
| key: uri |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: system-craft-ingress | ||
| annotations: | ||
| kubernetes.io/ingress.class: nginx | ||
| nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
| spec: | ||
| tls: | ||
| - hosts: | ||
| - system-craft-kohl.vercel.app | ||
| secretName: system-craft-tls | ||
| rules: | ||
| - host: system-craft-kohl.vercel.app | ||
| http: | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: system-craft-service | ||
| port: | ||
| number: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: system-craft-service | ||
| spec: | ||
| selector: | ||
| app: system-craft | ||
| ports: | ||
| - protocol: TCP | ||
| port: 80 | ||
| targetPort: 3000 | ||
| type: ClusterIP |
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fix typo in manifest description.
Line 6 has a spelling error:
Defing→Defining.✍️ Suggested doc fix
📝 Committable suggestion
🤖 Prompt for AI Agents