Skip to content

Commit

Permalink
[161] Add plain manifests to release process (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenmarten authored Apr 13, 2024
1 parent 8a257be commit 4e3ddbe
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/helm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
with:
version: 'v3.14.3'

- name: Get latest tag
- name: Get tag from current run
run: |
TAG=${{ github.ref_name }}
echo "Tag for packaging chart is $TAG"
echo "LATEST_TAG=${TAG}" >> $GITHUB_ENV
echo "LATEST_TAG_TRIMMED_V=${TAG#v}" >> $GITHUB_ENV
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV
echo "RELEASE_TAG_TRIMMED_V=${TAG#v}" >> $GITHUB_ENV
- name: Helm login registry
working-directory: charts
Expand All @@ -49,12 +49,12 @@ jobs:
working-directory: charts
run: |
helm package ${{ env.CHART_NAME }} \
--version ${LATEST_TAG_TRIMMED_V} \
--app-version ${LATEST_TAG} \
--version ${RELEASE_TAG_TRIMMED_V} \
--app-version ${RELEASE_TAG} \
--dependency-update
- name: Helm push chart
working-directory: charts
run: |
helm push ${{ env.CHART_NAME }}-${LATEST_TAG_TRIMMED_V}.tgz \
helm push ${{ env.CHART_NAME }}-${RELEASE_TAG_TRIMMED_V}.tgz \
oci://${{ env.REGISTRY }}/${{ env.CHARTS_REPOSITORY }}
46 changes: 46 additions & 0 deletions .github/workflows/release-assets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Upload release assets
on:
release:
types:
- created

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release-assets:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.22.2
- name: Get tag from current run
run: |
TAG=${{ github.ref_name }}
echo "Tag for packaging chart is $TAG"
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV
echo "RELEASE_TAG_TRIMMED_V=${TAG#v}" >> $GITHUB_ENV
- run: make build-dist-manifests IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${RELEASE_TAG}
- uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-operator.yaml
asset_name: etcd-operator.yaml
tag: ${{ github.ref }}
overwrite: true
- uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-operator.crds.yaml
asset_name: etcd-operator.crds.yaml
tag: ${{ github.ref }}
overwrite: true
- uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/etcd-operator.non-crds.yaml
asset_name: etcd-operator.non-crds.yaml
tag: ${{ github.ref }}
overwrite: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.so
*.dylib
bin
dist
testbin/*
Dockerfile.cross

Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,13 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
- $(CONTAINER_TOOL) buildx rm project-v3-builder
rm Dockerfile.cross

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
.PHONY: build-dist-manifests
build-dist-manifests: manifests generate kustomize yq ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
@if [ -d "config/crd" ]; then \
$(KUSTOMIZE) build config/crd > dist/install.yaml; \
fi
echo "---" >> dist/install.yaml # Add a document separator before appending
cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/aenix-io/etcd-operator=${IMG}
$(KUSTOMIZE) build config/default >> dist/install.yaml
$(KUSTOMIZE) build config/default > dist/etcd-operator.yaml
$(KUSTOMIZE) build config/default | $(YQ) eval 'select(.kind != "CustomResourceDefinition")' - > dist/etcd-operator.non-crds.yaml
$(KUSTOMIZE) build config/default | $(YQ) eval 'select(.kind == "CustomResourceDefinition")' - > dist/etcd-operator.crds.yaml

##@ Deployment

Expand Down
7 changes: 3 additions & 4 deletions site/content/en/docs/v0.1/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ Follow these instructions to install, run, and test etcd with etcd-operator in a

Pre-requisites:
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [kustomize](https://github.com/kubernetes-sigs/kustomize)
- Kubernetes cluster and `kubectl` configured to use it
- If you don't have a Kubernetes cluster, you can use [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) to create a local one
- [cert-manager](https://cert-manager.io/docs/installation/) installed in the cluster

1. Install etcd-operator:
```bash
kustomize build 'https://github.com/aenix-io/etcd-operator//config/default?ref=main' | kubectl apply -f -
kubectl apply -f https://github.com/aenix-io/etcd-operator/releases/download/latest/etcd-operator.yaml
```
2. Check the operator is running:
```bash
kubectl get pods -n etcd-operator-system -l control-plane=controller-manager
```
3. Create an etcd cluster:
3. Create a simple etcd cluster:
```bash
kubectl apply -f https://github.com/aenix-io/etcd-operator/raw/main/config/samples/etcd.aenix.io_v1alpha1_etcdcluster.yaml
kubectl apply -f https://github.com/aenix-io/etcd-operator/raw/main/examples/manifests/etcdcluster-simple.yaml
```
**Caution**: by default emptyDir storage is used. It means such cluster configuration is not intended for long-term storage.

Expand Down

0 comments on commit 4e3ddbe

Please sign in to comment.