generated from vshn/go-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from vshn/update-component
Make component multi-instance capable
- Loading branch information
Showing
16 changed files
with
197 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
applications: | ||
- exoscale-metrics-collector as collector-cloudscale-lpg-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 |
File renamed without changes.
File renamed without changes.
45 changes: 45 additions & 0 deletions
45
...ector-cloudscale-lpg-2/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/cronjob.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: exoscale-metrics-collector | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: exoscale-metrics-collector | ||
app.kubernetes.io/part-of: appuio-cloud-reporting | ||
name: collector-cloudscale-lpg-2 | ||
namespace: appuio-cloud-reporting | ||
spec: | ||
concurrencyPolicy: Forbid | ||
failedJobsHistoryLimit: 5 | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- args: | ||
- exoscale-metrics-collector | ||
command: | ||
- sh | ||
- -c | ||
env: | ||
- name: password | ||
valueFrom: | ||
secretKeyRef: | ||
key: password | ||
name: reporting-db | ||
- name: username | ||
valueFrom: | ||
secretKeyRef: | ||
key: username | ||
name: reporting-db | ||
- name: ACR_DB_URL | ||
value: postgres://$(username):$(password)@reporting-db.appuio-reporting.svc:5432/reporting?sslmode=disable | ||
envFrom: | ||
- secretRef: | ||
name: credentials-collector-cloudscale-lpg-2 | ||
image: ghcr.io/vshn/exoscale-metrics-collector:v0.0.2 | ||
name: exoscale-metrics-collector-backfill | ||
resources: {} | ||
restartPolicy: OnFailure | ||
schedule: 10 10,16,20 * * * | ||
successfulJobsHistoryLimit: 3 |
15 changes: 15 additions & 0 deletions
15
...ector-cloudscale-lpg-2/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/secrets.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
data: {} | ||
kind: Secret | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: credentials-collector-cloudscale-lpg-2 | ||
name: credentials-collector-cloudscale-lpg-2 | ||
namespace: appuio-cloud-reporting | ||
stringData: | ||
EXOSCALE_API_KEY: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/exoscale-key | ||
EXOSCALE_API_SECRET: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/exoscale-secret | ||
K8S_SERVER_URL: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/cluster-server | ||
K8S_TOKEN: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/cluster-token | ||
type: Opaque |
13 changes: 0 additions & 13 deletions
13
.../tests/golden/defaults/exoscale-metrics-collector/exoscale-metrics-collector/secrets.yaml
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...cale-metrics-collector/exoscale-metrics-collector/exoscale-metrics-collector/secrets.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
data: {} | ||
kind: Secret | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: credentials-exoscale-metrics-collector | ||
name: credentials-exoscale-metrics-collector | ||
namespace: appuio-cloud-reporting | ||
stringData: | ||
EXOSCALE_API_KEY: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-key | ||
EXOSCALE_API_SECRET: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-secret | ||
K8S_SERVER_URL: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/cluster-server | ||
K8S_TOKEN: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/cluster-token | ||
type: Opaque |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters