Skip to content

Commit

Permalink
Merge pull request #17 from kd7lxl/upstream
Browse files Browse the repository at this point in the history
Merge upstream changes from integr8ly @ v3.10.0
  • Loading branch information
kd7lxl authored Apr 21, 2021
2 parents 4d84d01 + ef91cd0 commit fe040d3
Show file tree
Hide file tree
Showing 68 changed files with 4,952 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
labels: enhancement, needs triage
assignees: ''

---
Expand Down
48 changes: 29 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ A Kubernetes Operator based on the Operator SDK for creating and managing Grafan
<table class="tg">
<tbody>
<tr>
<td class="tg-0lax">
<td class="tg-0lax">
<div class="card" css=>
<img src="media/users/redhat.png" alt="Avatar" style= width=250 height=100;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;">
<div class="container" style="text-align: center; margin: auto; padding: 2px 16px;">
<h4><b></b></h4>
<p><a href="https://www.redhat.com/">Red Hat</a></p>
</div>
</div>
</td>
<td class="tg-0lax">
</div>
</td>
<td class="tg-0lax">
<div class="card" css=>
<img src="media/users/integreatly.png" alt="Avatar" style=margin: auto;width="250" height="100" box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;">
<div class="container" style="text-align: center; padding: 2px 16px;">
<h4><b><a href ="https://github.com/integr8ly/integreatly-operator">Integreatly</a></b></h4>
<p><a href="https://www.redhat.com/en/products/integration">Red Hat</a></p>
</div>
</div>
</div>
</td>
<td class="tg-0lax"> <div class="card" css=>
<img src="media/users/continental.png" alt="Avatar" style="margin: auto;width="250" height="100" box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
Expand All @@ -36,17 +36,27 @@ A Kubernetes Operator based on the Operator SDK for creating and managing Grafan
<h4><b>Digital Services France</b></h4>
<p><a href="https://www.continental.com/">Continental</a></p>
</div>
</div>
</div>
</td>
<td class="tg-0lax">
<td class="tg-0lax">
<div class="card" css=>
<img src="media/users/handelsbanken.svg" alt="Avatar" style=margin:auto; width=250; height=150; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;">
<div class="container" style="text-align: center; margin: auto; padding: 2px 16px;">
<h4><b><a href="https://www.handelsbanken.se/en/">handelsbanken</a></b></h4>
<p></p>
</div>
</div>
</div>
</td>
<td class="tg-0lax">
<div class="card" css=>
<img src="media/users/xenit.png" alt="Avatar" style=margin:auto; width=250; max-height=150; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;">
<div class="container" style="text-align: center; margin: auto; padding: 2px 16px;">
<h4><b><a href="https://xenit.se/contact/">xenit</a></b></h4>
<p></p>
</div>
</div>
</td>

<!-- PLACE ME HERE -->
Expand All @@ -57,35 +67,35 @@ A Kubernetes Operator based on the Operator SDK for creating and managing Grafan
***If you find this operator useful in your product/deployment, feel free to send a pull request to add your company/team to be displayed here!***

<!-- COPY ME -->
<!-- <td class="tg-0lax">
<!-- <td class="tg-0lax">
<div class="card" css=>
<img src="media/users/integreatly.png" alt="Avatar" style="margin: auto; width:100%; height: box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;">
<div class="container" style="text-align: center; margin: auto; padding: 2px 16px;">
<h4><b>Integreatly</b></h4>
<p>Red Hat</p>
</div>
</div>
</div>
</td> -->



## Grafana Operator on the Kubernetes community Slack
We have set up a channel dedicated to this operator on the Kubernetes community Slack, this is an easier way to address
We have set up a channel dedicated to this operator on the Kubernetes community Slack, this is an easier way to address
more immediate issues and facilitate discussion around development/bugs etc. as well as providing support for questions
about the operator.

