-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nicolas Bigler <nicolas.bigler@vshn.ch>
- Loading branch information
Showing
26 changed files
with
845 additions
and
3 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
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,25 @@ | ||
parameters: | ||
kapitan: | ||
dependencies: | ||
- type: https | ||
source: https://raw.githubusercontent.com/projectsyn/component-crossplane/v2.3.0/lib/crossplane.libsonnet | ||
output_path: vendor/lib/crossplane.libsonnet | ||
|
||
crossplane: | ||
namespace: syn-crossplane | ||
appcat: | ||
providers: | ||
kubernetes: | ||
enabled: true | ||
aws: | ||
enabled: true | ||
controllerConfig: | ||
roleArn: arn:aws:iam::123456789012:role/role-name | ||
services: | ||
generic: | ||
objectstorage: | ||
enabled: false | ||
vshn: | ||
enabled: false | ||
aws: | ||
enabled: true |
85 changes: 85 additions & 0 deletions
85
component/tests/golden/aws/appcat/appcat/10_appcat_billing_recording_rule.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,85 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: appcat-billing | ||
name: appcat-billing | ||
namespace: syn-appcat | ||
spec: | ||
groups: | ||
- name: appcat-billing-rules | ||
rules: | ||
- expr: | | ||
sum by (label_appcat_vshn_io_claim_namespace,label_appcat_vshn_io_sla,product,provider,architecture, category, claim_namespace,tenant_id) ( | ||
# Sum values over one hour and get mean | ||
sum_over_time( | ||
# Udpate label product: $product:$provider:$tenant_id:$claim_namespace:$architecture | ||
label_join( | ||
# Add label category: $provider:$claim_namespace | ||
label_join( | ||
# Add label architecture: $SLA, where $SLA is the content of label appcat.vshn.io/sla | ||
label_replace( | ||
# Add label provider: vshn | ||
label_replace( | ||
# Add label product: postgres | ||
label_replace( | ||
# Default appcat.vshn.io/sla to besteffort if it is not set | ||
label_replace( | ||
# Copy label appcat.vshn.io/namespace to label claim_namespace | ||
label_replace( | ||
# Populate tenant_id | ||
label_replace( | ||
# Fetch all namespaces with label label_appuio_io_billing_name=~"appcat-.+" | ||
kube_namespace_labels{ label_appuio_io_billing_name=~"appcat-.+"} * | ||
on (namespace) group_right(label_appuio_io_organization,label_appcat_vshn_io_claim_namespace,label_appcat_vshn_io_sla, label_appuio_io_billing_name) | ||
kube_pod_info{created_by_kind!="Job"}, | ||
"tenant_id", | ||
"t-silent-test-1234", | ||
"", | ||
"" | ||
), | ||
"claim_namespace", | ||
"$1", | ||
"label_appcat_vshn_io_claim_namespace", | ||
"(.*)" | ||
), | ||
"label_appcat_vshn_io_sla", | ||
"besteffort", | ||
"label_appcat_vshn_io_sla", | ||
"^$" | ||
), | ||
"product", | ||
"appcat_$1", | ||
"label_appuio_io_billing_name", | ||
"appcat-(.+)" | ||
), | ||
"provider", | ||
"vshn", | ||
"", | ||
"" | ||
), | ||
"sla", | ||
"$1", | ||
"label_appcat_vshn_io_sla", | ||
"(.*)" | ||
), | ||
"category", | ||
":", | ||
"provider", | ||
"claim_namespace" | ||
), | ||
"product", | ||
":", | ||
"product", | ||
"provider", | ||
"tenant_id", | ||
"claim_namespace", | ||
"sla" | ||
# other billing queries have [59m:1m] here. This is due to some | ||
# obscure discrepancies between how the cloud-reporting evaluates the query | ||
# and how the GUI/recording rules evaluate the query. | ||
)[60m:1m] | ||
)/60 ) | ||
record: appcat:billing |
15 changes: 15 additions & 0 deletions
15
component/tests/golden/aws/appcat/appcat/10_appcat_maintenance_recording_rule.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: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: appcat-maintenance | ||
name: appcat-maintenance | ||
namespace: syn-appcat | ||
spec: | ||
groups: | ||
- name: appcat-cluster-maintenance | ||
rules: | ||
- expr: max(max_over_time(openshift_upgrade_controller_upgradejob_state{state="active"}[10m])) | ||
or vector(0) | ||
record: appcat:cluster:maintenance |
8 changes: 8 additions & 0 deletions
8
component/tests/golden/aws/appcat/appcat/10_appcat_namespace.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,8 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: syn-appcat | ||
openshift.io/cluster-monitoring: 'true' | ||
name: syn-appcat |
44 changes: 44 additions & 0 deletions
44
component/tests/golden/aws/appcat/appcat/10_clusterrole_services_read.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,44 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: appcat-services-read | ||
name: appcat:services:read | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- pods | ||
- pods/log | ||
- pods/status | ||
- events | ||
- services | ||
- namespaces | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- statefulsets | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- pods/portforward | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- apiGroups: | ||
- '' | ||
- project.openshift.io | ||
resources: | ||
- projects | ||
verbs: | ||
- get |
20 changes: 20 additions & 0 deletions
20
component/tests/golden/aws/appcat/appcat/10_clusterrole_view.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,20 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
annotations: {} | ||
labels: | ||
rbac.authorization.k8s.io/aggregate-to-admin: 'true' | ||
rbac.authorization.k8s.io/aggregate-to-edit: 'true' | ||
rbac.authorization.k8s.io/aggregate-to-view: 'true' | ||
name: appcat:browse | ||
rules: | ||
- apiGroups: | ||
- apiextensions.crossplane.io | ||
resources: | ||
- compositions | ||
- compositionrevisions | ||
- compositeresourcedefinitions | ||
verbs: | ||
- get | ||
- list | ||
- watch |
45 changes: 45 additions & 0 deletions
45
component/tests/golden/aws/appcat/appcat/10_provider_aws.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: pkg.crossplane.io/v1 | ||
kind: Provider | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
argocd.argoproj.io/sync-wave: '10' | ||
labels: | ||
name: aws | ||
name: aws | ||
spec: | ||
controllerConfigRef: | ||
name: aws | ||
package: xpkg.upbound.io/upbound/provider-aws:0.43.0 | ||
--- | ||
apiVersion: aws.upbound.io/v1beta1 | ||
kind: ProviderConfig | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
argocd.argoproj.io/sync-wave: '10' | ||
labels: | ||
name: aws | ||
name: aws | ||
spec: | ||
credentials: | ||
source: IRSA | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
annotations: | ||
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/role-name | ||
labels: | ||
name: provider-aws | ||
name: provider-aws | ||
namespace: syn-crossplane | ||
--- | ||
apiVersion: pkg.crossplane.io/v1alpha1 | ||
kind: ControllerConfig | ||
metadata: | ||
annotations: | ||
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/role-name | ||
labels: | ||
name: aws | ||
name: aws |
Oops, something went wrong.