-
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 #1 from tegridy-io/feat/support-grafana-operator
Add grafana-operator deployment
- Loading branch information
Showing
16 changed files
with
4,985 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,47 @@ | ||
parameters: | ||
sentry_operators: | ||
=_metadata: {} | ||
namespace: syn-sentry-operators | ||
|
||
# --- Component configuration ---------------------------------------------- | ||
|
||
namespace: | ||
annotations: {} | ||
labels: {} | ||
name: syn-sentry-operators | ||
|
||
charts: | ||
grafana: | ||
source: https://github.com/grafana/grafana-operator.git | ||
version: v5.6.3 | ||
agent: | ||
source: https://grafana.github.io/helm-charts | ||
version: 0.3.17 | ||
|
||
# ------ Operator ---------------------------------------------------------- | ||
|
||
operator: | ||
grafana: | ||
enabled: false | ||
resources: {} | ||
nodeSelector: {} | ||
tolerations: [] | ||
|
||
# agent: | ||
# enabled: false | ||
# resources: {} | ||
# nodeSelector: {} | ||
# tolerations: [] | ||
|
||
# --- Helm configuration --------------------------------------------------- | ||
|
||
helmValues: | ||
grafana: | ||
resources: ${sentry_operators:operator:grafana:resources} | ||
nodeSelector: ${sentry_operators:operator:grafana:nodeSelector} | ||
tolerations: ${sentry_operators:operator:grafana:tolerations} | ||
|
||
# agent: | ||
# fullnameOverride: agent-operator | ||
# resources: ${sentry_operators:operator:agent:resources} | ||
# nodeSelector: ${sentry_operators:operator:agent:nodeSelector} | ||
# tolerations: ${sentry_operators:operator:agent:tolerations} |
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 |
---|---|---|
@@ -1,10 +1,18 @@ | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local inv = kap.inventory(); | ||
local params = inv.parameters.sentry_operators; | ||
local params = inv.parameters.insights_grafana; | ||
local argocd = import 'lib/argocd.libjsonnet'; | ||
|
||
local app = argocd.App('sentry-operators', params.namespace); | ||
local app = argocd.App('sentry-operators', params.namespace.name); | ||
|
||
{ | ||
'sentry-operators': app, | ||
'sentry-operators': app { | ||
spec+: { | ||
syncPolicy+: { | ||
syncOptions+: [ | ||
'ServerSideApply=true', | ||
], | ||
}, | ||
}, | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,10 +1,29 @@ | ||
// main template for sentry-operators | ||
// main template for insights-grafana | ||
local com = import 'lib/commodore.libjsonnet'; | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local inv = kap.inventory(); | ||
|
||
// The hiera parameters for the component | ||
local params = inv.parameters.sentry_operators; | ||
|
||
// Namespace | ||
local namespace = kube.Namespace(params.namespace.name) { | ||
metadata: { | ||
[if std.length(params.namespace.annotations) > 0 then 'annotations']: params.namespace.annotations, | ||
labels: { | ||
'app.kubernetes.io/name': params.namespace.name, | ||
'app.kubernetes.io/part-of': 'insights', | ||
'app.kubernetes.io/managed-by': 'commodore', | ||
'pod-security.kubernetes.io/enforce': 'baseline', | ||
'pod-security.kubernetes.io/warn': 'restricted', | ||
'pod-security.kubernetes.io/audit': 'restricted', | ||
} + com.makeMergeable(params.namespace.labels), | ||
name: params.namespace.name, | ||
}, | ||
}; | ||
|
||
// Define outputs below | ||
{ | ||
'00_namespace': namespace, | ||
} |
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,7 @@ | ||
local com = import 'lib/commodore.libjsonnet'; | ||
|
||
local dir = std.extVar('output_path'); | ||
|
||
// fixupDir already drops `null` objects, so we can just give the identity | ||
// function as the 2nd argument. | ||
com.fixupDir(dir, function(o) o) |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Overwrite parameters here | ||
|
||
# parameters: {...} | ||
parameters: | ||
sentry_operators: | ||
operator: | ||
grafana: | ||
enabled: true | ||
# agent: | ||
# enabled: true |
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,4 @@ | ||
spec: | ||
syncPolicy: | ||
syncOptions: | ||
- ServerSideApply=true |
11 changes: 11 additions & 0 deletions
11
tests/golden/defaults/sentry-operators/sentry-operators/00_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,11 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: syn-sentry-operators | ||
app.kubernetes.io/part-of: insights | ||
pod-security.kubernetes.io/audit: restricted | ||
pod-security.kubernetes.io/enforce: baseline | ||
pod-security.kubernetes.io/warn: restricted | ||
name: syn-sentry-operators |
Oops, something went wrong.