{"id":17681757,"url":"https://github.com/jgaskins/rails_app_operator","last_synced_at":"2025-05-07T22:29:06.073Z","repository":{"id":143300941,"uuid":"398927319","full_name":"jgaskins/rails_app_operator","owner":"jgaskins","description":"Kubernetes Rails app operator, allowing simple day-1 Rails deployment to a Kubernetes cluster","archived":false,"fork":false,"pushed_at":"2025-04-04T04:05:54.000Z","size":211,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-06T18:16:17.991Z","etag":null,"topics":["docker","kubernetes","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/jgaskins.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":"2021-08-23T00:08:48.000Z","updated_at":"2025-04-04T04:05:58.000Z","dependencies_parsed_at":"2024-01-14T08:41:01.425Z","dependency_job_id":"afa11e9b-1f15-4e82-819a-9a497b46415d","html_url":"https://github.com/jgaskins/rails_app_operator","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/jgaskins%2Frails_app_operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Frails_app_operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Frails_app_operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgaskins%2Frails_app_operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgaskins","download_url":"https://codeload.github.com/jgaskins/rails_app_operator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252964358,"owners_count":21832673,"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":["docker","kubernetes","rails","ruby"],"created_at":"2024-10-24T09:12:07.355Z","updated_at":"2025-05-07T22:29:06.053Z","avatar_url":"https://github.com/jgaskins.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RailsApp Operator\n\nThis project is an operator intended to make it dead-simple to deploy a Rails app to a Kubernetes cluster.\n\n## Installation\n\nThe Quickstart guide will get you there. A more detailed installation walkthrough will come later.\n\nNotes:\n\n1. This installation guide assumes you've already got a Kubernetes cluster running and `kubectl` installed\n2. This guide is optimized for Kubernetes on AWS or DigitalOcean. If you're on GKE, things get more complicated. The absolute simplest way to setup Kubernetes is on DigitalOcean.\n\n### Quickstart\n\nMake a Docker container for your application. This is required since Kubernetes is all about deploying containers.\n\n- [Install Docker](https://www.docker.com/products/docker-desktop) if you haven't already\n- If you don't have a Docker Hub account\n  - Create an account on [Docker Hub](https://hub.docker.com)\n  - Run `docker login` to log the Docker CLI into your Docker Hub account\n- [Create a new container repo](https://hub.docker.com/repository/create) for your app on Docker Hub\n- Copy [this `Dockerfile` into your app](https://raw.githubusercontent.com/jgaskins/rails_app_operator/main/examples/Dockerfile) if you don't have one\n- `docker build -t your-docker-hub-username/your-container-repo:latest .`\n- `docker push your-docker-hub-username/your-container-repo:latest`\n\nRun the following commands to install some of the other related operators into your cluster:\n\n```bash\nK8S_PROVIDER=aws # If you're on DigitalOcean, change this to `do` instead of `aws`\n\n# Install Nginx Ingress Controller\nkubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/$K8S_PROVIDER/deploy.yaml\n\n# Install Cert Manager (for automatically provisioning TLS certs)\nkubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml\n\n# Install the RailsApp CRD and operator deployment\nkubectl apply -f https://raw.githubusercontent.com/jgaskins/rails_app_operator/main/k8s/crd-rails-app.yaml\nkubectl apply -f https://raw.githubusercontent.com/jgaskins/rails_app_operator/main/k8s/operator.yaml\n```\n\n## Usage\n\nCopy this Kubernetes resource definition into your repo:\n\n```yaml\n---\napiVersion: v1\nkind: Namespace\nmetadata:\n  # Whichever namespace you want your application to run in.\n  name: my-app-namespace\nspec:\n  finalizers:\n  - kubernetes\n---\napiVersion: jgaskins.dev/v1beta1\nkind: RailsApp\nmetadata:\n  # The kebab-case Kubernetes resource name for your Rails app\n  name: my-app\n\n  # MUST match the name of the `Namespace` above. If you do not provide a\n  # namespace, it will install it into the `default` namespace.\n  namespace: my-app-namespace\n\n# Customize these below to your app\nspec:\n  # Change this to where your app's container is hosted. If you're on Docker Hub\n  # you don't need to supply a host.\n  image: my-docker-hub-account/my-app-repo:my-tag\n\n  # If you deploy from a mutable tag (such as `latest`), this needs to be\n  # `Always`. If you deploy from tags named after commit SHAs or git tags, you\n  # can delete the line. When in doubt, just leave it as-is.\n  image_pull_policy: Always\n\n  # All entrypoints will have these environment variables\n  env:\n    - name: RAILS_ENV\n      value: production\n    - name: DATABASE_URL\n      value: postgres:/// # Change this to your database's URL\n    - name: SECRET_KEY_BASE\n      value: deadbeef     # Generate a new value for this with `rails secret` and store the value here\n    - name: RAILS_SERVE_STATIC_FILES\n      value: \"true\"\n    - name: RAILS_LOG_TO_STDOUT\n      value: \"true\"\n    - name: RAILS_MAX_THREADS\n      value: \"16\"\n\n  # Set up the various processes for your app to run\n  entrypoints:\n    - name: web\n      # The command for your application to run. Must be an array, shellwords-style.\n      command: [bundle, exec, rails, server]\n      # If you supply `domain` and `port`, an Ingress resource will be created\n      domain: computers.jgaskins.wtf\n      # If you supply `port`, a Service resource will be created\n      port: 3000\n      # How many instances of this entrypoint you want to run\n      replicas: 2\n\n    # Notice the sidekiq entrypoint does not have a domain or port here. It does not\n    # need to be reachable over the network. It only makes outbound connections.\n    - name: sidekiq\n      command: [bundle, exec, sidekiq]\n\n  # The `before_create` and `before_update` hooks are invoked as Jobs before the\n  # app is deployed. They are invoked before the Deployment resource is created\n  # or updated, respectively, as indicated by their names. They are currently\n  # required. If they fail, the app will not be deployed and the jobs will need\n  # to be cleaned up manually with `kubectl`.\n  before_create:\n    command: [bundle, exec, rails, db:create, db:schema:load]\n  before_update:\n    command: [bundle, exec, rails, db:migrate]\n```\n\n## Development\n\nTODO: Write development instructions here\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/jgaskins/rails_app_operator/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Jamie Gaskins](https://github.com/jgaskins) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgaskins%2Frails_app_operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgaskins%2Frails_app_operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgaskins%2Frails_app_operator/lists"}