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

Grafana persistence #110

Merged
merged 10 commits into from
Aug 12, 2018
Merged
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
835 changes: 0 additions & 835 deletions assets/grafana/deployment-dashboard.json

This file was deleted.

1,091 changes: 0 additions & 1,091 deletions assets/grafana/kubernetes-capacity-planing-dashboard.json

This file was deleted.

759 changes: 0 additions & 759 deletions assets/grafana/kubernetes-cluster-health-dashboard.json

This file was deleted.

2,025 changes: 0 additions & 2,025 deletions assets/grafana/kubernetes-cluster-status-dashboard.json

This file was deleted.

1,311 changes: 0 additions & 1,311 deletions assets/grafana/kubernetes-cluster-usage-dashboard.json

This file was deleted.

684 changes: 0 additions & 684 deletions assets/grafana/kubernetes-control-plane-status-dashboard.json

This file was deleted.

448 changes: 0 additions & 448 deletions assets/grafana/kubernetes-resource-requests-dashboard.json

This file was deleted.

931 changes: 0 additions & 931 deletions assets/grafana/nodes-dashboard.json

This file was deleted.

434 changes: 0 additions & 434 deletions assets/grafana/pods-dashboard.json

This file was deleted.

7 changes: 0 additions & 7 deletions assets/grafana/prometheus-datasource.json

This file was deleted.

34 changes: 5 additions & 29 deletions deploy
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ do
if [[ $use_gke =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo "Grant cluster-admin permissions to your current identity"
echo "Remove rules for self hosted clusters"
rm assets/prometheus/rules//kube-apiserver.rules
rm assets/prometheus/rules//kube-controller-manager.rules
rm assets/prometheus/rules//kube-scheduler.rules

echo
kubectl create clusterrolebinding admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value core/account)
fi
Expand All @@ -110,9 +108,6 @@ do
read -p "Y/N [N]: " use_aks
if [[ $use_aks =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo "Remove rules for self hosted clusters"
rm assets/prometheus/rules//kube-apiserver.rules
rm assets/prometheus/rules//kube-controller-manager.rules
rm assets/prometheus/rules//kube-scheduler.rules
echo
fi
sed -i -e 's,type,'kind',g' manifests/prometheus/prometheus-k8s.yaml;
Expand Down Expand Up @@ -372,31 +367,12 @@ echo
echo -e "${ORANGE}Deploying Grafana"
tput sgr0

#grafana administrator username
read -p "Enter Grafana administrator username [admin]: " GRAFANA_ADMIN_USERNAME
GRAFANA_ADMIN_USERNAME=${GRAFANA_ADMIN_USERNAME:-admin}

#grafana administrator password
prompt="Enter Grafana administrator password: "
while IFS= read -p "$prompt" -r -s -n 1 char
do
if [[ $char == $'\0' ]]
then
break
fi
prompt='*'
grafana_admin_password+="$char"
done
kctl apply -f manifests/grafana

echo

#create grafana credentials secret
kctl create secret generic grafana-credentials --from-literal=user=$GRAFANA_ADMIN_USERNAME --from-literal=password=$grafana_admin_password

#generate grafana dashboards configmap
(cd ./scripts; ./generate-dashboards-configmap.sh)

kctl apply -f manifests/grafana
echo -e "${ORANGE}Grafana default credentials"
echo -e "${WHITE}user: ${ORANGE}admin, ${WHITE}password: ${ORANGE}admin"
tput sgr0

#prometheus
echo
Expand Down
17 changes: 17 additions & 0 deletions manifests/grafana/grafana-dasboard-sources.cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: ConfigMap
metadata:
name: grafana-dashboards
apiVersion: v1
data:
dashboards.yaml: |-
[
{
"folder": "",
"name": "0",
"options": {
"path": "/grafana-dashboard-definitions/0"
},
"org_id": 1,
"type": "file"
}
]
Loading