Rearrange deployment files into kustomizations
This commit is contained in:
parent
1bd3fd2429
commit
51ad0bc54b
56 changed files with 532 additions and 1094 deletions
28
deploy/prometheus/deployment.yaml
Normal file
28
deploy/prometheus/deployment.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: prometheus-server
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
spec:
|
||||
serviceAccountName: prometheus-server
|
||||
containers:
|
||||
- name: prometheus
|
||||
image: prom/prometheus
|
||||
args:
|
||||
- "--config.file=/etc/prometheus/prometheus.yaml"
|
||||
- "--storage.tsdb.path=/prometheus/"
|
||||
ports:
|
||||
- containerPort: 9090
|
||||
volumeMounts:
|
||||
- name: prometheus-config-volume
|
||||
mountPath: /etc/prometheus/
|
||||
- name: prometheus-storage-volume
|
||||
mountPath: /prometheus/
|
||||
volumes:
|
||||
- name: prometheus-config-volume
|
||||
configMap:
|
||||
name: prometheus-configuration
|
||||
- name: prometheus-storage-volume
|
||||
emptyDir: {}
|
||||
19
deploy/prometheus/kustomization.yaml
Normal file
19
deploy/prometheus/kustomization.yaml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: ingress-nginx
|
||||
commonLabels:
|
||||
app.kubernetes.io/name: prometheus
|
||||
app.kubernetes.io/part-of: ingress-nginx
|
||||
resources:
|
||||
- role.yaml
|
||||
- service-account.yaml
|
||||
- role-binding.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
images:
|
||||
- name: prom/prometheus
|
||||
newTag: v2.3.2
|
||||
configMapGenerator:
|
||||
- name: prometheus-configuration
|
||||
files:
|
||||
- prometheus.yaml
|
||||
29
deploy/prometheus/prometheus.yaml
Normal file
29
deploy/prometheus/prometheus.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
global:
|
||||
scrape_interval: 10s
|
||||
scrape_configs:
|
||||
- job_name: 'ingress-nginx-endpoints'
|
||||
kubernetes_sd_configs:
|
||||
- role: pod
|
||||
namespaces:
|
||||
names:
|
||||
- ingress-nginx
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
|
||||
action: keep
|
||||
regex: true
|
||||
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
|
||||
action: replace
|
||||
target_label: __scheme__
|
||||
regex: (https?)
|
||||
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
|
||||
action: replace
|
||||
target_label: __metrics_path__
|
||||
regex: (.+)
|
||||
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
|
||||
action: replace
|
||||
target_label: __address__
|
||||
regex: ([^:]+)(?::\d+)?;(\d+)
|
||||
replacement: $1:$2
|
||||
- source_labels: [__meta_kubernetes_service_name]
|
||||
regex: prometheus-server
|
||||
action: drop
|
||||
11
deploy/prometheus/role-binding.yaml
Normal file
11
deploy/prometheus/role-binding.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: prometheus-server
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: prometheus-server
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: prometheus-server
|
||||
11
deploy/prometheus/role.yaml
Normal file
11
deploy/prometheus/role.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: prometheus-server
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- services
|
||||
- endpoints
|
||||
- pods
|
||||
verbs: ["get", "list", "watch"]
|
||||
4
deploy/prometheus/service-account.yaml
Normal file
4
deploy/prometheus/service-account.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: prometheus-server
|
||||
9
deploy/prometheus/service.yaml
Normal file
9
deploy/prometheus/service.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: prometheus-server
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 9090
|
||||
targetPort: 9090
|
||||
Loading…
Add table
Add a link
Reference in a new issue