https://github.com/object88/churl
https://github.com/object88/churl
chartmuseum kubernetes port-forwarding
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/object88/churl
- Owner: object88
- Created: 2019-11-03T01:20:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T03:58:42.000Z (over 6 years ago)
- Last Synced: 2025-04-06T03:42:38.043Z (about 1 year ago)
- Topics: chartmuseum, kubernetes, port-forwarding
- Language: Go
- Size: 4.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# churl
`churl` (**ch**art museum c**url**) is a utility for interacting with a [Helm](https://helm.sh) [chart museum](https://chartmuseum.com/).
The default chart museum deployment does not include a kubernetes ingress, meaning that it's only accessible from within the kubernetes cluster, perhaps using it's service address (i.e., http://cm-chartmuseum.chartmuseum:8080/index.yaml). `churl` will create a kubernetes port-forwarding tunnel from a local machine and issue HTTP requests to retrieve charts and chart archives.
## Helm
The Chart Museum is installed as a helm package, and the version of helm used makes no difference, however, the tests assume the usage of version 3.
## Limits
`churl` is _not_ meant to add, remove, or alter charts or chart archives. It's recommended to use helm commands for that purpose.
## Goals
This project has several goals. First and foremost is to create a tool that helps me access a protected chart museum. There are several secondary goals:
### Branching strategy
In order to better understand the OneFlow branching stragey, it will be applied here. Reading about it does not impart the same level of undestanding as using it.
### Github tooling
Github has made a number of CI/CD tools available to open source developers.
### Over-engineering
`churl` started as a bash script. The following is a much simplified version of the script.
``` sh
#!/usr/bin/env bash
QUERY=$1
shift 1
# Set up the port forward to run in the background, but grab the PID so that we
# can terminate the forwarding when we're done.
kubectl port-forward svc/cm-chartmuseum 9000:8080 --address localhost --context "minikube" --namespace chartmuseum > /dev/null 2>&1 &
KUBEPID=$!
# Ensure that the port-forwarding process dies with this script.
closePortForward() {
kill $KUBEPID
}
trap closePortForward EXIT
sleep 10
curl -sL "http://localhost:9000/$QUERY"
```
## Future
The port forward currently lives as long as the `churl` executable, however it is probably common to perform multiple requests. An improvement might be to spawn a long-lived background process that manages the port-forward, and closes after a period of inactivity. In this arrangement, the user's request is routed to the background process, which performs the actual request.
## Testing
`churl` is tested with a local kubernetes & helm installation:
``` sh
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm install stable/chartmuseum --name cm
```