Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zugao committed Oct 13, 2022
1 parent 0878352 commit f7a05bf
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 9 deletions.
14 changes: 8 additions & 6 deletions docs/modules/ROOT/pages/how-tos/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

This component requires https://github.com/appuio/component-appuio-cloud-reporting[component-appuio-cloud-reporting] and is installed into the same namespace.
This is required for this component to be able to access the billing database and its connection secrets.
It also requires an Exoscale IAMKey and a Kubernetes/OpenShift Service Account token in the target cluster to get `buckets.exoscale.crossplane.io` resources.

== Sources

The data is matched from k8s cluster and Exoscale organization.
The Kubernetes Service Account token is required to have `get` permissions on `Namespaces` and `buckets.exoscale.crossplane.io` resources.
The Access Key (IAM Key) from an Exoscale organization is required to have read access across all SOS buckets.

== Example

Expand All @@ -14,12 +21,7 @@ applications:
parameters:
exoscale_metrics_collector:
namespace: 'appuio-cloud-reporting'
secrets:
exoscale:
stringData:
api_key: "?{vaultkv:${cluster:tenant}/${cluster:name}/exoscale-metrics-collector/api_key}"
api_secret: "?{vaultkv:${cluster:tenant}/${cluster:name}/exoscale-metrics-collector/api_secret}"
schedule: '10 10,16,20 * * *'
----

See the xref:references/parameters.adoc[parameters] reference for a full list of parameters.
44 changes: 44 additions & 0 deletions docs/modules/ROOT/pages/how-tos/multi-instance.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
= Deploy multiple instances

This guide provides an example how to deploy multiple instances of this component.

== Requirements


. Prepare catalog by configuring 2 instances
+
[source,yaml]
----
applications:
- exoscale-metrics-collector as collector-exoscale-ch-gva-2 <1>
- exoscale-metrics-collector as collector-cloudscale-rma-0 <2>
parameters:
appuio_cloud_reporting:
namespace: 'appuio-cloud-reporting'
database:
name: 'reporting'
host: 'reporting-db.appuio-reporting.svc'
parameters: 'sslmode=disable'
password: 'passw0rd'
port: 5432
----
<1> Instance one with alias name collector-exoscale-ch-gva-2
<2> Instance two with alias name collector-cloudscale-rma-0
+

. Add relevant entries to Vault
+
[source,bash]
----
parent="clusters/kv/${TENANT_ID}/${CLUSTER_ID}"
instance_1="collector-exoscale-ch-gva-2"
instance_2="collector-cloudscale-rma-0"
vault kv put "${parent}/exoscale-metrics-collector/${instance_1}" exoscale-key=<key-1> exoscale-secret=<secret-1> cluster-server=<server-url-1> cluster-token=<token-1>
vault kv put "${parent}/exoscale-metrics-collector/${instance_2}" exoscale-key=<key-2> exoscale-secret=<secret-2> cluster-server=<server-url-2> cluster-token=<token-2>
----
+

. Compile and push the cluster catalog
. Wait until changes are applied
. Verify that the instances are up and configured correctly
24 changes: 21 additions & 3 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ default:: `10 10,16,20 * * *`
The cron schedule at which the metrics collection job is spawned.
== `secrets.exoscale.stringData.api_key`
== `secrets.credentials.stringData.EXOSCALE_API_KEY`
[horizontal]
type:: string
Expand All @@ -38,7 +38,7 @@ The Exoscale API key.
You need to get the token from the https://portal.exoscale.com[Exoscale Console].
You need to select the correct account (token is limited to one account), choose "IAM" in the menu and generate a new key pair.
== `secrets.exoscale.stringData.api_secret`
== `secrets.credentials.stringData.EXOSCALE_API_SECRET`
[horizontal]
type:: string
Expand All @@ -47,4 +47,22 @@ default:: Required.
The Exoscale API secret.
Second part of the Exoscale API credentials.
See api_key for instructions.
See EXOSCALE_API_KEY for instructions.
== `secrets.credentials.stringData.K8S_SERVER_URL`
[horizontal]
type:: string
default:: Required.
The Kubernetes server URL.
== `secrets.credentials.stringData.K8S_TOKEN`
[horizontal]
type:: string
default:: Required.
The token to connect to a Kubernetes cluster.
The Service Account connected to this token should have `get` and `list` permissions to `buckets.exoscale.crossplane.io` managed resource.

0 comments on commit f7a05bf

Please sign in to comment.