{"id":34527227,"url":"https://github.com/intelops/k8s-custom-resource-demo","last_synced_at":"2026-05-27T06:32:55.793Z","repository":{"id":149546852,"uuid":"614267603","full_name":"intelops/k8s-custom-resource-demo","owner":"intelops","description":"k8s-custom-resource in nodejs demo","archived":false,"fork":false,"pushed_at":"2026-01-29T05:19:02.000Z","size":217,"stargazers_count":0,"open_issues_count":26,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-29T21:39:40.283Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intelops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-15T08:42:03.000Z","updated_at":"2023-03-16T14:02:17.000Z","dependencies_parsed_at":"2023-07-05T19:18:01.777Z","dependency_job_id":"1339355c-bac9-4d4f-8513-92f2e0a6022b","html_url":"https://github.com/intelops/k8s-custom-resource-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/intelops/k8s-custom-resource-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelops%2Fk8s-custom-resource-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelops%2Fk8s-custom-resource-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelops%2Fk8s-custom-resource-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelops%2Fk8s-custom-resource-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intelops","download_url":"https://codeload.github.com/intelops/k8s-custom-resource-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelops%2Fk8s-custom-resource-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33554780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-12-24T05:23:37.328Z","updated_at":"2026-05-27T06:32:55.784Z","avatar_url":"https://github.com/intelops.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-custom-resource-demo\nDemo for k8s-custom-resource in nodejs.\n\n- To run this code, please clone this repository using below commands.\n```shell\ngit clone https://github.com/intelops/k8s-custom-resource-demo.git\n```\n- Navigate to the directory `k8s-custom-resource-demo`\n```shell\ncd k8s-custom-resource-demo\n```\n### Setup k8s cluster on local computer\n- Make sure you have a valid KubeConfig set in your shell. You can try a KinD cluster for the demo.\n  - Install KinD from https://kind.sigs.k8s.io/docs/user/quick-start/#installing-from-release-binaries\n  - Create KinD cluster https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster\n  - Check if you can access the cluster created in previous step, and you are able to list down the pods.\n- Now, fire below command to apply the employee CRD.\n```shell\nkubectl apply -f crds/\n```\n- Once you have installed the CRD on your cluster, you should be able to list down employees by following command. As there are no employees yet created, you can expect `No resources found` as a response.\n```shell\nkubectl get employees -A\n```\n- Let's try creating an employee manually with below specification. Create mahendra.yaml with below content.\n```yaml\napiVersion: intelops.ai/v1alpha1\nkind: Employee\nmetadata:\n  name: mahendra\n  namespace: employee-system\nspec:\n  department: IT\n  role: developer\n```\n```shell\nkubectl apply -f mahendra.yaml\n```\nThe above command will produce `employee.intelops.ai/mahendra created`. We can now check by listing employees using below command.\n```shell\nkubectl get employees -n employee-system\n```\nThis will produce below output:\n```shell\nNAME       AGE\nmahendra   68s\n```\n### Run code on local\n- Fire `npm install` in the directory.\n- Let's run the code now with below command.\n```shell\nnpm run dev\n```\n- You can try creating an employee by calling POST REST api like below.\n```shell\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"department\":\"IT\",\"name\": \"mahendra\", \"role\": \"developer\"}' http://localhost:5000/employees\n```\n- You should see the below output when the call is successful.\n```json\n{\n   \"employee\":{\n      \"department\":\"IT\",\n      \"name\":\"mahendra\",\n      \"role\":\"developer\"\n   },\n   \"message\":\"mahendra employee is created.\"\n}\n```\n- Similarly, you can call other REST apis, e.g. GET api\n```shell\ncurl -X GET -H \"Content-Type: application/json\"  http://localhost:5000/employees\n```\n- The above command shall produce.\n```json\n[\n   {\n      \"department\":\"IT\",\n      \"name\":\"mahendra\",\n      \"role\":\"developer\"\n   }\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelops%2Fk8s-custom-resource-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintelops%2Fk8s-custom-resource-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelops%2Fk8s-custom-resource-demo/lists"}