{"id":16474554,"url":"https://github.com/luisdavim/configmapper","last_synced_at":"2025-03-23T11:32:52.573Z","repository":{"id":104898859,"uuid":"603712544","full_name":"luisdavim/configmapper","owner":"luisdavim","description":"A k8s sidecar to manage files to and from ConfigMaps or Secrets","archived":false,"fork":false,"pushed_at":"2025-03-23T10:28:56.000Z","size":261,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T11:26:39.181Z","etag":null,"topics":["configmaps","k8s","kubernetes","kubernetes-controller","secrets","sidecar"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luisdavim.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}},"created_at":"2023-02-19T11:04:51.000Z","updated_at":"2025-03-23T10:28:59.000Z","dependencies_parsed_at":"2023-10-01T21:33:06.965Z","dependency_job_id":"19ad641d-9677-4917-b971-09b242fc785e","html_url":"https://github.com/luisdavim/configmapper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisdavim%2Fconfigmapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisdavim%2Fconfigmapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisdavim%2Fconfigmapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisdavim%2Fconfigmapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luisdavim","download_url":"https://codeload.github.com/luisdavim/configmapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097158,"owners_count":20560311,"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":["configmaps","k8s","kubernetes","kubernetes-controller","secrets","sidecar"],"created_at":"2024-10-11T12:32:52.474Z","updated_at":"2025-03-23T11:32:52.563Z","avatar_url":"https://github.com/luisdavim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConfigMapper\n\nConfigMapper is meant to be used as a sidecar in a Kubernetes `Pod` to map local files to `ConfigMaps` (or `Secrets`).\nIt can watch files in the local filesystem and when they change, create or update a `ConfigMap` (or `Secret`).\nIt can also watch `ConfigMaps` (or `Secrets`) with a specific label selector and create or update files in the local filesystem.\n\n## Features\n\n- Create or update ConfigMaps or Secrets from local files\n  - Watch the local filesystem to keep ConfigMaps and Secrets up-to-date\n- Create or update ConfigMaps or Secrets from URLs\n  - Poll URLs and store the response in a ConfigMap or Secret\n- Extract files from ConfigMaps and Secrets\n- Update or delete local files when the ConfigMap or Secret changes\n  - Watch ConfigMaps and Secrets to keep local files up-to-date\n- Filter based on labels\n\n## Configuration\n\nThe tool can be configured using a `yaml` file nameed `configmapper.yaml`:\n\n```yaml\n# fileMap maps file paths to k8s ConfigMaps or Secrets\nfileMap:\n  \"/tmp/config.yaml\":\n    type: ConfigMap\n    name: my-cm\n    namespace: foo\n  \"/tmp/secrets.yaml\":\n    type: Secret\n    name: my-secret\n    namespace: foo\n\n# urlMap maps urls to k8s ConfigMaps or Secrets\nurlMap:\n  \"https://fs.example.com/config\":\n    type: ConfigMap\n    name: my-other-cm\n    key: config.json\n    namespace: foo\n    interval: 5m # how frequently to download, defaults to 60s\n  \"https://fs.example.com/secret\":\n    type: Secret\n    name: my-other-secret\n    key: secret.json\n    namespace: foo\n\n# watcher can watch ConfigMap and Secrets to create files in the Pod's FS\nwatcher:\n  configMaps: true\n  secrets: true\n  labelSelector: \"app=foo\"\n  namespaces: foo\n  defaultPath: \"/tmp\"\n```\n\nThe default path is the local filesystem path where files will be created from the observed `ConfigMaps` and `Secrets`, this can be overridden from each `ConfigMap` (or `Secret`) through an annotation, you can also use annotations to tell the tool to ignore specific resources or to ignore deletes, to kepp the generated file after the resource was deleted:\n\n```yaml\nmetadata:\n  annotations:\n    configmapper/target-directory: \"/path/to/target/directory\"\n    configmapper/skip: \"false\"\n    configmapper/ignore-delete: \"false\"\n```\n\nThe watcher config can also be set, using environment variables, for example, `WATCHER_NAMESPACES` can be used to set the list of namespaces to watch.\nEnvironment variables are automatically mapped to the comandline flags and named after the config file paths.\n\n## Usage\n\n```console\n$ configmapper -h\nWatch files, ConfigMaps and Secrets.\n\nUsage:\n  configmapper [flags]\n\nFlags:\n  -c, --config string           config file (default is $HOME/.configmapper.yaml)\n  -p, --default-path string     Default path where to write the files (default \"/tmp\")\n  -h, --help                    help for configmapper\n  -l, --label-selector string   Label selector for configMaps and secrets\n  -n, --namespaces string       Comma separated list of namespaces to watch (defaults to the Pod's namespace)\n      --watch-configmaps        Whether to watch ConfigMaps\n      --watch-secrets           Whether to watch secrets\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisdavim%2Fconfigmapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisdavim%2Fconfigmapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisdavim%2Fconfigmapper/lists"}