-
Notifications
You must be signed in to change notification settings - Fork 7
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
Helm Chart Upgrades #4
Open
midnightconman
wants to merge
1
commit into
tsloughter:master
Choose a base branch
from
midnightconman:helm-rework-20180511132825
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,4 @@ | ||
apiVersion: v1 | ||
description: Grafana-Exporter Helm Chart | ||
name: grafana-exporter | ||
version: 0.1.0 | ||
version: 0.1.1 |
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,5 @@ | ||
The Grafana Operator has been installed. Check its status by running: | ||
kubectl --namespace {{ .Release.Namespace }} get pods -l "app={{ template "grafana-exporter.name" . }},release={{ .Release.Name }}" | ||
|
||
Visit https://github.com/tsloughter/grafana-operator for instructions on how | ||
to create & configure Grafana Dashboards and Datasources using the Operator. |
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,32 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "grafana-exporter.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "grafana-exporter.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "grafana-exporter.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
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,21 @@ | ||
{{- if .Values.rbacEnable }} | ||
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} | ||
apiVersion: rbac.authorization.k8s.io/v1alpha1 | ||
{{- end }} | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app: {{ template "grafana-exporter.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
operator: {{ template "grafana-exporter.name" . }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- configmaps | ||
verbs: ["get", "watch", "list"] | ||
{{- end }} |
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,24 @@ | ||
{{- if .Values.rbacEnable }} | ||
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" }} | ||
apiVersion: rbac.authorization.k8s.io/v1alpha1 | ||
{{- end }} | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
app: {{ template "grafana-exporter.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
operator: {{ template "grafana-exporter.name" . }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} |
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,48 +1,61 @@ | ||
apiVersion: extensions/v1beta1 | ||
apiVersion: apps/v1beta2 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
labels: | ||
k8s-app: grafana-operator | ||
operator: grafana | ||
name: grafana-operator | ||
app: {{ template "grafana-exporter.name" . }} | ||
chart: {{ template "grafana-exporter.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
operator: {{ template "grafana-exporter.name" . }} | ||
spec: | ||
replicas: 1 | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "grafana-exporter.name" . }} | ||
release: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: grafana-operator | ||
operator: grafana | ||
app: {{ template "grafana-exporter.name" . }} | ||
release: {{ .Release.Name }} | ||
operator: {{ template "grafana-exporter.name" . }} | ||
spec: | ||
containers: | ||
- name: grafana-operator | ||
image: {{ .Values.grafana.watcher.image }} | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- "-grafana-url={{ .Values.grafana.url }}" | ||
ports: | ||
- containerPort: {{ .Values.grafana.watcher.containerPort }} | ||
name: http | ||
protocol: TCP | ||
env: | ||
- name: GRAFANA_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: grafana-auth | ||
key: username | ||
- name: GRAFANA_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: grafana-auth | ||
key: password | ||
resources: | ||
{{ toYaml .Values.grafana.watcher.resources | indent 11 }} | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 30 | ||
{{- if .Values.grafana.watcher.serviceAccount }} | ||
serviceAccountName: {{ .Values.grafana.watcher.serviceAccount }} | ||
{{- end }} | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: | ||
- "-grafana-url={{ required ".Values.url is required" .Values.url }}" | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
env: | ||
- name: GRAFANA_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
key: username | ||
- name: GRAFANA_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
key: password | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
{{- if .Values.rbacEnable }} | ||
serviceAccountName: {{ template "grafana-exporter.fullname" . }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{ toYaml . | indent 8 }} | ||
{{- end }} |
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,12 +1,16 @@ | ||
{{- if .Values.auth.enable }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: grafana-auth | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
labels: | ||
app: {{ .Values.name }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
app: {{ template "grafana-exporter.name" . }} | ||
chart: {{ template "grafana-exporter.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
operator: {{ template "grafana-exporter.name" . }} | ||
type: Opaque | ||
data: | ||
username: {{ b64enc .Values.grafana.auth.username }} | ||
password: {{ b64enc .Values.grafana.auth.password }} | ||
username: {{ required ".Values.auth.username is required" .Values.auth.username | b64enc }} | ||
password: {{ required ".Values.auth.password is required" .Values.auth.password | b64enc }} | ||
{{- end }} |
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,12 @@ | ||
{{- if .Values.rbacEnable }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: {{ template "grafana-exporter.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
operator: {{ template "grafana-exporter.name" . }} | ||
name: {{ template "grafana-exporter.fullname" . }} | ||
{{- end }} |
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,16 +1,36 @@ | ||
grafana: | ||
url: "" | ||
auth: | ||
username: "" | ||
password: "" | ||
watcher: | ||
image: gavind/grafana-operator:201803061638 | ||
containerPort: 3000 | ||
resources: {} | ||
serviceAccount: | ||
# limits: | ||
# cpu: 200m | ||
# memory: 300Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 50Mi | ||
# Default values for grafana-operator. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
rbacEnable: true | ||
|
||
url: "" | ||
auth: | ||
enable: true | ||
username: "" | ||
password: "" | ||
|
||
replicaCount: 1 | ||
|
||
image: | ||
repository: gavind/grafana-operator | ||
tag: "201803231635" | ||
pullPolicy: IfNotPresent | ||
|
||
resources: {} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
nodeSelector: {} | ||
|
||
tolerations: [] | ||
|
||
affinity: {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious - why
ClusterRole
and not aRole
?