{"id":13522963,"url":"https://github.com/datreeio/kubectl-datree","last_synced_at":"2025-04-12T00:00:25.990Z","repository":{"id":43868189,"uuid":"452665574","full_name":"datreeio/kubectl-datree","owner":"datreeio","description":"A kubectl plugin that extends Datree to test resources within the cluster","archived":false,"fork":false,"pushed_at":"2022-10-25T11:31:51.000Z","size":4638,"stargazers_count":49,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-22T12:32:54.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/datreeio.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}},"created_at":"2022-01-27T12:02:00.000Z","updated_at":"2024-04-26T07:55:28.000Z","dependencies_parsed_at":"2023-01-20T07:46:41.647Z","dependency_job_id":null,"html_url":"https://github.com/datreeio/kubectl-datree","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2Fkubectl-datree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2Fkubectl-datree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2Fkubectl-datree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2Fkubectl-datree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datreeio","download_url":"https://codeload.github.com/datreeio/kubectl-datree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497805,"owners_count":21113984,"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":[],"created_at":"2024-08-01T06:00:54.082Z","updated_at":"2025-04-12T00:00:25.936Z","avatar_url":"https://github.com/datreeio.png","language":"Shell","funding_links":[],"categories":["kubectl Plugins","💻 Projects"],"sub_categories":["Installing plugins via awesome-kubectl-plugins"],"readme":"# kubectl-datree\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/docs-up--to--date-green\" target=\"https://hub.datree.io/kubectl-plugin/#utm_source=github\u0026utm_medium=organic_oss\"\u003e \u003cimg src=\"https://img.shields.io/badge/Supported%20OS-Linux%2FMacOS-green\" target=\"_blank\"\u003e \u003cimg src=\"https://img.shields.io/github/v/tag/datreeio/kubectl-datree\" target=\"https://github.com/datreeio/kubectl-datree/releases\"\u003e \u003cimg src=\"https://img.shields.io/github/issues-raw/datreeio/kubectl-datree\" target=\"https://github.com/datreeio/kubectl-datree/issues\"\u003e\n\u003c/p\u003e\n\n## Overview \n\nThis **kubectl plugin** extends the [Datree CLI's](https://github.com/datreeio/datree) capabilities to allow scanning resources **within your cluster** for misconfigurations.  \n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://user-images.githubusercontent.com/19731161/154030200-e6ea64bc-d630-41e2-ac68-557a566d6206.png\" alt=\"Datree-kubectl\" width=\"80%\"\u003e\n\u003c/p\u003e\n\n\n\u003cbr/\u003e\n\n## Use cases\n- Reveal unknown configuration issues  \n- Get ready for future k8s version upgrade  \n- Enforce standards and best practices    \n\n\u003cbr/\u003e\n\n## Supported Platforms\nThis plugin supports **MacOS** and **Linux**.\n\n\u003cbr/\u003e\n\n## Installation\n### Via Krew\n1. Install [krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/)\n2. Install the datree plugin:\n```\nkubectl krew install datree\n```\n### Manual installation\n1. [Download the installation script](https://github.com/datreeio/kubectl-datree/releases/latest/download/manual_install.sh) from this repository.\n2. Open a terminal at the location of the script. \n3. Run ```/bin/sh manual_install.sh``` (an administrator password will be required to complete the installation).  \n\n\u003cbr/\u003e\n\n## Usage\n```\nkubectl datree test [datree CLI args] -- [options]\n```\n**Arguments:**\n```\ndatree CLI args:\n  This plugin supports all of the Datree CLI arguments: https://hub.datree.io/cli-arguments\n\noptions:\n  [-n \u003cnamespace\u003e] Test all resources in the cluster belonging to the specified namespace\n  [--all] Test all resources in the cluster\n      When using '--all', you can specify namespaces to exclude using '--exclude \u003cnamespace\u003e --exclude \u003cnamespace2\u003e'\n  [\u003cresource type\u003e \u003cresource name\u003e \u003cnamespace\u003e] Test a single resource in the cluster\n\n  Running 'kubectl datree test' with no arguments is equivalent to 'kubectl datree test -- -n default'\n```\n\n\u003cbr/\u003e\n\n## Specification\nThe plugin supports the following resource types:\n* Pod\n* Service\n* Ingress\n* Daemonset\n* Deployment\n* Replicaset\n* Statefulset\n* Job\n* CronJob \n* CRD (not the custom resource itself, but its definition)\n\n:warning: When running against a given namespace, only resources of these types will be checked.  \n\n\u003cbr/\u003e\n\n## Examples\nThe following command will fetch all resources within the namespace `exmpl`, and execute a policy check against them:\n```\nkubectl datree test -- -n exmpl\n```\n\nThe following command will fetch the resource of kind **Service** named `myAwesomeService` in namespace `mySweetNamespace`, and execute a policy check against it using k8s schema version 1.22.0:\n```\nkubectl datree test -s \"1.22.0\" -- service myAwesomeService mySweetNamespace\n```  \n\nThe following command will fetch all resources from all namespaces in the cluster except for 'default':\n```\nkubectl datree test -- --all --exclude default\n```\n\n\u003cbr/\u003e\n\n**Example test with no misconfigurations:**  \n![](Resources/test_single_example.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatreeio%2Fkubectl-datree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatreeio%2Fkubectl-datree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatreeio%2Fkubectl-datree/lists"}