{"id":17324996,"url":"https://github.com/otaviof/galaxy","last_synced_at":"2026-05-02T09:33:06.960Z","repository":{"id":73901142,"uuid":"179771895","full_name":"otaviof/galaxy","owner":"otaviof","description":"Galaxy is \"GitOps\" repository manager, powered by Landscaper and Vault-Handler.","archived":false,"fork":false,"pushed_at":"2019-07-12T12:35:04.000Z","size":238,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T09:41:42.003Z","etag":null,"topics":["gitops","hashicorp-vault","helm-charts","kubernetes","landscaper","vault-handler"],"latest_commit_sha":null,"homepage":"","language":"Go","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/otaviof.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-06T00:29:09.000Z","updated_at":"2019-09-06T14:09:29.000Z","dependencies_parsed_at":"2023-02-25T14:15:50.626Z","dependency_job_id":null,"html_url":"https://github.com/otaviof/galaxy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fgalaxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fgalaxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fgalaxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fgalaxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otaviof","download_url":"https://codeload.github.com/otaviof/galaxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245781152,"owners_count":20670999,"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":["gitops","hashicorp-vault","helm-charts","kubernetes","landscaper","vault-handler"],"created_at":"2024-10-15T14:12:10.504Z","updated_at":"2026-05-02T09:33:06.906Z","avatar_url":"https://github.com/otaviof.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Galaxy\" src=\"https://raw.githubusercontent.com/otaviof/galaxy/master/assets/logo/galaxy.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca alt=\"GoReport\" href=\"https://goreportcard.com/report/github.com/otaviof/galaxy\"\u003e\n        \u003cimg alt=\"GoReport\" src=\"https://goreportcard.com/badge/github.com/otaviof/galaxy\"\u003e\n    \u003c/a\u003e\n    \u003ca alt=\"Code Coverage\" href=\"https://codecov.io/gh/otaviof/galaxy\"\u003e\n        \u003cimg alt=\"Code Coverage\" src=\"https://codecov.io/gh/otaviof/galaxy/branch/master/graph/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://godoc.org/github.com/otaviof/galaxy/pkg/galaxy\"\u003e\n        \u003cimg alt=\"GoDoc Reference\" src=\"https://godoc.org/github.com/otaviof/galaxy/pkg/galaxy?status.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca alt=\"CI Status\" href=\"https://travis-ci.com/otaviof/galaxy\"\u003e\n        \u003cimg alt=\"CI Status\" src=\"https://travis-ci.com/otaviof/galaxy.svg?branch=master\"\u003e\n    \u003c/a\u003e\n    \u003ca alt=\"Docker-Cloud Build Status\" href=\"https://hub.docker.com/r/otaviof/galaxy\"\u003e\n        \u003cimg alt=\"Docker-Cloud Build Status\" src=\"https://img.shields.io/docker/cloud/build/otaviof/galaxy.svg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# `galaxy` (WIP)\n\nGalaxy is a application to reflect a given *\"GitOps\"* type of repository towards a Kubernetes\ncluster. It handles [Landscaper][landscaper] releases and [`vault-handler`][vaulthandler] manifest\nfiles in a single runtime, reflecting the desired state towards [Helm][helm], and copying secrets\nfrom [Hashicorp-Vault][vault] to Kubernetes.\n\nGalaxy allows you to define environments, and select narrow down the changes towards that environment\nonly, providing features to manipulate release and target namespace names. In order to be as simple\nas possible, it relies on \"convention over configuration\" approach.\n\n## Install\n\nYou can install Galaxy via `go get`:\n\n``` bash\ngo get -u github.com/otaviof/galaxy/cmd/galaxy\n```\n\nOr use the Docker [image][dockerhub]:\n\n``` bash\ndocker run --interactive --tty otaviof/galaxy:latest --help\n```\n\n## GitOps\n\nBy **GitOps** is understood having a Git repository which represents **source-of-authority** over a\nplatform, and by operating this repository means reflecting those changes on the platform.\n\nGalaxy allows you to declare how your platform looks like, and by bringing simple convetions allows\nyou to have a simple structure on GitOps repository, and avoid scripting in order to include,\nexclude or transform elements.\n\n## Usage\n\nThis application is centered on `.galaxy.yaml`, this configuration file define all elements that are\nmanaged by Galaxy, and the rules to transform those element names. A GitOps repository should contain\na `.galaxy.yaml` file on its root, and `galaxy` command command should be executed on the root of the\nrepository as well.\n\n### `.galaxy.yaml`\n\nPlease consider the following `.galaxy.yaml` example:\n\n``` yaml\n---\ngalaxy:\n  namespaces:\n    baseDir: test/namespaces\n    extensions:\n      - yaml\n    names:\n      - ns1\n      - ns2\n  environments:\n    - name: staging\n      onlyOnNamespaces:\n        - ns1\n      fileSuffixes:\n        - s\n        - \"\"\n      transform:\n        namespaceSuffix: -staging\n        releasePrefix: ${NAMESPACE_SUFFIX:1:1}-${NAMESPACE}-\n    - name: production\n      skipOnNamespaces:\n        - ns1\n      fileSuffixes:\n        - p\n        - \"\"\n      transform:\n        releasePrefix: p-${NAMESPACE}-\n```\n\nConfiguration file is organized in two major sections, following the description of each field\nstarting on `namespaces` section:\n\n- `galaxy.namespaces.baseDir`: base directory for namespaces, every namespace is expected to have\na standalone directory;\n- `galaxy.namespaces.extensions`: list of extensions that galaxy will inspect;\n- `galaxy.namespaces.names`:  list of active namespaces;\n\nAnd in `environments` section:\n\n- `galaxy.environments[n].name`: environment name;\n- `galaxy.environments[n].onlyOnNamespaces`: list of namespaces where this environment applies;\n- `galaxy.environments[n].skipOnNamespaces`: list of namespaces where this environment does not apply;\n- `galaxy.environments[n].fileSuffixes`: list of file suffixes that are applicable;\n- `galaxy.environments[n].transform.namespacePrefix`: prefix to be added on namespace name;\n- `galaxy.environments[n].transform.namespaceSuffix`: suffix to be added on namespace name;\n- `galaxy.environments[n].transform.releasePrefix`: prefix added on releases on environment;\n\n### Namespace Directories\n\nOn `.galaxy.yaml` you need to define `galaxy.namespaces.baseDir`, where it's expected to contain\nother directories which will represent the actual namespaces. So for, instance, let's assume\nnamespace named `ns1` and base-directory at `/repo/data`, then by convention, Galaxy would look at\n`/repo/data/ns1` directory.\n\nFurthermore, you also need to define which namespaces are in use, therefore they are also listed at\n`galaxy.namespaces.names` configuration entry.\n\n### File Suffixes\n\nIn order to identify files and related those files to actual environments, Galaxy employs `@`\ncharacter followed by `galaxy.environments[n].fileSuffixes` entries. To share more concrete examples,\nconsider:\n\n| File               | Suffixes | Applicable on Environment |\n|--------------------|----------|---------------------------|\n| `release.yaml`     | (none)   | `staging`, `production`   |\n| `release@s@p.yaml` | `s`, `p` | `staging`, `production`   |\n| `release@s.yaml`   | `s`      | `staging`                 |\n| `release@p.yaml`   | `p`      | `production`              |\n\nNote that on `.galaxy.yaml` example we include `\"\"` (empty) in `fileSuffixes` list, therefore files\nwith the `@` suffix in filename is included. Additionally, those suffixes are only recognized when\nat the end of filename before extension takes place.\n\n### Transformations\n\nNamespace and release names are transformed before install. Therefore, example namespace `ns1` is\nnamed `ns1-staging` in `staging` environment, and is skipped on `production` environment.\n\nIn other hand, `ns2` is only deployed in `production` environment and original name is kept.\n\n### Variable Interpolation\n\nThe following variables can be used for interpolation. They are filled with the current environment\nand namespace that is being processed at the time.\n\n- `RELEASE_PREFIX`: having `galaxy.environments[n].transform.releasePrefix` value;\n- `NAMESPACE_PREFIX`: having `galaxy.environments[n].transform.namespacePrefix` value;\n- `NAMESPACE_SUFFIX`: having `galaxy.environments[n].transform.namespaceSuffix` value;\n- `NAMESPACE`: current namespace name, before namespace transformations;\n\nMore transformations can be done with the variables, by using [expansion][interpolateexp]\nexpressions supported.\n\n## Command-Line\n\nAll parameters can be expressed as environment variables by following a simple convention. For\nexample, the parameter `--environment` becomes `GALAXY_ENVIRONMENT`, where we add a prefix `GALAXY_`\nfollowed by parameter name capitalized. In case of dashes (`-`) they must become underscore (`_`) in\nenvironment.\n\nOn command-line `galaxy` is the base-command, where you must choose sub-commands to call. They are\nlisted as the next documentation sections.\n\n### `compare`\n\nCompare display releases as table, you can include `--environments` or `--namespaces` in order to\nnarrow down results. For instance:\n\n```\n$ galaxy compare\nENVIRONMENT  NAMESPACE    TYPE     ITEM               DETAILS                           FILE\nstaging      ns1-staging  secret   kubernetes.io/tls  ingress.tls.crt, ingress.tls.key  test/namespaces/ns1/ingress-secret.yaml\nstaging      ns1-staging  release  s-ns1-app1:0.0.1   stable/grafana:3.3.0              test/namespaces/ns1/app1.yaml\nstaging      ns2-staging  release  s-ns2-app1:0.0.1   stable/grafana:3.3.0              test/namespaces/ns2/app1.yaml\nproduction   ns2          release  p-ns2-app1:0.0.1   stable/grafana:3.3.0              test/namespaces/ns2/app1.yaml\n```\n\n### `tree`\n\nGalaxy data can also be displayed as a tree, with the same narrowing arguments valied on `compare`.\nFor instance:\n\n```\n$ galaxy tree\n.\n├── staging\n│   ├── ns1-staging\n│   │   ├── test/namespaces/ns1/ingress-secret.yaml (kubernetes.io/tls)\n│   │   │   └── ingress.tls.crt, ingress.tls.key\n│   │   └── test/namespaces/ns1/app1.yaml (stable/grafana:3.3.0)\n│   │       └── s-ns1-app1 (v0.0.1)\n│   └── ns2-staging\n│       └── test/namespaces/ns2/app1.yaml (stable/grafana:3.3.0)\n│           └── s-ns2-app1 (v0.0.1)\n└── production\n    └── ns2\n        └── test/namespaces/ns2/app1.yaml (stable/grafana:3.3.0)\n            └── p-ns2-app1 (v0.0.1)\n```\n\n### `apply`\n\nTo reflect changes in Kubernetes run `apply` sub-command. For instance:\n\n```\n$ galaxy apply --dry-run --environment staging\n```\n\nOn this sub-command the output is log based, therefore you are going to follow up Landscaper and\nVault-Handler related logging in standard output.\n\n## Development\n\nIn order to work on this project, you need the following dependencies in place:\n\n- [**GNU/Make**][gnumake]: to run project tasks;\n- [**Dep**][dep]: Golang Dep, `vendor` folder manager;\n- [**Kubernetes**][kubernetes]: minikube or a real cluster available;\n- [**Docker**][docker]: Docker up and running;\n- [**Helm**][helm]: Client is configured and Helm's Tiller is deployed in the cluster;\n- [**Vault**][vault]: Hashcorp-Vault server;\n\nDuring CI the following scripts are employed:\n\n- [`.ci/bootstrap-vault.sh`](.ci/bootstrap-vault.sh): initial configuration and start K/V store;\n- [`.ci/install-helm.sh`](.ci/install-helm.sh): install Tiller and configure local Helm client;\n- [`.ci/install-minikube.sh`](.ci/install-minikube.sh): install Kubernetes via [KinD][kind];\n- [`.ci/install-vault.sh`](.ci/install-vault.sh): install Vault in command-line;\n\nThis project is using `make` to automake workflow tasks, the most important tasks are:\n\n``` bash\nmake bootstrap      # populate vendor folder\nmake                # build project\nmake test           # run unit/integration tests\nmake integration    # run end-to-end testing\n```\n\n\n[dep]: https://github.com/golang/dep\n[docker]: https://docker.io\n[dockerhub]: https://hub.docker.com/r/otaviof/galaxy\n[gnumake]: https://www.gnu.org/software/make\n[helm]: https://github.com/kubernetes/helm\n[interpolateexp]: https://github.com/buildkite/interpolate#supported-expansions\n[kind]: https://github.com/kubernetes-sigs/kind\n[kubernetes]: https://kubernetes.io\n[landscaper]: https://github.com/Eneco/landscaper\n[vault]: https://www.vaultproject.io\n[vaulthandler]: https://github.com/otaviof/vault-handler","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviof%2Fgalaxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotaviof%2Fgalaxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviof%2Fgalaxy/lists"}