{"id":13451867,"url":"https://github.com/qlkube/qlkube","last_synced_at":"2025-10-27T18:30:49.092Z","repository":{"id":38808184,"uuid":"186788111","full_name":"qlkube/qlkube","owner":"qlkube","description":"A GraphQL api for Kubernetes","archived":false,"fork":false,"pushed_at":"2023-02-11T09:15:55.000Z","size":16888,"stargazers_count":115,"open_issues_count":13,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-28T01:11:22.655Z","etag":null,"topics":["graphql","graphql-server","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/qlkube.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}},"created_at":"2019-05-15T08:55:18.000Z","updated_at":"2024-03-20T01:39:23.000Z","dependencies_parsed_at":"2023-02-18T02:31:07.732Z","dependency_job_id":null,"html_url":"https://github.com/qlkube/qlkube","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlkube%2Fqlkube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlkube%2Fqlkube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlkube%2Fqlkube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlkube%2Fqlkube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qlkube","download_url":"https://codeload.github.com/qlkube/qlkube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238536133,"owners_count":19488663,"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":["graphql","graphql-server","kubernetes"],"created_at":"2024-07-31T07:01:05.181Z","updated_at":"2025-10-27T18:30:48.564Z","avatar_url":"https://github.com/qlkube.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003e ⚠️\n\u003e\n\u003e  PLEASE NOTE: this project is no longer actively maintained. It is recommended to use the fork at https://github.com/tmobile/qlkube where active development has been transferred to. \n\u003e\n\u003e ⚠️\n\n# qlkube\n\nqlkube is a graphql api for kubernetes, allowing you to interact with all the features of the Kubernetes api using graphql.\n\nqlkube's graphql schema is dynamically built from the openapi/swagger api specification exposed by the Kubernetes cluster it \nis running in - qlkube should therefore:\n- expose *all* the types and operations from the Kubernetes rest api in its grapqhl api\n- be consistent with the exact Kubernetes api version of your cluster and kept up to date if and when this changes\n\nIn addition to the directly mapped operations from the openapi spec, qlkube provides an 'all' query type that gives a more\nnatural 'kubectl' influenced interface into the api.\n\nqlkube ships with the Apollo GraphQL Playground, so you can play around with the api straight away.\n\n![Demo](docs/qlkube.gif)\n\n## Example Queries\n\nThe 'all' resource is the easiest query type to use for querying kubernetes resources of all types (services, pods, deployments etc).\nqlkube also exposes all the low-level resources autogenerated from the Kubernetes openapi/swagger api - these types are \nnamed exactly as the 'operationId' in the openapi spec, they can therefore seem quite 'low-level' and sometimes unintuitive in comparison. \n\n\u003cdetails\u003e\n \u003csummary\u003eGet all pods in all namespaces\u003c/summary\u003e\n \n This query returns the names and namespaces of all the pods in the cluster.\n (here we use the more friendly 'all' type - you can perform a similar query using `listCoreV1PodForAllNamespaces`)\n \n```graphql\nquery getAllPodsInAllNamespaces {\n  all {\n    pods {\n      items {\n        metadata {\n          name\n          namespace\n        }\n      }\n    }\n  }\n}\n```\n\nOutput:\n\n```json\n{\n  \"data\": {\n    \"all\": {\n      \"pods\": {\n        \"items\": [\n          {\n            \"metadata\": {\n              \"name\": \"alpha-7c766f4fc7-2bh8m\",\n              \"namespace\": \"default\"\n            }\n          },\n          {\n            \"metadata\": {\n              \"name\": \"alpha-7c766f4fc7-hx8ml\",\n              \"namespace\": \"default\"\n            }\n          },\n          {\n            \"metadata\": {\n              \"name\": \"alpha-7c766f4fc7-ztpph\",\n              \"namespace\": \"default\"\n            }\n          },\n          {\n            \"metadata\": {\n              \"name\": \"beta-v1-597679f796-k5gn4\",\n              \"namespace\": \"default\"\n            }\n          },\n          {\n            \"metadata\": {\n              \"name\": \"beta-v1-597679f796-x7hsl\",\n              \"namespace\": \"default\"\n            }\n          },\n          {\n            \"metadata\": {\n              \"name\": \"gamma-79bc488b5b-srmxm\",\n              \"namespace\": \"default\"\n            }\n          },\n...etc\n```\n\u003c/details\u003e \n\n\u003cdetails\u003e\n \u003csummary\u003eGet all pods in a specific namespace\u003c/summary\u003e\n \n This query returns the names, namespaces, creation times and labels of all the pods in the 'default' namespace\n (here we use the more friendly 'all' type - you can perform a similar query using `ioK8sApiCoreV1PodList`)\n \n```graphql\nquery getAllPodsInDefaultNamespace {\n  all(namespace: \"default\") {\n    pods {\n      items {\n        metadata {\n          name\n          namespace\n          creationTimestamp\n          labels\n        }\n      }\n    }\n  }\n}\n```\n\nOutput:\n\n```json\n{\n  \"data\": {\n    \"all\": {\n      \"pods\": {\n        \"items\": [\n          {\n            \"metadata\": {\n              \"name\": \"alpha-7c766f4fc7-2bh8m\",\n              \"namespace\": \"default\",\n              \"creationTimestamp\": \"2019-06-03T15:07:17Z\",\n              \"labels\": {\n                \"app\": \"alpha\",\n                \"appKubernetesIoManagedBy\": \"skaffold-v0.29.0\",\n                \"appId\": \"github.expedia.biz_hotels_alpha\",\n                \"podTemplateHash\": \"7c766f4fc7\",\n                \"skaffoldDevBuilder\": \"local\",\n                \"skaffoldDevCleanup\": \"true\",\n                \"skaffoldDevDeployer\": \"kubectl\",\n                \"skaffoldDevDockerApiVersion\": \"1.39\",\n                \"skaffoldDevTagPolicy\": \"git-commit\",\n                \"skaffoldDevTail\": \"true\",\n                \"version\": \"v1\"\n              }\n            }\n          },\n...etc          \n```\n\u003c/details\u003e \n\n\n\u003cdetails\u003e\n \u003csummary\u003eGet all kubernetes resources with a specific label\u003c/summary\u003e\n\nThis query gets the names of all kubernetes resources (services, deployments, pods etc) that are labelled with label 'app=alpha' \n(roughly equivalent to `kubectl get all -l app=alpha`)\n\n```graphql\nquery allResourcesOfApp {\n  all(labelSelector:\"app=alpha\") { \n    services {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    deployments {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    pods {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    daemonSets {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    replicaSets {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    statefulSets {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    jobs {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n    cronJobs {\n      items {\n        metadata {\n          name\n        }\n      }\n    } \n    namespaces {\n      items {\n        metadata {\n          name\n        }\n      }\n    }\n  }\n}\n```\n\nOutput:\n\n```json\n{\n  \"data\": {\n    \"all\": {\n      \"services\": {\n        \"items\": [\n          {\n            \"metadata\": {\n              \"name\": \"alpha\"\n            }\n          }\n        ]\n      },\n      \"deployments\": {\n        \"items\": [\n          {\n            \"metadata\": {\n              \"name\": \"alpha\"\n            }\n          }\n        ]\n      },\n      \"pods\": {\n        \"items\": [\n          {\n            \"metadata\": {\n              \"name\": \"alpha-7c766f4fc7-2bh8m\"\n            }\n          },\n...etc          \n```\n\n\u003c/details\u003e \n\n## Example Mutations\n\n\u003cdetails\u003e\n \u003csummary\u003eCreate namespace\u003c/summary\u003e\n \nThis mutation creates a new 'bar' namespace. The input json is the escaped version of the following:\n \n```json\n{\n    \"apiVersion\": \"v1\",\n    \"kind\": \"Namespace\",\n    \"metadata\": {\n        \"name\": \"bar\"\n    }\n}\n```\n\nWe output the creation timestamp for the new namesapce.\n  \n```graphql\nmutation createNamespace {\n  createCoreV1Namespace(input: \"{\\\"apiVersion\\\":\\\"v1\\\",\\\"kind\\\":\\\"Namespace\\\",\\\"metadata\\\":{\\\"name\\\":\\\"bar\\\"}}\") {\n    metadata {\n      creationTimestamp\n    }\n  }\n}\n```\n\nOutput:\n\n```json\n{\n  \"data\": {\n    \"createCoreV1Namespace\": {\n      \"metadata\": {\n        \"creationTimestamp\": \"2019-06-03T22:37:02Z\"\n      }\n    }\n  }\n}\n```\n\n\u003c/details\u003e \n\n## Running\n\n### Quickstart\n\nqlkube is designed to be run inside the kubernetes cluster. \nThe included [quickstart.yaml](deployments/quickstart.yaml) manifest should get you started: \n\n```\nkubectl apply -f deployments/quickstart.yaml \nkubectl port-forward svc/qlkube 8080:80\n```\n\nNavigate to http://localhost:8080/ in your browser - this will launch the GraphQL Playground which you can use to interact\nwith the kubernetes api.\n\n### Skaffold\n \nThe included [skaffold.yaml](skaffold.yaml) can be used to build and deploy from source \n(note that in production you may want to restrict the permissive RBAC settings in `deployments/deployment.yaml`).\nN.B. you need [skaffold](https://github.com/GoogleContainerTools/skaffold) installed!\n\n```\nskaffold dev\nkubectl port-forward svc/qlkube 8080:80\n```\n\nNavigate to http://localhost:8080/ in your browser - this will launch the GraphQL Playground which you can use to interact\nwith the kubernetes api.\n\n### Out of cluster (dev mode)\n\nFor playing around locally you can run qlkube from source outside of the cluster. To do this you must first proxy the Kubernetes\napi server to http://localhost:8001:\n\n```\nkubectl proxy\n```\n\nYou can then run qlkube locally, which will connect to the proxied Kubernetes api:\n\n```\nnpm run local\n```\n\nNavigate to http://localhost:8080/ in your browser - this will launch the GraphQL Playground which you can use to interact\nwith the kubernetes api.\n\n## Schema\n\nThe generated graphql schema is served at /schema\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqlkube%2Fqlkube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqlkube%2Fqlkube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqlkube%2Fqlkube/lists"}