{"id":20806333,"url":"https://github.com/nodesource/nsolid-kubernetes","last_synced_at":"2025-10-30T02:09:58.050Z","repository":{"id":54974716,"uuid":"54580034","full_name":"nodesource/nsolid-kubernetes","owner":"nodesource","description":"Using N|Solid, the Enterprise Node Platform from NodeSource with Kubernetes","archived":false,"fork":false,"pushed_at":"2025-03-04T19:25:39.000Z","size":997,"stargazers_count":85,"open_issues_count":0,"forks_count":44,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-03-30T02:06:16.064Z","etag":null,"topics":["containers","devops","docker","javascript","kubernetes","node","nodejs","nodesource","nsolid","orchestration"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodesource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-23T17:32:26.000Z","updated_at":"2025-03-04T19:25:43.000Z","dependencies_parsed_at":"2022-08-14T07:50:52.415Z","dependency_job_id":null,"html_url":"https://github.com/nodesource/nsolid-kubernetes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnsolid-kubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnsolid-kubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnsolid-kubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fnsolid-kubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodesource","download_url":"https://codeload.github.com/nodesource/nsolid-kubernetes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","devops","docker","javascript","kubernetes","node","nodejs","nodesource","nsolid","orchestration"],"created_at":"2024-11-17T19:19:21.646Z","updated_at":"2025-10-17T17:19:31.103Z","avatar_url":"https://github.com/nodesource.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![N|Solid, Docker, and Kubernetes](docs/images/container-banner.jpg)](https://nodesource.com/products/nsolid)\n\n# N|Solid Kubernetes Guide\n\nThis repository is an open-source guide for building and deploying a Next.js 15 project using N|Solid Docker images. N|Solid is an enterprise fork of Node.js with integrated monitoring that connects to the N|Solid Console. Although you can run N|Solid independently, the full benefits are unlocked when it is connected to the console.\n\nThe guide covers:\n\n- Building Docker images (Alpine and Debian)\n- CI/CD pipelines using GitHub Actions\n- A sample Next.js “Hello World” application\n- Basic Kubernetes configuration for deployment\n- Configuring environment variables and secrets\n\n## Repository Structure\n\n- **docker/**  \n  Contains Dockerfiles for building the images:\n  - `Dockerfile.alpine` – Builds the Alpine-based image.\n  - `Dockerfile.debian` – Builds the Debian-based image.\n- **k8s/**  \n  Contains Kubernetes manifests used for deployment:\n  - Deployment, Service, Ingress, Secrets, ConfigMaps, and Persistent Volumes examples.\n- **sample-app/**  \n  A sample Next.js application (Hello World) to demonstrate deployment.\n- **.github/workflows/**  \n  Contains CI/CD pipeline files:\n  - `alpine-build-amd.yml` – Builds the Alpine image for AMD64.\n  - `alpine-build-arm.yml` – Builds the Alpine image for ARM64.\n  - `debian-build-amd.yml` – Builds the Debian image for AMD64.\n  - `debian-build-arm.yml` – Builds the Debian image for ARM64.\n\n## Building the Docker Images\n\n### GitHub Actions Pipelines\n\nSeparate GitHub Actions workflows are provided to build images for different platforms:\n\n- **For Alpine-based images:**  \n  Use `alpine-build-amd.yml` for AMD64 and `alpine-build-arm.yml` for ARM64.\n\n- **For Debian-based images:**  \n  Use `debian-build-amd.yml` for AMD64 and `debian-build-arm.yml` for ARM64.\n\nEach workflow uses the appropriate Dockerfile (located in the `docker/` folder) and builds the image for the specified architecture.\n\n### Local Build\n\nTo build locally, navigate to the repository root and run:\n\nFor Debian:\n\n```bash\ndocker build -t sample-app:debian -f docker/Dockerfile.debian .\n```\n\nFor Alpine:\n\n```bash\ndocker build -t sample-app:alpine -f docker/Dockerfile.alpine .\n```\n\n## Deploying on Kubernetes\n\nThe `k8s/` folder contains basic configuration files to deploy the application. These include:\n\n- **Deployment YAML:** Defines the N|Solid deployment with environment variables and secrets.\n- **Service YAML:** Exposes the deployment internally in the cluster.\n- **Ingress YAML:** Provides external access to the service.\n- **Secrets \u0026 ConfigMaps:** Manage sensitive values (like `nsolid_saas`) and application settings.\n\n### Example Deployment\n\nBelow is a sample Kubernetes Deployment manifest that sets up N|Solid. It configures two environment variables: `NSOLID_APPNAME` for the application name, and `NSOLID_SAAS`, which is injected from a secret called `nsolid-saas-secret`.\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nsolid-deployment\n  labels:\n    app: nsolid\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: nsolid\n  template:\n    metadata:\n      labels:\n        app: nsolid\n    spec:\n      securityContext:\n        runAsNonRoot: true\n      containers:\n        - name: nsolid\n          image: yourrepo/nsolid:latest\n          ports:\n            - containerPort: 3000\n          env:\n            - name: NSOLID_APPNAME\n              value: \"Sample App\"\n            - name: NSOLID_TAGS\n              value: \"production,nextjs,nsolid-hydrogen\"\n            - name: NSOLID_SAAS\n              valueFrom:\n                secretKeyRef:\n                  name: nsolid-saas-secret\n                  key: nsolid_saas\n          resources:\n            requests:\n              cpu: \"100m\"\n              memory: \"128Mi\"\n            limits:\n              cpu: \"500m\"\n              memory: \"512Mi\"\n          livenessProbe:\n            httpGet:\n              path: /health\n              port: 3000\n            initialDelaySeconds: 30\n            periodSeconds: 10\n          readinessProbe:\n            httpGet:\n              path: /health\n              port: 3000\n            initialDelaySeconds: 10\n            periodSeconds: 5\n      terminationGracePeriodSeconds: 30\n```\n\n### Creating the Secret\n\nBefore deploying, create the secret that holds the `nsolid_saas` value. Replace `\u003cbase64-encoded-secret\u003e` with your base64-encoded value.\n\n```bash\nkubectl create secret generic nsolid-saas-secret --from-literal=nsolid_saas=\u003cyour-secret-value\u003e\n```\n\n## How to Deploy\n\n1. Build your Docker image (either via GitHub Actions or locally).\n2. Push the image to your container registry if deploying to a cloud cluster.\n3. Apply the Kubernetes manifests from the `k8s/` folder:\n   ```bash\n   kubectl apply -f k8s/\n   ```\n4. Monitor the deployment and check the pods:\n   ```bash\n   kubectl get pods --namespace=default\n   ```\n\n## Monitoring with N|Solid Console SaaS\n\nN|Solid provides integrated monitoring. You can create a free account on the N|Solid Console SaaS to monitor your processes:\n\n[Sign up for a free N|Solid Console account](https://accounts.nodesource.com/sign-up)\n\n## About N|Solid\n\nN|Solid is an enterprise version of Node.js with integrated monitoring and enhanced security. It connects to the N|Solid Console to provide real-time insights, process management, and more. Although it can be used as a standalone runtime, its full potential is realized when connected to the console. For more details, visit [nodesource.com](https://nodesource.com).\n\n## License\n\nThis repository is licensed under the MIT License. See [LICENSE.md](LICENSE.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Fnsolid-kubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodesource%2Fnsolid-kubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Fnsolid-kubernetes/lists"}