Skip to content

Commit

Permalink
Merge pull request #220 from K-Phoen/cloudwatch
Browse files Browse the repository at this point in the history
CloudWatch datasources support
  • Loading branch information
K-Phoen authored Apr 10, 2023
2 parents 0f33970 + 339a3c5 commit 266a25e
Show file tree
Hide file tree
Showing 17 changed files with 492 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ dev-env-provision: ## Provision the development k3d cluster with useful tools (G
# Grafana, loki, prometheus, ...
helm upgrade \
--install loki grafana/loki-stack \
--set grafana.enabled=true,grafana.image.tag=8.5.1,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false
--set grafana.enabled=true,grafana.image.tag=9.4.7,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false
# InfluxDB
helm upgrade --install influxdb bitnami/influxdb \
--set auth.enabled=false
Expand Down
32 changes: 32 additions & 0 deletions api/v1alpha1/datasource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type DatasourceSpec struct {
Jaeger *JaegerDatasource `json:"jaeger,omitempty"`
Loki *LokiDatasource `json:"loki,omitempty"`
Tempo *TempoDatasource `json:"tempo,omitempty"`
CloudWatch *CloudWatchDatasource `json:"cloudwatch,omitempty"`
}

type PrometheusDatasource struct {
Expand Down Expand Up @@ -164,6 +165,37 @@ type JaegerDatasource struct {
TraceToLogs *TraceToLogs `json:"trace_to_logs,omitempty"`
}

type CloudWatchDatasource struct {
Default *bool `json:"default,omitempty"`

Auth *CloudWatchAuth `json:"auth,omitempty"`

// Endpoint specifies a custom endpoint for the CloudWatch service.
Endpoint string `json:"endpoint,omitempty"`

// DefaultRegion sets the default region to use.
DefaultRegion string `json:"default_region,omitempty"`

// AssumeRoleARN specifies the ARN of a role to assume.
// Format: arn:aws:iam:*
AssumeRoleARN string `json:"assume_role_arn,omitempty"`

// ExternalID specifies the external identifier of a role to assume in another account.
ExternalID string `json:"external_id,omitempty"`

// CustomMetricsNamespaces specifies a list of namespaces for custom metrics.
CustomMetricsNamespaces []string `json:"custom_metrics_namespaces,omitempty"`
}

type CloudWatchAuth struct {
Keys *CloudWatchAuthKeys `json:"keys,omitempty"`
}

type CloudWatchAuthKeys struct {
Access string `json:"access"`
Secret *ValueOrRef `json:"secret"`
}

type BasicAuth struct {
Username ValueOrRef `json:"username"`
Password ValueOrRef `json:"password"`
Expand Down
101 changes: 101 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions config/crd/bases/k8s.kevingomez.fr_alertmanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: alertmanagers.k8s.kevingomez.fr
spec:
Expand Down Expand Up @@ -82,6 +82,7 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
type: object
Expand Down Expand Up @@ -130,6 +131,7 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
api_url:
Expand Down Expand Up @@ -175,6 +177,7 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
type: object
Expand Down Expand Up @@ -246,9 +249,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
8 changes: 1 addition & 7 deletions config/crd/bases/k8s.kevingomez.fr_apikeys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: apikeys.k8s.kevingomez.fr
spec:
Expand Down Expand Up @@ -73,9 +73,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit 266a25e

Please sign in to comment.