Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(canary): add prometheus component #151

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions features/canary/prometheus/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patchesStrategicMerge:
- spinnaker-config.yml

transformers:
- tfr-namespace-roles.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#-----------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Example configuration for enabling canary through prometheus endpoints
#-----------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
apiVersion: spinnaker.armory.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker
spec:
validation:
providers:
canary:
enabled: false
spinnakerConfig:
config:
canary:
Expand All @@ -16,12 +20,23 @@ spec:
accounts:
- name: prometheus
endpoint:
baseUrl: http://myprometheus # (Required). The base URL to the Prometheus server.
baseUrl: http://prometheus:9090 # (Required). The base URL to the Prometheus server.
supportedTypes:
- METRICS_STORE
#username: admin # (Optional). Username for Prometheus Basic Auth
#password: encrypted:k8s!n:spin-secrets!k:prometheus-password # (Optional). Password for Prometheus Basic Auth

- name: aws
enabled: true
accounts:
- name: aws
bucket: armory-kayenta-test-bucket
region: us-west-2
rootFolder: kayenta
supportedTypes:
- CONFIGURATION_STORE
- OBJECT_STORE
s3Enabled: true
reduxLoggerEnabled: true # Whether or not to enable redux logging in the canary module in deck (Default: true).
defaultJudge: NetflixACAJudge-v1.0 # Name of canary judge to use by default (Default: NetflixACAJudge-v1.0).
stagesEnabled: true # Whether or not to enable canary stages in deck (Default: true).
Expand Down
8 changes: 8 additions & 0 deletions features/canary/prometheus/tfr-namespace-roles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: add-namespace-to-service-account-resources
fieldSpecs:
- kind: ClusterRoleBinding
group: rbac.authorization.k8s.io
path: subjects/namespace
12 changes: 12 additions & 0 deletions features/operations/observability/prometheus/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patchesStrategicMerge:
- spinnaker-config.yml

configMapGenerator:
- name: grafana-dashboard-spinnaker
files:
- spinnaker-dashboards.json
options:
disableNameSuffixHash: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ metadata:
name: spinnaker
spec:
spinnakerConfig:
config:
metricStores:
prometheus:
enabled: true
add_source_metalabels: true
#config:
#metricStores:
#prometheus:
#enabled: true
#add_source_metalabels: true

# # Config used if prometheus server discover pods through annotations
# service-settings:
# spinnaker:
# kubernetes:
# podAnnotations:
# prometheus.io/scrape: true
# prometheus.io/path: /prometheus_metrics
# prometheus.io/port: 8008
service-settings:
spinnaker:
kubernetes:
podAnnotations:
prometheus.io/scrape: true
prometheus.io/path: /prometheus_metrics
prometheus.io/port: 8008
13 changes: 0 additions & 13 deletions infrastructure/prometheus-grafana/kustomization.yml

This file was deleted.

4 changes: 4 additions & 0 deletions third-party/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# third-party

This directory contains components that build or configure third-party tools
that interact with Spinnaker.
13 changes: 13 additions & 0 deletions third-party/prometheus/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- prometheus-grafana.yml

secretGenerator:
- name: prometheus-secrets
literals:
- grafanaDefaultUser=DefaultUser1!
- grafanaDefaultPassword=DefaultPass1!
options:
disableNameSuffixHash: true
Original file line number Diff line number Diff line change
Expand Up @@ -1375,12 +1375,12 @@ spec:
- name: GF_SECURITY_ADMIN_USER
valueFrom:
secretKeyRef:
name: spin-secrets
name: prometheus-secrets
key: grafanaDefaultUser
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: spin-secrets
name: prometheus-secrets
key: grafanaDefaultPassword
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "false"
Expand Down