Skip to content

Commit

Permalink
Add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kidswiss committed Sep 5, 2023
1 parent 8803671 commit 3bbe161
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/antora-preview.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

antora_preview_version ?= 3.0.1.1
antora_preview_cmd ?= $(DOCKER_CMD) run --rm --publish 2020:2020 --volume "${PWD}":/preview/antora docker.io/vshn/antora-preview:$(antora_preview_version) --style=vshn
antora_preview_version ?= 3.1.4
antora_preview_cmd ?= $(DOCKER_CMD) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}":/preview/antora ghcr.io/vshn/antora-preview:$(antora_preview_version) --style=vshn

.PHONY: docs-preview
docs-preview: ## Preview the documentation
Expand Down
6 changes: 4 additions & 2 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
* https://github.com/vshn/provider-minio/releases[Changelog,window=_blank] 🔗
.Tutorials
//* xref:tutorials/example.adoc[Example Tutorial]
* xref:tutorials/installation.adoc[Installation]
* xref:tutorials/getting-started.adoc[Getting Started]
.How To
//* xref:how-tos/example.adoc[Example How-To]
* xref:how-tos/create-releases.adoc[Create Releases]
.Technical reference
//* xref:references/example.adoc[Example Reference]
Expand Down
28 changes: 28 additions & 0 deletions docs/modules/ROOT/pages/how-tos/create-releases.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
= Create Releases

This repository contains GitHub releases.

[TIP]
====
The PR template reminds you how to separate and label PRs.
====

== Provider Release

Releasing a new version of the operator requires pushing a **new Git tag**, following the SemVer schema with a **`v` prefix**.
Optionally, for prereleases they may contain a ascending release candidate suffix with `-rc#`.

.Possible Operator Git tags
[example]
====
- `v0.1.2`
- `v1.4.0`
- `v2.0.0-rc1`
- `v2.0.0-rc2`
====

The changelog will be automatically created and is based on merged PRs.
The following labels must exist on a PR to be included in the changelog:

- `area:operator`
- one of [`bug`, `enhancement`, `documentation`, `change`, `breaking`, `dependency`]
75 changes: 75 additions & 0 deletions docs/modules/ROOT/pages/tutorials/getting-started.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
= Getting Started

This page describes how to create a new S3 bucket after you have installed the operator.

== Prerequisites

* `kubectl`
* Already running Kubernetes cluster
* Installed minio
* Installed Operator

== Steps

. Create a file with the spec
+
.config.yaml
[source,yaml]
----
apiVersion: v1
kind: Secret
metadata:
name: minio-secret
namespace: crossplane-system
stringData:
AWS_ACCESS_KEY_ID: minioadmin <1>
AWS_SECRET_ACCESS_KEY: minioadmin <1>
---
apiVersion: minio.crossplane.io/v1
kind: ProviderConfig
metadata:
name: provider-config
spec:
credentials:
apiSecretRef:
name: minio-secret
namespace: crossplane-system
source: InjectedIdentity
minioURL: http://minio-server.minio.svc:9000/ <2>
status: {}
----
<1> Please adjust the credendials according to your minio installation
<2> Please adjust the URL according to your minio installation

. Apply the spec in the cluster
+
[source,bash]
----
kubectl apply -f config.yaml
----

. Create a bucket
+
.bucket.yaml
[source,yaml]
----
apiVersion: minio.crossplane.io/v1
kind: Bucket
metadata:
name: mybucket
spec:
forProvider: {}
providerConfigRef:
name: provider-config
status:
atProvider: {}
----

. Wait until the operator has provisioned the user
+
[source,bash]
----
kubectl apply -f bucket.yaml
kubectl wait --for condition=Ready bucket/mybucket
----
54 changes: 54 additions & 0 deletions docs/modules/ROOT/pages/tutorials/installation.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
= Installation

This tutorial goes through the steps required to get the operator up and running.

== Prerequisites

* `kubectl`
* A running Kubernetes cluster with cluster-admin permissions

== Steps

. Install Crossplane chart
+
[source,bash,subs="attributes+"]
----
helm repo add crossplane https://charts.crossplane.io/stable
helm upgrade --install crossplane crossplane/crossplane \
--create-namespace \
--namespace crossplane-system \
--set "args[1]='--enable-composition-revisions'" \
--set webhooks.enabled=true \
--wait
----

. Install Minio Chart
+
[source,bash,subs="attributes+"]
----
helm repo add minio https://charts.min.io/ --force-update
helm upgrade --install --create-namespace --namespace minio minio --version 5.0.7 minio/minio \
--values values.yaml <1>
----
<1> Please provide a values.yaml file that fits your purpose

. Install `provider-minio`
+
[source,yaml,subs="attributes+"]
----
kubectl apply -f - <<EOF
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
labels:
name: provider-minio
name: provider-minio
spec:
package: ghcr.io/vshn/provider-minio/package:latest
EOF
----

== Conclusion

Now that you have the basic Provider running, it's time to get started with deploying resources.
See xref:tutorials/getting-started.adoc[Tutorial: Getting Started] to get started.

0 comments on commit 3bbe161

Please sign in to comment.