cleanup, add docs
This commit is contained in:
parent
6a94eb6279
commit
b305152e9f
17
README.md
17
README.md
@ -3,6 +3,23 @@
|
|||||||
This is a [Github Action](https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action)
|
This is a [Github Action](https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action)
|
||||||
using Docker, with the intention to efficiently deploy to a k3s or k8s cluster using kustomize.
|
using Docker, with the intention to efficiently deploy to a k3s or k8s cluster using kustomize.
|
||||||
|
|
||||||
|
# How to Use
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
deploy_staging:
|
||||||
|
steps:
|
||||||
|
- name: deploy to staging
|
||||||
|
id: deploy
|
||||||
|
uses: https://gitea.uber5.com/Uber5-Public/gha-deploy-to-k3s@v2
|
||||||
|
with:
|
||||||
|
kust_config: kustomize/overlays/testing
|
||||||
|
env:
|
||||||
|
K3S_YAML: ${{ secrets.K3S_YAML }}
|
||||||
|
- name: Check output of previous step (kinda dummy)
|
||||||
|
run: echo "The start time was ${{ steps.deploy.outputs.time }}"
|
||||||
|
```
|
||||||
|
|
||||||
# Open Questions
|
# Open Questions
|
||||||
|
|
||||||
- We use [kustomize](https://kustomize.io/). Is this overkill? As the complexity of deployments is not that high, usually, this may be more technical complexity than necessary. We could go back to using plain kubernetes manifests, and just have different ones for staging and prod.
|
- We use [kustomize](https://kustomize.io/). Is this overkill? As the complexity of deployments is not that high, usually, this may be more technical complexity than necessary. We could go back to using plain kubernetes manifests, and just have different ones for staging and prod.
|
||||||
|
@ -31,14 +31,14 @@ echo "K3S_YAML, deserialized:"
|
|||||||
cat /tmp/k3s.yaml
|
cat /tmp/k3s.yaml
|
||||||
cp -r ./kustomize /tmp/ # TODO: we expect the kustomize folder to be present in the root of the repository
|
cp -r ./kustomize /tmp/ # TODO: we expect the kustomize folder to be present in the root of the repository
|
||||||
find /tmp/kustomize -type f -print0 | xargs -0 sed -i "s/GIT_VERSION/${GITHUB_SHA}/"
|
find /tmp/kustomize -type f -print0 | xargs -0 sed -i "s/GIT_VERSION/${GITHUB_SHA}/"
|
||||||
echo "try and get nodes and version... (debugging)"
|
# echo "try and get nodes and version... (debugging)"
|
||||||
kubectl --kubeconfig /tmp/k3s.yaml get all
|
# kubectl --kubeconfig /tmp/k3s.yaml get all
|
||||||
kubectl --kubeconfig /tmp/k3s.yaml version
|
# kubectl --kubeconfig /tmp/k3s.yaml version
|
||||||
echo "determine kustomize version..."
|
echo "determine kustomize version..."
|
||||||
KUSTOMIZE_VERSION=$(kubectl --kubeconfig /tmp/k3s.yaml version | grep Kustomize | awk '{ print $3 }')
|
KUSTOMIZE_VERSION=$(kubectl --kubeconfig /tmp/k3s.yaml version | grep Kustomize | awk '{ print $3 }')
|
||||||
echo "KUSTOMIZE_VERSION=${KUSTOMIZE_VERSION}"
|
echo "KUSTOMIZE_VERSION=${KUSTOMIZE_VERSION}"
|
||||||
echo "run kustomize, and print output to console"
|
# echo "run kustomize, and print output to console"
|
||||||
kubectl --kubeconfig /tmp/k3s.yaml kustomize "/tmp/${KUST_CONFIG}"
|
# kubectl --kubeconfig /tmp/k3s.yaml kustomize "/tmp/${KUST_CONFIG}"
|
||||||
echo "replace faulty kustomize version (compare https://github.com/kubernetes/kubectl/issues/1495)"
|
echo "replace faulty kustomize version (compare https://github.com/kubernetes/kubectl/issues/1495)"
|
||||||
kubectl --kubeconfig /tmp/k3s.yaml kustomize "/tmp/${KUST_CONFIG}" | sed "s/kustomize-(devel)/kustomize-$KUSTOMIZE_VERSION/" >/tmp/manifests.yaml
|
kubectl --kubeconfig /tmp/k3s.yaml kustomize "/tmp/${KUST_CONFIG}" | sed "s/kustomize-(devel)/kustomize-$KUSTOMIZE_VERSION/" >/tmp/manifests.yaml
|
||||||
echo "UPDATED YAML:"
|
echo "UPDATED YAML:"
|
||||||
|
Loading…
Reference in New Issue
Block a user