{"id":18941445,"url":"https://github.com/mchmarny/grpc-lab","last_synced_at":"2026-04-29T06:37:14.047Z","repository":{"id":38359817,"uuid":"314516694","full_name":"mchmarny/grpc-lab","owner":"mchmarny","description":"Simple gRPC service with HTTP extension based on a proto API definition. Includes deployment to Kubernetes and ingress configuration with TLS certificates. ","archived":false,"fork":false,"pushed_at":"2023-03-16T11:57:20.000Z","size":263,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T18:22:58.166Z","etag":null,"topics":["api","grpc","http","ingress","kubern","protobuf"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mchmarny.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":"2020-11-20T10:12:22.000Z","updated_at":"2023-02-26T19:30:48.000Z","dependencies_parsed_at":"2024-06-20T00:05:20.518Z","dependency_job_id":"fa6cd379-1da9-4947-bc33-78435b4daf9b","html_url":"https://github.com/mchmarny/grpc-lab","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.09999999999999998,"last_synced_commit":"2156fa4eccde42826b1299b340b0de03cd0ad849"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mchmarny/grpc-lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgrpc-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgrpc-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgrpc-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgrpc-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mchmarny","download_url":"https://codeload.github.com/mchmarny/grpc-lab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchmarny%2Fgrpc-lab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262774892,"owners_count":23362403,"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":["api","grpc","http","ingress","kubern","protobuf"],"created_at":"2024-11-08T12:28:05.689Z","updated_at":"2026-04-29T06:37:09.027Z","avatar_url":"https://github.com/mchmarny.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grpc-lab\n\nSimple gRPC service with HTTP extension based on a proto API definition. Includes deployment to Kubernetes and ingress configuration with TLS certificate and custom domain.  \n\n## setup\n\nExport a couple of environment variables to make this readme reproducible:\n\n\u003e Choose domain for which you can control. When setting up ingress, you will have to create DNS entry. \n\n```shell\nexport DOMAIN=\"thingz.io\"\nexport SPACE=\"grpc-lab\"\n```\n\nCreate namespace:\n\n```shell\nkubectl create ns $SPACE\n```\n\n## deployment \n\n\u003e All commands assume you are executing from the root of the repo\n\nApply deployment:\n\n```shell\nkubectl apply -f deployments/app.yaml -n $SPACE\nkubectl rollout status deployment.apps/ping -n $SPACE\n```\n\nCheck pod status: \n\n```shell\nkubectl get pods -n $SPACE\n```\n\nResponse should look something like this:\n\n```shell\nNAME                    READY   STATUS    RESTARTS   AGE\nping-554f558fbd-h96rf   1/1     Running   0          15s\n```\n\nYou can also check server logs:\n\n```shell\nkubectl logs -l app=ping -n $SPACE \n```\n\n## service \n\n```shell\nkubectl apply -f deployments/service.yaml -n $SPACE\n```\n\n```shell\nkubectl get service -n $SPACE\n```\n\nResponse should look something like this: \n\n```shell\nNAME   TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)     AGE\nping   ClusterIP   10.0.31.13   \u003cnone\u003e        50505/TCP   6s\n```\n\n## ingress \n\nCreate TLS certificates:\n\n```shell\ncertbot certonly --manual \\\n                 --preferred-challenges dns \\\n                 -d \"*.${DOMAIN}\" \\\n                 --config-dir ./certs \\\n                 --logs-dir ./certs \\\n                 --work-dir ./certs\n```\n\n\u003e When promoted to configure DNS TXT record, you can check on the propagation status by digging `dig \"_acme-challenge.${DOMAIN}\" TXT`\n\nOnce the certs were generated, create the TLS secret:\n\n```shell\nkubectl create secret tls tls-secret \\\n\t\t--key \"live/${DOMAIN}/privkey.pem\" \\\n\t\t--cert \"live/${DOMAIN}/fullchain.pem\" \\\n\t\t-n $SPACE \n```\n\nCreate gRPC and HTTP ingresses\n\n```shell\nkubectl apply -f deployments/grpc-ingress.yaml -n $SPACE\nkubectl apply -f deployments/http-ingress.yaml -n $SPACE\n```\n\nWatch the ingresses until the `ADDRESS` column gets populated:\n\n```shell\nkubectl get ingress -n $SPACE -w\n```\n\nNow go to the DNS server and create an `A` entry for the `*` and the IP value in the `HOSTS` column. You can test when this gets propagated using `dig gping.thingz.io` for example, or whatever the `HOST` value is.\n\n## test\n\nOnce the DNS is set up, test the gRPC endpoint:\n\n```shell\ngrpcurl -d '{\"id\":\"id1\", \"message\":\"hello\"}' \\\n  gping.thingz.io:443 \\\n  io.thingz.grpc.v1.Service/Ping\n```\n\nResponse should look something like this:\n\n```json\n{\n  \"id\": \"id1\",\n  \"message\": \"hello\",\n  \"reversed\": \"olleh\",\n  \"count\": \"1\",\n  \"created\": \"1606055127674975938\",\n  \"metadata\": {\n    \"address\": \"[::]:50505\"\n  }\n}\n```\n\nNow, test the HTTP endpoint: \n\n```shell\ncurl -i -d '{\"id\":\"id1\", \"message\":\"hello\"}'\\\n      -H \"Content-type: application/json\" \\\n      https://ping.thingz.io:443/v1/ping\n```\n\nAgain, the response should look something like this:\n\n```json\nHTTP/2 200\ndate: Sun, 22 Nov 2020 14:27:20 GMT\ncontent-type: application/json\ncontent-length: 129\ngrpc-metadata-content-type: application/grpc\nstrict-transport-security: max-age=15724800; includeSubDomains\n\n{\n  \"id\":\"id1\",\n  \"message\":\"hello\",\n  \"reversed\":\"olleh\",\n  \"count\":\"4\",\n  \"created\":\"1606055240599449988\",\n  \"metadata\":{\n    \"address\":\"[::]:50505\"\n  }\n}\n```\n\n## cleanup \n\n```shell\nkubectl delete -f deployments/ -n $SPACE\nkubectl delete secret tls-secret -n $SPACE \nkubectl delete ns $SPACE\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchmarny%2Fgrpc-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmchmarny%2Fgrpc-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchmarny%2Fgrpc-lab/lists"}