Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[161] Add plain manifests to release process #173

Merged
merged 6 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
hiddenmarten marked this conversation as resolved.
Show resolved Hide resolved
```
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
Loading