{"id":13697412,"url":"https://github.com/hasheddan/k8scr","last_synced_at":"2025-03-17T07:31:51.712Z","repository":{"id":42990916,"uuid":"371963089","full_name":"hasheddan/k8scr","owner":"hasheddan","description":"Kubernetes Container Registry","archived":false,"fork":false,"pushed_at":"2022-03-24T12:46:59.000Z","size":66,"stargazers_count":113,"open_issues_count":4,"forks_count":7,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-10-14T20:31:05.614Z","etag":null,"topics":["cli","go","kubectl","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hasheddan.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":"2021-05-29T12:06:43.000Z","updated_at":"2024-06-24T14:35:53.000Z","dependencies_parsed_at":"2022-09-09T22:12:41.165Z","dependency_job_id":null,"html_url":"https://github.com/hasheddan/k8scr","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/hasheddan%2Fk8scr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasheddan%2Fk8scr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasheddan%2Fk8scr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasheddan%2Fk8scr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasheddan","download_url":"https://codeload.github.com/hasheddan/k8scr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221674077,"owners_count":16861764,"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":["cli","go","kubectl","kubernetes"],"created_at":"2024-08-02T18:00:57.716Z","updated_at":"2024-10-27T12:14:57.046Z","avatar_url":"https://github.com/hasheddan.png","language":"Go","funding_links":[],"categories":["Container registry","Go"],"sub_categories":[],"readme":"# k8scr\n\nA `kubectl` plugin for pushing OCI images through the Kubernetes API server.\n\n## Quickstart\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/media/k8scr.svg\"\u003e\n\u003c/p\u003e\n\n1. Build `k8scr`\n\n```\nmake build\n```\n\n2. Move to location in `PATH`\n\n```\nsudo mv ./build/k8scr /usr/local/bin/kubectl-k8scr\n```\n\n3. Deploy simple in-memory registry into cluster\n\n```\nkubectl apply -f distribution.yaml\n```\n\n\u003e Optional: tail logs to observe results of next step with `kubectl logs k8scr -f`.\n\n4. Push image to registry\n\n```\nkubectl k8scr push crossplane/crossplane:v1.2.1\n```\n\n## Usage\n\n```\nUsage: k8scr \u003ccommand\u003e\n\nPush and pull images through the Kubernetes API server.\n\nFlags:\n  -h, --help                   Show context-sensitive help.\n      --kubeconfig=STRING      Override default kubeconfig path.\n  -n, --namespace=\"default\"    Namespace of registry Pod.\n  -r, --registry=\"k8scr\"       Name of registry Pod.\n\nCommands:\n  push \u003cimage\u003e\n\n  pull \u003cimage\u003e\n```\n\n## How Does This Work?\n\n`k8scr` uses\n[`go-containerregistry`](https://github.com/google/go-containerregistry) to push\nand pull images, but passes in an\n[`http.RoundTripper`](https://golang.org/pkg/net/http/#RoundTripper) that\nreconstructs [OCI\ndistribution](https://github.com/opencontainers/distribution-spec/blob/main/spec.md)\ncompliant requests so that they pass through the Kubernetes API server `Pod`\nproxy endpoint, before eventually calling the underlying transport constructed\nfrom a user's `kubeconfig`. This allows for pushing and pulling directly to and\nfrom an OCI image registry running in a Kubernetes cluster without having to\nexpose it publicly or privately. Any user with access to the cluster and\n`pods/proxy` RBAC permissions for the registry `Pod` is able to push and pull.\n\n## What Else Can It Do?\n\nPretty much any of the operations\n[`go-containerregistry`](https://github.com/google/go-containerregistry)\nsupports could also be supported here as the transport is pluggable. I'll likely\nmove it upstream or offer it as a stand-alone library if there is enough\ninterest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasheddan%2Fk8scr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasheddan%2Fk8scr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasheddan%2Fk8scr/lists"}