Removing comments

This commit is contained in:
Nash Luffman 2020-08-15 23:47:13 -04:00
parent f7f93e63ea
commit 9b0050c17d
13 changed files with 1667 additions and 13 deletions

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,9 @@ spec:
- mountPath: /grafana-dashboard-definitions/0/namespace-by-workload - mountPath: /grafana-dashboard-definitions/0/namespace-by-workload
name: grafana-dashboard-namespace-by-workload name: grafana-dashboard-namespace-by-workload
readOnly: false readOnly: false
- mountPath: /grafana-dashboard-definitions/0/nginx-dashboard
name: grafana-dashboard-nginx-dashboard
readOnly: false
- mountPath: /grafana-dashboard-definitions/0/node-cluster-rsrc-use - mountPath: /grafana-dashboard-definitions/0/node-cluster-rsrc-use
name: grafana-dashboard-node-cluster-rsrc-use name: grafana-dashboard-node-cluster-rsrc-use
readOnly: false readOnly: false
@ -181,6 +184,9 @@ spec:
- configMap: - configMap:
name: grafana-dashboard-namespace-by-workload name: grafana-dashboard-namespace-by-workload
name: grafana-dashboard-namespace-by-workload name: grafana-dashboard-namespace-by-workload
- configMap:
name: grafana-dashboard-nginx-dashboard
name: grafana-dashboard-nginx-dashboard
- configMap: - configMap:
name: grafana-dashboard-node-cluster-rsrc-use name: grafana-dashboard-node-cluster-rsrc-use
name: grafana-dashboard-node-cluster-rsrc-use name: grafana-dashboard-node-cluster-rsrc-use

View File

@ -5,7 +5,7 @@ metadata:
namespace: monitoring namespace: monitoring
spec: spec:
rules: rules:
- host: alertmanager.192.168.1.15.nip.io - host: alertmanager.192.168.4.32.nip.io
http: http:
paths: paths:
- backend: - backend:
@ -14,4 +14,4 @@ spec:
path: / path: /
tls: tls:
- hosts: - hosts:
- alertmanager.192.168.1.15.nip.io - alertmanager.192.168.4.32.nip.io

View File

@ -5,7 +5,7 @@ metadata:
namespace: monitoring namespace: monitoring
spec: spec:
rules: rules:
- host: grafana.192.168.1.15.nip.io - host: grafana.192.168.4.32.nip.io
http: http:
paths: paths:
- backend: - backend:
@ -14,4 +14,4 @@ spec:
path: / path: /
tls: tls:
- hosts: - hosts:
- grafana.192.168.1.15.nip.io - grafana.192.168.4.32.nip.io

View File

@ -5,7 +5,7 @@ metadata:
namespace: monitoring namespace: monitoring
spec: spec:
rules: rules:
- host: prometheus.192.168.1.15.nip.io - host: prometheus.192.168.4.32.nip.io
http: http:
paths: paths:
- backend: - backend:
@ -14,4 +14,4 @@ spec:
path: / path: /
tls: tls:
- hosts: - hosts:
- prometheus.192.168.1.15.nip.io - prometheus.192.168.4.32.nip.io

View File

@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: nginx-exporter
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch

View File

@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nginx-exporter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: nginx-exporter
subjects:
- kind: ServiceAccount
name: nginx-exporter
namespace: monitoring

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: ingress-nginx
name: nginx-ingress-metrics
namespace: ingress-nginx
spec:
clusterIP: None
ports:
- name: prometheus
port: 10254
targetPort: 10254
selector:
app.kubernetes.io/name: ingress-nginx

View File

@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-exporter
namespace: monitoring

View File

@ -0,0 +1,26 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app: nginx
name: nginx
namespace: monitoring
spec:
endpoints:
- interval: 30s
port: prometheus
relabelings:
- action: replace
regex: (.*)
replacement: $1
sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: instance
scheme: http
jobLabel: nginx-exporter
namespaceSelector:
matchNames:
- ingress-nginx
selector:
matchLabels:
app.kubernetes.io/name: ingress-nginx

View File

@ -25,7 +25,7 @@ spec:
- name: alertmanager-main - name: alertmanager-main
namespace: monitoring namespace: monitoring
port: web port: web
externalUrl: http://prometheus.192.168.1.15.nip.io externalUrl: http://prometheus.192.168.4.32.nip.io
image: prom/prometheus:v2.19.1 image: prom/prometheus:v2.19.1
nodeSelector: nodeSelector:
kubernetes.io/os: linux kubernetes.io/os: linux

View File

@ -4,7 +4,6 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
{ {
_config+:: { _config+:: {
namespace: 'monitoring', namespace: 'monitoring',
// Add custom dashboards
grafanaDashboards+:: { grafanaDashboards+:: {
'nginx-dashboard.json': (import '../grafana-dashboards/nginx-dashboard.json'), 'nginx-dashboard.json': (import '../grafana-dashboards/nginx-dashboard.json'),
}, },
@ -20,7 +19,7 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local nginxPort = servicePort.newNamed('prometheus', 10254, 10254); local nginxPort = servicePort.newNamed('prometheus', 10254, 10254);
service.new('nginx-ingress-metrics', {'app.kubernetes.io/name': 'ingress-nginx'}, nginxPort) + service.new('nginx-ingress-metrics', {'app.kubernetes.io/name': 'ingress-nginx'}, nginxPort) +
service.mixin.metadata.withNamespace('nginx-ingress') + service.mixin.metadata.withNamespace('ingress-nginx') +
service.mixin.metadata.withLabels({'app.kubernetes.io/name': 'ingress-nginx'}) + service.mixin.metadata.withLabels({'app.kubernetes.io/name': 'ingress-nginx'}) +
service.mixin.spec.withClusterIp('None'), service.mixin.spec.withClusterIp('None'),
@ -37,8 +36,6 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
serviceAccount: serviceAccount:
utils.newServiceAccount('nginx-exporter', $._config.namespace, null), utils.newServiceAccount('nginx-exporter', $._config.namespace, null),
// Creates a ClusterRoleBinding between a `clusterRole` and a `serviceAccount` on `serviceAccountNamespace`
clusterRoleBinding: clusterRoleBinding:
utils.newClusterRoleBinding('nginx-exporter', 'nginx-exporter', $._config.namespace, 'nginx-exporter', null), utils.newClusterRoleBinding('nginx-exporter', 'nginx-exporter', $._config.namespace, 'nginx-exporter', null),

View File

@ -44,11 +44,11 @@
k3s: { k3s: {
enabled: false, enabled: false,
master_ip: ['192.168.1.15'], master_ip: ['192.168.4.32'],
}, },
// Domain suffix for the ingresses // Domain suffix for the ingresses
suffixDomain: '192.168.1.15.nip.io', suffixDomain: '192.168.4.32.nip.io',
// If TLSingress is true, a self-signed HTTPS ingress with redirect will be created // If TLSingress is true, a self-signed HTTPS ingress with redirect will be created
TLSingress: true, TLSingress: true,
// If UseProvidedCerts is true, provided files will be used on created HTTPS ingresses. // If UseProvidedCerts is true, provided files will be used on created HTTPS ingresses.