Skip to content

Commit

Permalink
chore(k8s/amour): grafana operator
Browse files Browse the repository at this point in the history
  • Loading branch information
uhthomas committed Mar 31, 2024
1 parent 4442405 commit a2c2a41
Show file tree
Hide file tree
Showing 13 changed files with 8,151 additions and 0 deletions.
1 change: 1 addition & 0 deletions k8s/amour/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cue_export(
"//k8s/amour/dcgm_exporter:cue_dcgm_exporter_library",
"//k8s/amour/external_secrets:cue_external_secrets_library",
"//k8s/amour/grafana:cue_grafana_library",
"//k8s/amour/grafana_operator:cue_grafana_operator_library",
"//k8s/amour/home_assistant:cue_home_assistant_library",
"//k8s/amour/karma:cue_karma_library",
"//k8s/amour/kube_state_metrics:cue_kube_state_metrics_library",
Expand Down
25 changes: 25 additions & 0 deletions k8s/amour/grafana_operator/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@com_github_tnarg_rules_cue//cue:cue.bzl", "cue_library")

cue_library(
name = "cue_grafana_operator_library",
srcs = [
"cluster_role_binding_list.cue",
"cluster_role_list.cue",
"custom_resource_definition_list.cue",
"deployment_list.cue",
"list.cue",
"namespace_list.cue",
"service_account_list.cue",
"service_list.cue",
"vm_service_scrape_list.cue",
],
importpath = "github.com/uhthomas/automata/k8s/amour/grafana_operator",
visibility = ["//visibility:public"],
deps = [
"//cue.mod/gen/github.com/VictoriaMetrics/operator/api/victoriametrics/v1beta1:cue_v1beta1_library",
"//cue.mod/gen/k8s.io/api/apps/v1:cue_v1_library",
"//cue.mod/gen/k8s.io/api/core/v1:cue_v1_library",
"//cue.mod/gen/k8s.io/api/rbac/v1:cue_v1_library",
"//cue.mod/gen/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1:cue_v1_library",
],
)
3 changes: 3 additions & 0 deletions k8s/amour/grafana_operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Grafana Operator

[https://github.com/grafana/grafana-operator](https://github.com/grafana/grafana-operator)
25 changes: 25 additions & 0 deletions k8s/amour/grafana_operator/cluster_role_binding_list.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package grafana_operator

import rbacv1 "k8s.io/api/rbac/v1"

#ClusterRoleBindingList: rbacv1.#ClusterRoleBindingList & {
apiVersion: "rbac.authorization.k8s.io/v1"
kind: "ClusterRoleBindingList"
items: [...{
apiVersion: "rbac.authorization.k8s.io/v1"
kind: "ClusterRoleBinding"
}]
}

#ClusterRoleBindingList: items: [{
roleRef: {
apiGroup: rbacv1.#GroupName
kind: "ClusterRole"
name: #Name
}
subjects: [{
name: #Name
namespace: #Namespace
kind: rbacv1.#ServiceAccountKind
}]
}]
111 changes: 111 additions & 0 deletions k8s/amour/grafana_operator/cluster_role_list.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package grafana_operator

import (
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/api/core/v1"
)

#ClusterRoleList: rbacv1.#ClusterRoleList & {
apiVersion: "rbac.authorization.k8s.io/v1"
kind: "ClusterRoleList"
items: [...{
apiVersion: "rbac.authorization.k8s.io/v1"
kind: "ClusterRole"
}]
}

#ClusterRoleList: items: [{
rules: [{
apiGroups: [v1.#GroupName]
resources: ["configmaps"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
}, {
apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
}, {
apiGroups: [v1.#GroupName]
resources: ["events"]
verbs: ["create", "patch"]
}, {
apiGroups: [v1.#GroupName]
resources: ["configmaps", "persistentvolumeclaims", "secrets", "serviceaccounts", "services"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: [v1.#GroupName]
resources: ["events"]
verbs: ["create", "get", "list", "patch", "watch"]
}, {
apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanaalertrulegroups"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanaalertrulegroups/finalizers"]
verbs: ["update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanaalertrulegroups/status"]
verbs: ["get", "patch", "update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanadashboards"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanadashboards/finalizers"]
verbs: ["update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanadashboards/status"]
verbs: ["get", "patch", "update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanadatasources"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanadatasources/finalizers"]
verbs: ["update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanadatasources/status"]
verbs: ["get", "patch", "update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanafolders"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanafolders/finalizers"]
verbs: ["update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanafolders/status"]
verbs: ["get", "patch", "update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanas"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanas/finalizers"]
verbs: ["update"]
}, {
apiGroups: ["grafana.integreatly.org"]
resources: ["grafanas/status"]
verbs: ["get", "patch", "update"]
}, {
apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
}, {
apiGroups: ["route.openshift.io"]
resources: ["routes", "routes/custom-host"]
verbs: ["create", "delete", "get", "list", "update", "watch"]
}]
}]
Loading

0 comments on commit a2c2a41

Please sign in to comment.