{"id":19002309,"url":"https://github.com/linkerd/linkerd-inject","last_synced_at":"2025-04-16T22:31:36.346Z","repository":{"id":57704018,"uuid":"96157886","full_name":"linkerd/linkerd-inject","owner":"linkerd","description":"For transparent proxy injection","archived":true,"fork":false,"pushed_at":"2018-05-16T00:03:54.000Z","size":9894,"stargazers_count":25,"open_issues_count":2,"forks_count":5,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T17:35:38.909Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-03T23:35:25.000Z","updated_at":"2025-03-24T02:30:23.000Z","dependencies_parsed_at":"2022-09-26T21:12:04.475Z","dependency_job_id":null,"html_url":"https://github.com/linkerd/linkerd-inject","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkerd%2Flinkerd-inject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkerd%2Flinkerd-inject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkerd%2Flinkerd-inject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkerd%2Flinkerd-inject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkerd","download_url":"https://codeload.github.com/linkerd/linkerd-inject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249283008,"owners_count":21243658,"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-11-08T18:14:36.720Z","updated_at":"2025-04-16T22:31:33.309Z","avatar_url":"https://github.com/linkerd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Transparent proxy injection\n\nWe can do transparent proxying of requests to linkerd via `iptables` rules.\n\nThis script injects an `initContainer` into the user's k8s config. This\n`initContainer` sets up `iptables` rules for tranparent proxying of requests to a\n[Daemonset linkerd](https://github.com/linkerd/linkerd-examples/blob/master/k8s-daemonset/k8s/linkerd.yml).\n\nIt injects the following initContainer (which you could add to your config\nmanually if you would rather not use the script). The script uses the\n`pod.beta.kubernetes.io/init-containers` annotation, which you would need to use\nif you are running a version of the Kubernetes Apiserver before 1.6.\n\n```\ninitContainers:\n- name: init-linkerd\n  image: linkerd/istio-init:v1\n  env:\n  - name: NODE_NAME\n    valueFrom:\n      fieldRef:\n        fieldPath: spec.nodeName\n  args:\n    - -p\n    - \"4140\" # port of the Daemonset linkerd's incoming router\n    - -s\n    - \"L5D\" # linkerd Daemonset service name, uppercased\n    - -m\n    - \"false\" # set to true if running in minikube\n  imagePullPolicy: IfNotPresent\n  securityContext:\n    capabilities:\n      add:\n      - NET_ADMIN\n    privileged: false # set to true for SELinux\n```\n\nIt is based on Istio's method of\n[injecting sidecars](https://github.com/istio/pilot/blob/pilot-0-2-0-working/doc/proxy-injection.md).\nIdeally this code would go somewhere with the istioctl code, and reuse that code\nmore directly, but this seems to be in transit right now. This `prepare_proxy.sh`\nsets up iptables rules for transparently proxying requests to a Daemonset linkerd\n(rather than a sidecar proxy, which Istio\n[currently uses](https://github.com/istio/pilot/blob/pilot-0-2-0-working/docker/prepare_proxy.sh)).\n\n## Usage\n\nInstall linkerd-inject\n```\ngo get github.com/linkerd/linkerd-inject\n```\n\nInject init container into your yaml and apply.\nIf you're using minikube, see [example/](example/README.md) for minikube instructions.\nIf you're running in OpenShift (SELinux), you'll need to use `-privileged`.\n\n```\nkubectl apply -f \u003c(linkerd-inject -f example/hello-world.yml -linkerdPort 4140)\n```\n\nTo see output of script before applying:\n```\nlinkerd-inject -f example/hello-world.yml -o result.yml -linkerdPort 4140\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkerd%2Flinkerd-inject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkerd%2Flinkerd-inject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkerd%2Flinkerd-inject/lists"}