{"id":13461339,"url":"https://github.com/stefanprodan/podinfo","last_synced_at":"2025-05-14T09:03:52.139Z","repository":{"id":37759278,"uuid":"116392590","full_name":"stefanprodan/podinfo","owner":"stefanprodan","description":"Go microservice template for Kubernetes","archived":false,"fork":false,"pushed_at":"2025-04-16T23:23:48.000Z","size":12038,"stargazers_count":5595,"open_issues_count":28,"forks_count":1797,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-05-14T09:02:13.096Z","etag":null,"topics":["cuelang","e2e-testing","gitops","golang","helm","kubernetes","kustomize","microservice"],"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/stefanprodan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"stefanprodan"}},"created_at":"2018-01-05T14:19:59.000Z","updated_at":"2025-05-13T23:58:20.000Z","dependencies_parsed_at":"2023-02-18T06:16:01.190Z","dependency_job_id":"aaa1ab6a-94d6-41e4-afe8-577f8bd4d974","html_url":"https://github.com/stefanprodan/podinfo","commit_stats":{"total_commits":761,"total_committers":61,"mean_commits":"12.475409836065573","dds":"0.18265440210249673","last_synced_commit":"6b7aab8a10d6ee8b895b0a5048f4ab0966ed29ff"},"previous_names":["stefanprodan/k8s-podinfo"],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanprodan%2Fpodinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanprodan%2Fpodinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanprodan%2Fpodinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanprodan%2Fpodinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanprodan","download_url":"https://codeload.github.com/stefanprodan/podinfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110373,"owners_count":22016391,"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":["cuelang","e2e-testing","gitops","golang","helm","kubernetes","kustomize","microservice"],"created_at":"2024-07-31T11:00:35.080Z","updated_at":"2025-05-14T09:03:52.053Z","avatar_url":"https://github.com/stefanprodan.png","language":"Go","readme":"# podinfo\n\n[![e2e](https://github.com/stefanprodan/podinfo/workflows/e2e/badge.svg)](https://github.com/stefanprodan/podinfo/blob/master/.github/workflows/e2e.yml)\n[![test](https://github.com/stefanprodan/podinfo/workflows/test/badge.svg)](https://github.com/stefanprodan/podinfo/blob/master/.github/workflows/test.yml)\n[![cve-scan](https://github.com/stefanprodan/podinfo/workflows/cve-scan/badge.svg)](https://github.com/stefanprodan/podinfo/blob/master/.github/workflows/cve-scan.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/stefanprodan/podinfo)](https://goreportcard.com/report/github.com/stefanprodan/podinfo)\n[![Docker Pulls](https://img.shields.io/docker/pulls/stefanprodan/podinfo)](https://hub.docker.com/r/stefanprodan/podinfo)\n\nPodinfo is a tiny web application made with Go that showcases best practices of running microservices in Kubernetes.\nPodinfo is used by CNCF projects like [Flux](https://github.com/fluxcd/flux2) and [Flagger](https://github.com/fluxcd/flagger)\nfor end-to-end testing and workshops.\n\nSpecifications:\n\n* Health checks (readiness and liveness)\n* Graceful shutdown on interrupt signals\n* File watcher for secrets and configmaps\n* Instrumented with Prometheus and Open Telemetry\n* Structured logging with zap \n* 12-factor app with viper\n* Fault injection (random errors and latency)\n* Swagger docs\n* Timoni, Helm and Kustomize installers\n* End-to-End testing with Kubernetes Kind and Helm\n* Multi-arch container image with Docker buildx and GitHub Actions\n* Container image signing with Sigstore cosign\n* SBOMs and SLSA Provenance embedded in the container image\n* CVE scanning with Trivy\n\nWeb API:\n\n* `GET /` prints runtime information\n* `GET /version` prints podinfo version and git commit hash \n* `GET /metrics` return HTTP requests duration and Go runtime metrics\n* `GET /healthz` used by Kubernetes liveness probe\n* `GET /readyz` used by Kubernetes readiness probe\n* `POST /readyz/enable` signals the Kubernetes LB that this instance is ready to receive traffic\n* `POST /readyz/disable` signals the Kubernetes LB to stop sending requests to this instance\n* `GET /status/{code}` returns the status code\n* `GET /panic` crashes the process with exit code 255\n* `POST /echo` forwards the call to the backend service and echos the posted content \n* `GET /env` returns the environment variables as a JSON array\n* `GET /headers` returns a JSON with the request HTTP headers\n* `GET /delay/{seconds}` waits for the specified period\n* `POST /token` issues a JWT token valid for one minute `JWT=$(curl -sd 'anon' podinfo:9898/token | jq -r .token)`\n* `GET /token/validate` validates the JWT token `curl -H \"Authorization: Bearer $JWT\" podinfo:9898/token/validate`\n* `GET /configs` returns a JSON with configmaps and/or secrets mounted in the `config` volume\n* `POST/PUT /cache/{key}` saves the posted content to Redis\n* `GET /cache/{key}` returns the content from Redis if the key exists\n* `DELETE /cache/{key}` deletes the key from Redis if exists\n* `POST /store` writes the posted content to disk at /data/hash and returns the SHA1 hash of the content\n* `GET /store/{hash}` returns the content of the file /data/hash if exists\n* `GET /ws/echo` echos content via websockets `podcli ws ws://localhost:9898/ws/echo`\n* `GET /chunked/{seconds}` uses `transfer-encoding` type `chunked` to give a partial response and then waits for the specified period\n* `GET /swagger.json` returns the API Swagger docs, used for Linkerd service profiling and Gloo routes discovery\n\ngRPC API:\n\n* `/grpc.health.v1.Health/Check` health checking\n* `/grpc.EchoService/Echo` echos the received content\n* `/grpc.VersionService/Version` returns podinfo version and Git commit hash\n* `/grpc.DelayService/Delay` returns a successful response after the given seconds in the body of gRPC request\n* `/grpc.EnvService/Env` returns environment variables as a JSON array\n* `/grpc.HeaderService/Header` returns the headers present in the gRPC request. Any custom header can also be given as a part of request and that can be returned using this API\n* `/grpc.InfoService/Info` returns the runtime information\n* `/grpc.PanicService/Panic` crashes the process with gRPC status code as '1 CANCELLED'\n* `/grpc.StatusService/Status` returns the gRPC Status code given in the request body\n* `/grpc.TokenService/TokenGenerate` issues a JWT token valid for one minute\n* `/grpc.TokenService/TokenValidate` validates the JWT token\n\nWeb UI:\n\n![podinfo-ui](https://raw.githubusercontent.com/stefanprodan/podinfo/gh-pages/screens/podinfo-ui-v3.png)\n\nTo access the Swagger UI open `\u003cpodinfo-host\u003e/swagger/index.html` in a browser.\n\n### Guides\n\n* [Getting started with Timoni](https://timoni.sh/quickstart/)\n* [Getting started with Flux](https://fluxcd.io/flux/get-started/)\n* [Progressive Deliver with Flagger and Linkerd](https://docs.flagger.app/tutorials/linkerd-progressive-delivery)\n* [Automated canary deployments with Kubernetes Gateway API](https://docs.flagger.app/tutorials/gatewayapi-progressive-delivery)\n\n### Install\n\nTo install Podinfo on Kubernetes the minimum required version is **Kubernetes v1.23**.\n\n#### Timoni\n\nInstall with [Timoni](https://timoni.sh):\n\n```bash\ntimoni -n default apply podinfo oci://ghcr.io/stefanprodan/modules/podinfo\n```\n\n#### Helm\n\nInstall from github.io:\n\n```bash\nhelm repo add podinfo https://stefanprodan.github.io/podinfo\n\nhelm upgrade --install --wait frontend \\\n--namespace test \\\n--set replicaCount=2 \\\n--set backend=http://backend-podinfo:9898/echo \\\npodinfo/podinfo\n\nhelm test frontend --namespace test\n\nhelm upgrade --install --wait backend \\\n--namespace test \\\n--set redis.enabled=true \\\npodinfo/podinfo\n```\n\nInstall from ghcr.io:\n\n```bash\nhelm upgrade --install --wait podinfo --namespace default \\\noci://ghcr.io/stefanprodan/charts/podinfo\n```\n\n#### Kustomize\n\n```bash\nkubectl apply -k github.com/stefanprodan/podinfo//kustomize\n```\n\n#### Docker\n\n```bash\ndocker run -dp 9898:9898 stefanprodan/podinfo\n```\n\n### Continuous Delivery\n\nIn order to install podinfo on a Kubernetes cluster and keep it up to date with the latest\nrelease in an automated manner, you can use [Flux](https://fluxcd.io).\n\nInstall the Flux CLI on MacOS and Linux using Homebrew:\n\n```sh\nbrew install fluxcd/tap/flux\n```\n\nInstall the Flux controllers needed for Helm operations:\n\n```sh\nflux install \\\n--namespace=flux-system \\\n--network-policy=false \\\n--components=source-controller,helm-controller\n```\n\nAdd podinfo's Helm repository to your cluster and\nconfigure Flux to check for new chart releases every ten minutes:\n\n```sh\nflux create source helm podinfo \\\n--namespace=default \\\n--url=https://stefanprodan.github.io/podinfo \\\n--interval=10m\n```\n\nCreate a `podinfo-values.yaml` file locally:\n\n```sh\ncat \u003e podinfo-values.yaml \u003c\u003cEOL\nreplicaCount: 2\nresources:\n  limits:\n    memory: 256Mi\n  requests:\n    cpu: 100m\n    memory: 64Mi\nEOL\n```\n\nCreate a Helm release for deploying podinfo in the default namespace:\n\n```sh\nflux create helmrelease podinfo \\\n--namespace=default \\\n--source=HelmRepository/podinfo \\\n--release-name=podinfo \\\n--chart=podinfo \\\n--chart-version=\"\u003e5.0.0\" \\\n--values=podinfo-values.yaml\n```\n\nBased on the above definition, Flux will upgrade the release automatically\nwhen a new version of podinfo is released. If the upgrade fails, Flux\ncan [rollback](https://toolkit.fluxcd.io/components/helm/helmreleases/#configuring-failure-remediation)\nto the previous working version.\n\nYou can check what version is currently deployed with:\n\n```sh\nflux get helmreleases -n default\n```\n\nTo delete podinfo's Helm repository and release from your cluster run:\n\n```sh\nflux -n default delete source helm podinfo\nflux -n default delete helmrelease podinfo\n```\n\nIf you wish to manage the lifecycle of your applications in a **GitOps** manner, check out\nthis [workflow example](https://github.com/fluxcd/flux2-kustomize-helm-example)\nfor multi-env deployments with Flux, Kustomize and Helm.\n","funding_links":["https://github.com/sponsors/stefanprodan"],"categories":["Software Packages","Go","Uncategorized","HarmonyOS","kubernetes","microservice","Go Tools","软件包"],"sub_categories":["DevOps Tools","Uncategorized","Windows Manager","DevOps 工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanprodan%2Fpodinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanprodan%2Fpodinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanprodan%2Fpodinfo/lists"}