{"id":17261330,"url":"https://github.com/takama/k8sapp","last_synced_at":"2025-07-23T02:04:23.225Z","repository":{"id":40589352,"uuid":"101022348","full_name":"takama/k8sapp","owner":"takama","description":"Application template that satisfies the Kubernetes requirements (Golang)","archived":false,"fork":false,"pushed_at":"2018-01-01T12:50:22.000Z","size":636,"stargazers_count":317,"open_issues_count":3,"forks_count":28,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-10T03:55:57.903Z","etag":null,"topics":["helm-charts","kubernetes","requirements","service","template"],"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/takama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-22T04:51:06.000Z","updated_at":"2025-04-08T21:31:27.000Z","dependencies_parsed_at":"2022-09-17T08:50:24.488Z","dependency_job_id":null,"html_url":"https://github.com/takama/k8sapp","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/takama/k8sapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takama%2Fk8sapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takama%2Fk8sapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takama%2Fk8sapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takama%2Fk8sapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takama","download_url":"https://codeload.github.com/takama/k8sapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takama%2Fk8sapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266604009,"owners_count":23954725,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["helm-charts","kubernetes","requirements","service","template"],"created_at":"2024-10-15T07:50:47.804Z","updated_at":"2025-07-23T02:04:23.197Z","avatar_url":"https://github.com/takama.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes application\n\n[![Build Status](https://travis-ci.org/takama/k8sapp.svg?branch=master)](https://travis-ci.org/takama/k8sapp)\n[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/takama/k8sapp/issues)\n[![Go Report Card](https://goreportcard.com/badge/github.com/takama/k8sapp)](https://goreportcard.com/report/github.com/takama/k8sapp)\n[![codecov](https://codecov.io/gh/takama/k8sapp/branch/master/graph/badge.svg)](https://codecov.io/gh/takama/k8sapp)\n\nA sample application that meets the requirements for successful execution in Kubernetes.\n\n![Deploy](docs/img/k8sapp.png)\n\n## Main application criteria\n\n- Implementation of health checks\n- Configuring the application through environment variables\n- Standard logging Interface\n- Processing of system interrupt signals and graceful shutdown\n- Continuous build of the application and whole CI/CD process\n- Helm charts for deploying an application in Kubernetes\n- SSL support in a secure connection, certificate integration\n- Integration of the official package manager `dep`\n- Versioning automation\n\n## Health checks\n\nKubernetes application must have [two health checks](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/) for successful execution of the application. Integrated methods help correctly responding to Kubernetes queries.\n\n## Configuring\n\nThe [twelve-factor](https://12factor.net/config) app stores config in environment variables. The application has a built-in library for automatic recognition and placement the environment variables in `struct` with different types.\n\n## Logging\n\nProvides a standard interface for a multi level logging. There is ability of choice of a logging library that supports a common interface.\n\n```go\ntype Logger interface {\n    Debug(v ...interface{})\n    Debugf(format string, v ...interface{})\n    Info(v ...interface{})\n    Infof(format string, v ...interface{})\n    Warn(v ...interface{})\n    Warnf(format string, v ...interface{})\n    Error(v ...interface{})\n    Errorf(format string, v ...interface{})\n    Fatal(v ...interface{})\n    Fatalf(format string, v ...interface{})\n}\n```\n\nJust make your choice\n\n```go\nfunc Run() (err error) {\n    // log := xlog.New()\n    // log := logrus.New()\n    log := stdlog.New(\u0026logger.Config{\n        Level: logger.LevelDebug,\n        Time:  true,\n        UTC:   true,\n    })\n    ...\n}\n```\n\n## System signals\n\nThe application includes the ability to intercept system signals and transfer control to special methods for graceful shutdown.\n\n```go\ntype Signals struct {\n    shutdown    []os.Signal\n    reload      []os.Signal\n    maintenance []os.Signal\n}\n```\n\n## Build automation\n\nA series of commands for static cross-compilation of the application for any OS. Building the Docker image and loading it into the remote public/private repository. Optimal and compact `docker` image `FROM SCRATCH`\n\n## Testing\n\nThe command `make test` is running set of checks and tests:\n\n- run go tool fmt on package sources\n- run go linter on package sources\n- run go tool vet on packages\n- run tests on package sources excluding vendor\n- compile and check of Helm charts\n\n## Helm charts and Continuous Delivery\n\nPrepared set of basic templates for application deployment in Kubernetes. Only one command `make deploy` is loading the application into Kubernetes. Just wait for the successful result and the application is ready to go.\n\n![Deploy](docs/img/deploy.png)\n\n## SSL support\n\nGenerating certificates to create a secure SSL connection in the `Go` client. Attaching the certificate to the Docker image.\n\n```Dockerfile\nFROM scratch\n\nENV K8SAPP_LOCAL_HOST 0.0.0.0\nENV K8SAPP_LOCAL_PORT 8080\nENV K8SAPP_LOG_LEVEL 0\n\nEXPOSE $K8SAPP_LOCAL_PORT\n\nCOPY certs /etc/ssl/certs/\nCOPY bin/linux/k8sapp /\n\nCMD [\"/k8sapp\"]\n```\n\n## Package manager\n\nTo work correctly with the dependencies we should choose the package manager. [dep](https://github.com/golang/dep) is a prototype dependency management tool for Go.\n\n## Versioning automation\n\nUsing a special script to increase the release version\n\n```sh\n./bumper.sh\nCurrent version 0.4.0.\nPlease enter bumped version [0.4.1]:\n```\n\n## Contributing to the project\n\nSee the [contribution guidelines](docs/CONTRIBUTING.md) for information on how to\nparticipate in the Kubernetes application project by submitting pull requests or issues.\n\n## License\n\n[MIT Public License](https://github.com/takama/k8sapp/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakama%2Fk8sapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakama%2Fk8sapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakama%2Fk8sapp/lists"}