{"id":13472741,"url":"https://github.com/luizalabs/hello-teresa","last_synced_at":"2025-12-29T16:26:38.747Z","repository":{"id":54295780,"uuid":"82857987","full_name":"luizalabs/hello-teresa","owner":"luizalabs","description":"Hello world apps ready to be deployed on Kubernetes clusters through Teresa","archived":false,"fork":false,"pushed_at":"2021-02-26T02:13:35.000Z","size":39,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-30T05:26:10.626Z","etag":null,"topics":["golang","kubernetes","nodejs","python-application","teresa"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luizalabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T22:16:12.000Z","updated_at":"2023-08-27T11:29:50.000Z","dependencies_parsed_at":"2022-08-13T11:20:10.545Z","dependency_job_id":null,"html_url":"https://github.com/luizalabs/hello-teresa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizalabs%2Fhello-teresa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizalabs%2Fhello-teresa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizalabs%2Fhello-teresa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizalabs%2Fhello-teresa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luizalabs","download_url":"https://codeload.github.com/luizalabs/hello-teresa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245702222,"owners_count":20658566,"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":["golang","kubernetes","nodejs","python-application","teresa"],"created_at":"2024-07-31T16:00:57.561Z","updated_at":"2025-12-29T16:26:33.703Z","avatar_url":"https://github.com/luizalabs.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Hello Teresa\nA collection of `Hello World` ready to deploy on [teresa](https://github.com/luizalabs/teresa) PaaS.\n\n## Deploy\n\nSome information to get your application up and running on Kubernetes with Teresa.\n\n### Port\nDon't listen on a hardcoded port, but instead read the port from the environment variable `PORT`. For instance:\n\n```go\nport := os.Getenv(\"PORT\")\nif port == \"\" {\n    port = \"5000\"\n}\nhttp.ListenAndServe(fmt.Sprintf(\":%s\", port), nil)\n```\n\nThe deploy process will set this variable\n\n### Procfile\nAccording to [Heroku's docs](https://devcenter.heroku.com/articles/procfile):\n\n```\nA Procfile is a mechanism for declaring what commands are run by your application’s\ndynos on the Heroku platform.\n```\n\nTeresa follows the same principle.\nAs an example, a Python application might have the following command on Procfile:\n\n    web: gunicorn -b 0.0.0.0:$PORT -w 3 --pythonpath src myapp.wsgi\n\n\n### Language detection\nWhen you deploy an app using Teresa, you don't have to specify your application's language - it'll be automatically detected.\n\n\u003e This step it's based on [Heroku's build packs](https://devcenter.heroku.com/articles/buildpacks).\n\n#### Golang\nTeresa will detect your application as Golang if you're using one of theses depedencies managers:\n\n- [govendor](https://github.com/kardianos/govendor)\n- [glide](https://github.com/Masterminds/glide)\n- [GB](https://getgb.io/)\n- [Godep](https://github.com/tools/godep)\n\nIf you don't need to deal with third party libs you just need to drop a simple `vendor/vendor.json`\nfile in the root dir of your application, for instance:\n\n```json\n{\n  \"comment\": \"\",\n  \"ignore\": \"test\",\n  \"package\": [],\n  \"rootPath\": \"github.com/luizalabs/hello-teresa\"\n}\n```\n\n#### Python\nTo deploy a Python application on Teresa a `requirements.txt` file must be present in the root dir\nof your application.  \nThe version of Python runtime can be specified with a `runtime.txt` file in the root dir, for instance:\n\n    $ cat runtime.txt\n    python-3.6.0\n\n#### NodeJS\nTeresa will detect your application as NodeJS when the application has a `package.json` file in the root dir.  \nIf no _Procfile_ is present in the root directory of your application during the build step,\nyour web process will be started by running `npm start`, a script you can specify in _package.json_, for instance:\n\n```json\n  \"scripts\": {\n    \"start\": \"node server.js\"\n  },\n```\n\n#### Multi-language\nTeresa allows multiples deploy processes in a single one. It's useful for example, in cases that you need to transpile the\nproject assets with [webpack](https://webpack.js.org) and run a Python server.  \nTo deploy a _multi-language_ application on Teresa, a `.buildpacks` file must be present in the root dir of\nyour application. In this file you need to specify the buildpacks that you want to build your project.  \nFor instance:\n\n* .buildpacks\n\n```\nhttps://github.com/heroku/heroku-buildpack-nodejs.git\nhttps://github.com/heroku/heroku-buildpack-python.git\n```\n\n* package.json\n\n```json\n{\n  \"name\": \"multi-language-teresa-hello-world\",\n  \"scripts\": {\n    \"postinstall\": \"node_modules/webpack/bin/webpack.js\",\n    \"webpack\": \"node_modules/webpack/bin/webpack.js --progress --colors --watch\"\n  },\n  \"dependencies\": {\n    \"webpack\": \"^1.12.13\"\n  }\n}\n```\n\n* requirements.txt\n\n```\nDjango==1.9.2\ngunicorn==19.4.5\n```\n\n* Procfile\n\n```\nweb: gunicorn -b 0.0.0.0:$PORT -w 3 --pythonpath src hello_world.wsgi\n```\n\nTeresa will run the nodejs and python build processes in this order.\n\n### .teresaignore\nA `.teresaignore` file specifies intentionally files that Teresa should ignore.  \nEach line in a `.teresaignore` file specifies a pattern (glob), blank lines are ignored, e.g.\n\n```\n.git\nnode_modules/\n\n*_tests\n*.pyc\n```\n\n### teresa.yaml\nSome features can be configured in a file called `teresa.yaml` in the the root dir of application.\n\n\u003e Check a complete example [here](./golang-healthcheck-rolling-update/teresa.yaml)\n\n#### Health Check\nKubernetes has two types of [health checks](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/),\nthe `Readiness` and the `Liveness`.\n\n- **Readiness**: Based on the time of \"boot\" of application, the Kubernetes uses this configuration to know when container is ready to start accepting traffic.\n- **Liveness**: Conventional health check, the Kubernetes uses this configuration to know when to restart a container.\n\nYou can set both (_readiness_ and _liveness_) for your application in section `healthCheck` of the _teresa.yaml_, for instance:\n\n```yaml\nhealthCheck:\n    liveness:\n        path: /healthcheck/\n        timeoutSeconds: 5\n        initialDelaySeconds: 10\n        periodSeconds: 5\n        failureThreshold: 5\n        successThreshold: 1\n    readiness:\n        path: /healthcheck/\n        timeoutSeconds: 2\n        initialDelaySeconds: 5\n        periodSeconds: 5\n        failureThreshold: 2\n        successThreshold: 1\n```\n\n\u003e Teresa only perform health check based on _HTTP GET request_.\n\n- **path**: endpoint of application than health check should hit.\n- **timeoutSeconds**: timeout to determine if the application is unhealthy.\n- **initialDelaySeconds**: delay (in seconds) to start to perform the execution of health check.\n- **periodSeconds**: delay between checks.\n- **failureThreshold**: max failure tolerance before restart the container.\n- **successThreshold**: min number of success to determina that container it's healthy.\n\nAny code greater than or equeal to 200 and less than 400 indicates success.\nAny other code indicates failure.\n\n#### Rolling Update\nKubernetes has the [Rolling Update](https://kubernetes.io/docs/user-guide/deployments/#rolling-update-deployment) strategy to deal with deploys.\nWith this strategy you can specify the `max unavailable` and the `max surge` fields to control\nthe rolling update process.  \nYou can set both (_maxUnavailable_ and _maxSurge_) for the deploy of your application in section\n`RollingUpdate` of the _teresa.yaml_, for instance:\n\n```yaml\nrollingUpdate:\n    maxUnavailable: \"30%\"\n    maxSurge: \"2\"\n```\n\n- **Max Unavailable**: Specifies the maximum number of pods can be unavailable during the update process.\n- **Max Surge**: Specifies the maximyum number of pods can be created above the desired number of pods.\n\n\u003e This field can be an absolute number (e.g. \"2\") or a percentage (e.g. \"30%\").\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizalabs%2Fhello-teresa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluizalabs%2Fhello-teresa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizalabs%2Fhello-teresa/lists"}