-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Private/mayuresh/pmk 3861 monitoring (#23)
* PMK-3861 Added support for monitoring
- Loading branch information
1 parent
585a6eb
commit ae3ea49
Showing
28 changed files
with
51,198 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,170 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: grafana | ||
namespace: pf9-monitoring | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: grafana | ||
template: | ||
metadata: | ||
labels: | ||
app: grafana | ||
spec: | ||
containers: | ||
{{- if .DockerRegistry }} | ||
- image: {{ .DockerRegistry }}/nginx:stable | ||
{{- else }} | ||
- image: nginx:stable | ||
{{- end }} | ||
imagePullPolicy: IfNotPresent | ||
name: proxy | ||
ports: | ||
- containerPort: 80 | ||
protocol: TCP | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- mountPath: /etc/nginx | ||
name: nginx-conf | ||
readOnly: true | ||
- mountPath: /var/log/nginx | ||
name: log | ||
{{- if .DockerRegistry }} | ||
- image: {{ .DockerRegistry }}/grafana/grafana:7.2.0 | ||
{{- else }} | ||
- image: grafana/grafana:7.2.0 | ||
{{- end }} | ||
imagePullPolicy: IfNotPresent | ||
name: grafana | ||
ports: | ||
- containerPort: 3000 | ||
name: http | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /api/health | ||
port: http | ||
scheme: HTTP | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
volumeMounts: | ||
- mountPath: /etc/grafana | ||
name: grafana-conf | ||
readOnly: true | ||
- mountPath: /var/lib/grafana | ||
name: grafana-storage | ||
- mountPath: /etc/grafana/provisioning/datasources | ||
name: grafana-datasources | ||
- mountPath: /etc/grafana/provisioning/dashboards | ||
name: grafana-dashboards | ||
- mountPath: /grafana-dashboard-definitions/0/grafana-dashboard-apiserver | ||
name: grafana-dashboard-apiserver | ||
- mountPath: /usr/share/grafana/public/dashboards/home.json | ||
name: grafana-dashboard-cluster-explorer | ||
subPath: home.json | ||
- mountPath: /grafana-dashboard-definitions/1/grafana-dashboard-events | ||
name: grafana-dashboard-events | ||
- mountPath: /grafana-dashboard-definitions/2/grafana-dashboard-fs | ||
name: grafana-dashboard-fs | ||
- mountPath: /grafana-dashboard-definitions/3/grafana-dashboard-kubelet | ||
name: grafana-dashboard-kubelet | ||
- mountPath: /grafana-dashboard-definitions/4/grafana-dashboard-kubernetes | ||
name: grafana-dashboard-kubernetes | ||
- mountPath: /grafana-dashboard-definitions/5/grafana-dashboard-memusage | ||
name: grafana-dashboard-memusage | ||
- mountPath: /grafana-dashboard-definitions/6/grafana-dashboard-network | ||
name: grafana-dashboard-network | ||
- mountPath: /grafana-dashboard-definitions/7/grafana-dashboard-node-exporter | ||
name: grafana-dashboard-node-exporter | ||
- mountPath: /grafana-dashboard-definitions/8/grafana-dashboard-pvc | ||
name: grafana-dashboard-pvc | ||
volumes: | ||
- emptyDir: {} | ||
name: grafana-storage | ||
- emptyDir: {} | ||
name: log | ||
- name: grafana-datasources | ||
secret: | ||
defaultMode: 420 | ||
secretName: grafana-datasources | ||
- configMap: | ||
defaultMode: 420 | ||
items: | ||
- key: nginx.conf | ||
path: nginx.conf | ||
name: nginx-conf | ||
name: nginx-conf | ||
- configMap: | ||
defaultMode: 420 | ||
items: | ||
- key: grafana.ini | ||
path: grafana.ini | ||
name: grafana-conf | ||
name: grafana-conf | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboards | ||
name: grafana-dashboards | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-apiserver | ||
name: grafana-dashboard-apiserver | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-cluster-explorer | ||
name: grafana-dashboard-cluster-explorer | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-events | ||
name: grafana-dashboard-events | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-fs | ||
name: grafana-dashboard-fs | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-kubelet | ||
name: grafana-dashboard-kubelet | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-kubernetes | ||
name: grafana-dashboard-kubernetes | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-memusage | ||
name: grafana-dashboard-memusage | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-network | ||
name: grafana-dashboard-network | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-node-exporter | ||
name: grafana-dashboard-node-exporter | ||
- configMap: | ||
defaultMode: 420 | ||
name: grafana-dashboard-pvc | ||
name: grafana-dashboard-pvc | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grafana-ui | ||
namespace: pf9-monitoring | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
app: grafana |
213 changes: 213 additions & 0 deletions
213
addon_templates/monitoring/0.46.0/kube-state-metrics.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,213 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kube-state-metrics | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- configmaps | ||
- secrets | ||
- nodes | ||
- pods | ||
- services | ||
- resourcequotas | ||
- replicationcontrollers | ||
- limitranges | ||
- persistentvolumeclaims | ||
- persistentvolumes | ||
- namespaces | ||
- endpoints | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- daemonsets | ||
- deployments | ||
- replicasets | ||
- ingresses | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- statefulsets | ||
- daemonsets | ||
- deployments | ||
- replicasets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- cronjobs | ||
- jobs | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- autoscaling | ||
resources: | ||
- horizontalpodautoscalers | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- authentication.k8s.io | ||
resources: | ||
- tokenreviews | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- authorization.k8s.io | ||
resources: | ||
- subjectaccessreviews | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- policy | ||
resources: | ||
- poddisruptionbudgets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- certificates.k8s.io | ||
resources: | ||
- certificatesigningrequests | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- storage.k8s.io | ||
resources: | ||
- storageclasses | ||
verbs: | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kube-state-metrics | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kube-state-metrics | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kube-state-metrics | ||
namespace: pf9-monitoring | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: kube-state-metrics | ||
name: kube-state-metrics | ||
namespace: pf9-monitoring | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: kube-state-metrics | ||
template: | ||
metadata: | ||
labels: | ||
app: kube-state-metrics | ||
spec: | ||
containers: | ||
- args: | ||
- "--port=8081" | ||
- "--telemetry-port=8082" | ||
image: {{ .QuayRegistry }}/coreos/kube-state-metrics:v1.8.0 | ||
name: kube-state-metrics | ||
ports: | ||
- containerPort: 8081 | ||
name: web | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 150Mi | ||
requests: | ||
cpu: 100m | ||
memory: 150Mi | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 65534 | ||
serviceAccountName: kube-state-metrics | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: kube-state-metrics | ||
namespace: pf9-monitoring | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- extensions | ||
resourceNames: | ||
- kube-state-metrics | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- update | ||
- apiGroups: | ||
- apps | ||
resourceNames: | ||
- kube-state-metrics | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- update | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: kube-state-metrics | ||
namespace: pf9-monitoring | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: kube-state-metrics | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kube-state-metrics | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: kube-state-metrics | ||
name: kube-state-metrics | ||
namespace: pf9-monitoring | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: https-main | ||
port: 8443 | ||
targetPort: https-main | ||
- name: web | ||
port: 8081 | ||
targetPort: web | ||
selector: | ||
app: kube-state-metrics | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kube-state-metrics | ||
namespace: pf9-monitoring |
Oops, something went wrong.