1: Join the Kubernetes Slack (if you have not done so already) [Kubernetes Slack](https://slack.k8s.io/).

2: You will receive an email with an invitation link, follow that link and enter your desired username and password for the workspace(it might be easier if you use your Github username for our channel).

3: Once registered and able to see the Kubernetes community Slack workspace and channels follow this link to the [grafana-operator channel](https://kubernetes.slack.com/messages/grafana-operator/ ).

Alternatively:
If you're already a member of that workspace then just follow this link to the [grafana-operator channel](https://kubernetes.slack.com/messages/grafana-operator/ ) or search for "grafana-operator" in the browse channels option .

![image](https://user-images.githubusercontent.com/35736504/90978105-0b195300-e543-11ea-86ee-1825da0e3b75.png)



# Current status
Expand All @@ -98,12 +108,12 @@ It can deploy and manage a Grafana instance on Kubernetes and OpenShift. The fol
* Import Grafana dashboards from the same or other namespaces
* Assign Grafana dashboards to custom or namespace-named grafana folders
* Import Grafana datasources from the same namespace
* Install Plugins (panels) defined as dependencies of dashboards
* Install Plugins (panels) defined as dependencies of dashboards

# Summary of benefits
A list of benefits of using the operator over a single grafana deployment.

[The benefits of using an operator over standalone products as outlined by the people that created them](https://operatorframework.io/)
[The benefits of using an operator over standalone products as outlined by the people that created them](https://operatorframework.io/)

Grafana-operator specific benefits over standalone Grafana:

Expand Down Expand Up @@ -180,4 +190,4 @@ $ operator-sdk run local --namespace=<namespace> --operator-flags="<flags to pas

## Notifier provisioning

Grafana has provisioning support for multiple channels (notifiers) of alerts. The operator does currently not support this type of provisioning. An empty directory is mounted at the expected location to prevent a warning in the grafana log. This feature might be supported in the future.
Grafana has provisioning support for multiple channels (notifiers) of alerts. The operator does currently not support this type of provisioning. An empty directory is mounted at the expected location to prevent a warning in the grafana log. This feature might be supported in the future.
7 changes: 4 additions & 3 deletions deploy/cluster_roles/cluster_role_grafana_operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ rules:
- grafanadashboards/status
- grafananotificationchannels
- grafananotificationchannels/status
verbs: ['get', 'list', 'update', 'watch']
- configmaps
verbs: ["get", "list", "update", "watch"]
- apiGroups:
- ""
resources:
- namespaces
verbs: ['get', 'list', 'watch']
verbs: ["get", "list", "watch"]
- apiGroups:
- ""
resources:
- events
verbs: ['create', 'patch']
verbs: ["create", "patch"]
19 changes: 18 additions & 1 deletion deploy/crds/Grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ spec:
enabled:
type: boolean
description: Create an ingress / route
ingressClassName:
type: string
description: Ingress class name
path:
type: string
description: Ingress path
pathType:
type: string
description: pathType specifies how ingress paths should be matched
hostname:
type: string
description: The hostname of the ingress / route
Expand Down Expand Up @@ -144,7 +150,18 @@ spec:
priorityClassName:
type: string
description: Pod priority class name

extraVolumeMounts:
type: array
description: Extra volumes mounts to be mounted to the grafana deployment
items:
type: object
description: additional volumeMount
extraVolumes:
type: array
description: Extra volumes to be attached to the grafana deployment
items:
type: object
description: additional volume
serviceAccount:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions deploy/examples/dashboards/DashboardFromConfigMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
labels:
app: grafana
spec:
json:
""
configMapRef:
name: simple-dashboard-from-cm
key: foo
Expand Down
1 change: 0 additions & 1 deletion deploy/examples/dashboards/DashboardFromURL.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ metadata:
app: grafana
spec:
url: https://raw.githubusercontent.com/integr8ly/grafana-operator/master/deploy/examples/remote/grafana-dashboard.json
json:
24 changes: 24 additions & 0 deletions deploy/examples/datasource-env-vars/Grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
name: example-grafana
spec:
deployment:
skipCreateAdminAccount: true
envFrom:
- secretRef:
name: external-credentials
ingress:
enabled: True
config:
log:
mode: "console"
level: "warn"
auth:
disable_login_form: False
disable_signout_menu: True
auth.anonymous:
enabled: True
dashboardLabelSelector:
- matchExpressions:
- { key: app, operator: In, values: [ grafana ] }
19 changes: 19 additions & 0 deletions deploy/examples/datasource-env-vars/Prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDataSource
metadata:
name: example-grafanadatasource
spec:
name: middleware.yaml
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus-service:9090
isDefault: true
version: 1
editable: true
secureJsonData:
basicAuthPassword: $BASIC_AUTH_PASSWORD
jsonData:
tlsSkipVerify: true
timeInterval: "5s"
10 changes: 10 additions & 0 deletions deploy/examples/datasource-env-vars/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: Secret
apiVersion: v1
metadata:
name: external-credentials
namespace: grafana
stringData:
GF_SECURITY_ADMIN_PASSWORD: secret
GF_SECURITY_ADMIN_USER: root
BASIC_AUTH_PASSWORD: password
type: Opaque
53 changes: 53 additions & 0 deletions deploy/examples/extraVolumes/Grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
name: example-grafana
spec:
deployment:
extraVolumeMounts:
- mountPath: /data/cache
name: example-cache
- mountPath: /opt/extra/secrets
name: example-secret
extraVolumes:
- name: example-cache
emptyDir: { }
- name: example-secret
secret:
secretName: volume-secret
ingress:
enabled: True
config:
log:
mode: "console"
level: "warn"
auth:
disable_login_form: False
disable_signout_menu: True
auth.anonymous:
enabled: True
service:
name: "grafana-service"
labels:
app: "grafana"
type: "grafana-service"
dashboardLabelSelector:
- matchExpressions:
- { key: app, operator: In, values: [ grafana ] }
# initResources:
# # Optionally specify initResources
# limits:
# cpu: 1000m
# memory: 512Mi
# requests:
# cpu: 250m
# memory: 128Mi
resources:
# Optionally specify container resources
limits:
cpu: 2000m
memory: 8000Mi
requests:
cpu: 100m
memory: 200Mi

7 changes: 7 additions & 0 deletions deploy/examples/extraVolumes/volume-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
stringData:
file.txt: "Hello World"
kind: Secret
metadata:
name: volume-secret
type: Opaque
7 changes: 5 additions & 2 deletions deploy/examples/ha/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ spec:
selector:
app: postgres
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
Expand Down Expand Up @@ -57,4 +60,4 @@ spec:
name: postgredb
volumes:
- name: postgredb
emptyDir: {}
emptyDir: {}
29 changes: 29 additions & 0 deletions deploy/examples/persistentvolume/Grafana-Kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
name: example-grafana
spec:
ingress:
enabled: True
dataStorage:
accessModes:
- ReadWriteOnce
size: 10Gi
deployment:
securityContext:
fsGroup: 472
config:
log:
mode: "console"
level: "warn"
security:
admin_user: "root"
admin_password: "secret"
auth:
disable_login_form: False
disable_signout_menu: True
auth.anonymous:
enabled: True
dashboardLabelSelector:
- matchExpressions:
- { key: app, operator: In, values: [ grafana ] }
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
enabled: True
dataStorage:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
size: 10Gi
config:
log:
Expand All @@ -23,4 +23,4 @@ spec:
enabled: True
dashboardLabelSelector:
- matchExpressions:
- {key: app, operator: In, values: [grafana]}
- { key: app, operator: In, values: [ grafana ] }
Loading

0 comments on commit fe040d3

Please sign in to comment.