Dopingus / cert-manager-webhook-dynu

Unofficial cert-manager webhook for dynu
Apache License 2.0
7 stars 7 forks source link

Making this hook easier to use #6

Closed anon-software closed 2 years ago

anon-software commented 2 years ago

First, let's make the Helm chart more accessible. Downloading the complete source repository in order to just install the chart is cumbersome. We can do better by converting the git repository itself into helm chart repository with help of a GitHub action. This action converts GitHub pages of the repository into the chart repository.

Before merging this pull request one must set up GitHub Pages and for that a new branch traditionally called "gh-pages" is required. Since this branch should not have any source files it can be "orphaned". Note that Git automatically stages the current files after creating an orphaned branch that you want to unstage.

git checkout --orphan gh-pages
git rm --cached -r .

Create README.md file as the "home page" of the Helm repository:

## Usage

[Helm](https://helm.sh) must be installed to use the charts.  Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

  helm repo add cert-manager-webhook-dynu https://dopingus.github.io/cert-manager-webhook-dynu

If you had already added this repo earlier, run `helm repo update` to retrieve
the latest versions of the packages.  You can then run `helm search repo
cert-manager-webhook-dynu` to see the charts.

To install the dynu-webhook chart:

    helm install dynu-webhook cert-manager-webhook-dynu/dynu-webhook

To uninstall the chart:

    helm delete dynu-webhook

With a couple of more commands complete the new branch and return to master:

git add README.md
git commit -m "Initial commit"
git push --set-upstream origin gh-pages
git checkout -f master

GitHub will present the README.md as HTML when you access the "home page" at https://dopingus.github.io/cert-manager-webhook-dynu/, but more importantly the Helm chart will be accessible there too once the pull request is merged.

Next, I do not think there is a good reason to make the API URL configurable. It is just a burden to the user to enter it into the configuration and in the event Dynu changes it they will likely make an incompatible change in the API as well rendering the current code unusable.

Finally, by leveraging a different API, we can drop the "zone" from the configuration leaving API secret specification as the only item in the configuration.

README file has been changed to reflect the above. Also, some YAML indentation was incorrect and the test run log is now different.

anon-software commented 2 years ago

I forgot to add that after pushing gh-pages branch one must enable its use in the repository settings:

image