{"id":18798982,"url":"https://github.com/cncf/devstats-k8s-lf","last_synced_at":"2025-04-13T17:30:27.960Z","repository":{"id":72000119,"uuid":"176990572","full_name":"cncf/devstats-k8s-lf","owner":"cncf","description":"📈DevStats kubernetes deployment for LF projects (bare kubernetes, no Helm packaging) - this also includes kubernetes util scripts to manipulate DevStats deployment","archived":false,"fork":false,"pushed_at":"2024-12-18T14:43:01.000Z","size":135,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T08:11:39.518Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cncf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-03-21T17:08:42.000Z","updated_at":"2024-12-18T14:43:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"164ec03d-6172-452b-ba0e-d59372fadfe0","html_url":"https://github.com/cncf/devstats-k8s-lf","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/cncf%2Fdevstats-k8s-lf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncf%2Fdevstats-k8s-lf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncf%2Fdevstats-k8s-lf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncf%2Fdevstats-k8s-lf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cncf","download_url":"https://codeload.github.com/cncf/devstats-k8s-lf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752243,"owners_count":21156057,"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-07T22:13:38.282Z","updated_at":"2025-04-13T17:30:27.929Z","avatar_url":"https://github.com/cncf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# devstats-k8s-lf\n\nDevStats kubernetes deployment for LF projects (bare kubernetes, no Helm packaging) - this also includes kubernetes util scripts to manipulate DevStats deployment\n\n\n# Set default namespace\n\nYou should set namespace to 'devstats' first: `./switch_namespace.sh devstats`.\n\n\n# Images\n\nSee `github.com/cncf/devstats-docker-images` for the info about how to build docker images used by this deployment. You can also test them there.\n\n\n# Debugging running pods\n\nYou can run shell inside the running container:\n\n- To bash into a running pod do: `./util/pod_shell.sh pod-name`, where pod name can be for example: `devstats-provision-cncf-1550826466080940119`.\n\n\n# Secrets\n\nSecret data is not checked-in into the repository. For each file in `./kubernetes/secrets/*.secret.example` you need to create your own `./kubernetes/secrets/*.secret` and propagate into your cluser.\n\nOnce all those files are created, use `./kubernetes/create_secrets.sh` script to propagate them into you Kubernetes cluster.\n\nPlease note that `vi` automatically adds new line to all text files, to remove it run `truncate -s -1` on a saved file.\n\n\n# Test pods before actually running them\n\nThis is optional (it starts real containers with their command replaced with the shell and then you can use `./kubernetes/pod_shell.sh` to shell into them and run their actual command manually):\n\n- To dry-run manifests against your Kubernetes cluster, run: `./kubernetes/dryrun_manifest.sh ./kubernetes/manifests/*.yaml`. This will show the final manifest and check if it can be applied.\n- Prepend `./kubernetes/apply_manifest.sh` call with `SLEEP=1` to apply a manifest with its command replaced with `sleep 36000`. You can the use `./util/pod_shell.sh` to bash into that container running forever sleep and check its state. You should delete that pod after testing it. It will terminate automatically after 10 hours (36000s).\n- Observe environment via: `env | grep -E '(GHA2DB|^PG_|^ES_|^ONLY|INIT|^PROJ)' | sort`. See PV mounts: `df -h`. Delete pod `kubectl delete pod pod-name`.\n\n\n# Deploy on Kubernetes\n\n- Run `./kubernetes/apply_manifest.sh ./kubernetes/manifests/devstats-pvc.yaml` to create presistent volume and persisten volume claim for git repository clones storage. This must be done first.\n- You need all secrets to be populated via `./kubernetes/create-secrets.sh`. There is a `./kubernetes/manifests/devstats-secrets.yaml` file, but all secret values are `eHh4Cg==` here (this is `xxx` base 64 encoded).\n- Run `PROJ=... PROJDB=... PROJREPO=... INIT=1 ./kubernetes/apply_manifest.sh ./kubernetes/manifests/devstats-provision.yaml` to do an initial Kubernetes deployment (bootstraps logs database, users and deploys first project). You can use `ONLYINIT=1` to test bootstraping logs database and users only - that will skip actual first project provision.\n- Run `PROJ=... PROJDB=... PROJREPO=... ./kubernetes/apply_manifest.sh ./kubernetes/manifests/devstats-provision.yaml` to deploy any next project.\n- Run `ONLY=projname CRON='8 * * * *' ./kubernetes/apply_manifest.sh ./kubernetes/manifests/devstats-hourly-sync.yaml` to create a hourly sync of `projname` at every hour and 8 minutes.\n- Run `PROJ=... PROJDB=... ICON=... ORGNAME=... ./kubernetes/apply_manifest.sh ./kubernetes/manifests/devstats-grafana.yaml` to create a Grafana UI pod for a given project.\n- Run `PROJ=... ./kubernetes/apply_manifest.sh ./kubernetes/manifests/devstats-service.yaml` to expose Grafana via LoadBalancer service.\n- To provision all projects do: `./kubernetes/provision_them_all.sh`, then wait for all `devstats-provision-...` pods to finish. This can take a *LOT* of time.\n- To setup hourly sync for all currently defined project just run: `./kubernetes/cron_them_all.sh`. Do it after all initial provisioning is finished (not needed but recommended, otherwise cronjobs will wait).\n- To create all Grafanas use: `./kubernetes/grafanas_for_all.sh`. Do it after all initial provisioning is finished (not needed but recommended, otherwise Grafanas will access not fully provisioned databases and some dashboards may not work) until ready).\n- To create LoadBalancer services for all Grafanas use: `./kubernetes/services_for_all.sh`. Do it after grafanas are created, otherwise services will point to voids.\n- To cleanup completed pod, use: `./kubernetes/cleanup_completed_pods.sh`.\n- To delete all DevStats cron jobs run: `./kubernetes/delete_devstats_cron_jobs.sh`.\n\n\n# Helm\n\n- To delete and recreate cron jobs run: `./kubernetes/recreate_cron_jobs.sh`. This uses Helm chart `github.com/cncf/devstats-helm-lf`.\n- Many other examples described in `github.com/cncf/devstats-helm-lf`.\n\n\n# New projects\n\nSee `github.com/cncf/devstats-docker-images/NEW_PROJECT.md`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncf%2Fdevstats-k8s-lf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcncf%2Fdevstats-k8s-lf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncf%2Fdevstats-k8s-lf/lists"}