Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/squaremo/spresm

It's a tool for managing Kubernetes configurations, that supports getting YAMLs from Helm charts and container images.
https://github.com/squaremo/spresm

gitops helm kubernetes yaml

Last synced: 2 months ago
JSON representation

It's a tool for managing Kubernetes configurations, that supports getting YAMLs from Helm charts and container images.

Awesome Lists containing this project

README

        

# Spresm, because configuration is code too

Spresm is a tool for managing Kubernetes configurations in git, as
generated by Helm charts and more generally, container images.

When you `spresm import` a Helm chart or container image, Spresm runs
it (with input values you provide) to generate YAML files for you to
commit to git. You can make changes to the YAML files and commit them.

When you need to update the chart or image, or the input values, you
can run `spresm update` to regenerate the YAMLs and merge with your
local changes.

Example:

```bash
$ spresm import helm flux-system/ --chart https://charts.fluxcd.io/flux --version 1.5
# edit the values presented in $EDITOR, save and exit
$ ls flux-system/
Spresmfile deployment.yaml kube.yaml
memcached.yaml rbac.yaml secret.yaml
service.yaml serviceaccount.yaml
$ git add flux-system; git commit -m "Initial flux config"
```

Having imported the chart (in this case), you can now edit things to
suit your purposes. Let's remove a redundant volume definition and
mount from the deployment.

```
$ $EDITOR flux-system/deployment.yaml
# remove the `kubedir` volume and its mount
$ git diff
index 194c279..c779af5 100644
--- a/flux-system/deployment.yaml
+++ b/flux-system/deployment.yaml
@@ -23,9 +23,6 @@ spec:
spec:
serviceAccountName: flux-system2
volumes:
- - name: kubedir
- configMap:
- name: flux-system2-kube-config
- name: git-key
secret:
secretName: flux-system2-git-deploy
@@ -54,8 +51,6 @@ spec:
initialDelaySeconds: 5
timeoutSeconds: 5
volumeMounts:
- - name: kubedir
- mountPath: /root/.kubectl
- name: git-key
mountPath: /etc/fluxd/ssh
readOnly: true
$ git add flux-system/deployment.yaml; git commit -m "Remove kubedir volume"
```

You can now update the values and regenerate the YAMLs. Changes will
be merged with the change you've made.

```bash
$ spresm update --edit flux-system/
# edit the values presented in $EDITOR, save and exit
```

See [./docs/rfc/0001-spresm.md](./docs/rfc/0001-spresm.md).