删除无效文件
This commit is contained in:
parent
ed588061e2
commit
fb8ab3e727
|
|
@ -1,12 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: cadvisor
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: cadvisor
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: cadvisor
|
||||
namespace: monitoring
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: cadvisor
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: cadvisor
|
||||
spec:
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
hostNetwork: false
|
||||
containers:
|
||||
- name: cadvisor
|
||||
image: google/cadvisor:v0.31.0
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
- name: rootfs
|
||||
mountPath: /rootfs
|
||||
readOnly: true
|
||||
- name: var-run
|
||||
mountPath: /var/run
|
||||
readOnly: true
|
||||
- name: sys
|
||||
mountPath: /sys
|
||||
readOnly: true
|
||||
- name: docker
|
||||
mountPath: /var/lib/docker
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: rootfs
|
||||
hostPath:
|
||||
path: /
|
||||
- name: var-run
|
||||
hostPath:
|
||||
path: /var/run
|
||||
- name: sys
|
||||
hostPath:
|
||||
path: /sys
|
||||
- name: docker
|
||||
hostPath:
|
||||
path: /var/lib/docker
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: cadvisor
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: cadvisor
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: grafana-config
|
||||
namespace: monitoring
|
||||
data:
|
||||
grafana.ini: |
|
||||
[server]
|
||||
domain = grafana.example.com
|
||||
root_url = %(protocol)s://%(domain)s:%(http_port)s/
|
||||
[security]
|
||||
admin_user = admin
|
||||
admin_password = admin
|
||||
[database]
|
||||
type = sqlite3
|
||||
path = /var/lib/grafana/database.db
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: grafana
|
||||
namespace: monitoring # 如果使用默认命名空间,可以省略这一行
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: grafana
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: grafana
|
||||
spec:
|
||||
containers:
|
||||
- name: grafana
|
||||
image: grafana/grafana:9.4.0 # Grafana 镜像版本
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
volumeMounts:
|
||||
- name: grafana-config
|
||||
mountPath: /etc/grafana/grafana.ini
|
||||
subPath: grafana.ini
|
||||
env:
|
||||
- name: GF_SECURITY_ADMIN_USER
|
||||
value: "admin"
|
||||
- name: GF_SECURITY_ADMIN_PASSWORD
|
||||
value: "admin"
|
||||
volumes:
|
||||
- name: grafana-config
|
||||
configMap:
|
||||
name: grafana-config
|
||||
items:
|
||||
- key: grafana.ini
|
||||
path: grafana.ini
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: grafana-ingress
|
||||
namespace: monitoring # Grafana 所在命名空间
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
spec:
|
||||
rules:
|
||||
- host: # 替换为你的域名
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: grafana
|
||||
port:
|
||||
number: 3000
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: grafana
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP # LoadBalancer # 或者使用 NodePort
|
||||
selector:
|
||||
app: grafana
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
|
|
@ -1,216 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
app.kubernetes.io/version: 2.6.0
|
||||
name: kube-state-metrics
|
||||
namespace: monitoring
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
app.kubernetes.io/version: 2.6.0
|
||||
name: kube-state-metrics
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- secrets
|
||||
- nodes
|
||||
- pods
|
||||
- services
|
||||
- resourcequotas
|
||||
- replicationcontrollers
|
||||
- limitranges
|
||||
- persistentvolumeclaims
|
||||
- persistentvolumes
|
||||
- namespaces
|
||||
- endpoints
|
||||
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
|
||||
- volumeattachments
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- admissionregistration.k8s.io
|
||||
resources:
|
||||
- mutatingwebhookconfigurations
|
||||
- validatingwebhookconfigurations
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- networkpolicies
|
||||
- ingresses
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
app.kubernetes.io/version: 2.6.0
|
||||
name: kube-state-metrics
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: kube-state-metrics
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kube-state-metrics
|
||||
namespace: monitoring
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
app.kubernetes.io/version: 2.6.0
|
||||
name: kube-state-metrics
|
||||
namespace: monitoring
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
app.kubernetes.io/version: 2.6.0
|
||||
spec:
|
||||
containers:
|
||||
- image: bitnami/kube-state-metrics:2.6.0
|
||||
|
||||
# 容器资源限制
|
||||
resources:
|
||||
limits:
|
||||
memory: 300Mi
|
||||
cpu: 200m
|
||||
requests:
|
||||
memory: 150Mi
|
||||
cpu: 100m
|
||||
|
||||
# 健康检查
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8080
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 5
|
||||
name: kube-state-metrics
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http-metrics
|
||||
- containerPort: 8081
|
||||
name: telemetry
|
||||
|
||||
# 就绪检查
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8081
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
|
||||
# 容器安全上下文
|
||||
securityContext:
|
||||
runAsUser: 65534
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
serviceAccountName: kube-state-metrics
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
app.kubernetes.io/version: 2.6.0
|
||||
name: kube-state-metrics
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: 8080
|
||||
targetPort: http-metrics
|
||||
- name: telemetry
|
||||
port: 8081
|
||||
targetPort: telemetry
|
||||
selector:
|
||||
app.kubernetes.io/name: kube-state-metrics
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
# nacos-config.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nacos-config
|
||||
namespace: microservices
|
||||
data:
|
||||
MODE: "standalone"
|
||||
SPRING_DATASOURCE_PLATFORM: "mysql"
|
||||
MYSQL_SERVICE_HOST: "osredm-mysql"
|
||||
MYSQL_SERVICE_PORT: "3306"
|
||||
MYSQL_SERVICE_DB_NAME: "osredm-nacos-config"
|
||||
NACOS_AUTH_ENABLE: "true"
|
||||
NACOS_AUTH_IDENTITY_KEY: "osredm_key"
|
||||
NACOS_AUTH_IDENTITY_VALUE: "osredm_value"
|
||||
---
|
||||
# nacos-secret.yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: nacos-secret
|
||||
namespace: microservices
|
||||
type: Opaque
|
||||
data:
|
||||
MYSQL_SERVICE_USER: cm9vdA==
|
||||
MYSQL_SERVICE_PASSWORD: VHJ1c3RfIyUwMQ==
|
||||
NACOS_AUTH_TOKEN: UkhCeGFXNWtUbGxzUTFkSVVsSjZaWE0wYWpkelVtZ3hiWEpJTXpWYVpGRm1iWGxxTmt3NWMxZENObkJGZDA4MlYyMUVlRkJ0TUU1TmF6RllZblF3V1c0M2VrWlhRUT09
|
||||
nacos_username: bmFjb3M=
|
||||
nacos_password: bmFjb3M=
|
||||
---
|
||||
# nacos-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: gitlink-nacos
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nacos
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nacos
|
||||
spec:
|
||||
containers:
|
||||
- name: nacos
|
||||
image: 172.20.32.234:8888/base_images/nacos-server:v2.3.2
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: nacos-config
|
||||
- secretRef:
|
||||
name: nacos-secret
|
||||
ports:
|
||||
- containerPort: 8848
|
||||
resources:
|
||||
limits:
|
||||
memory: "1500Mi"
|
||||
volumeMounts:
|
||||
- name: shared-logs-volume
|
||||
mountPath: /home/nacos/logs
|
||||
subPath: nacos/logs
|
||||
volumes:
|
||||
- name: shared-logs-volume
|
||||
hostPath:
|
||||
path: /data/k8s-data/microservices/
|
||||
type: DirectoryOrCreate
|
||||
---
|
||||
# nacos-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: gitlink-nacos
|
||||
namespace: microservices
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: nacos
|
||||
ports:
|
||||
- port: 8848
|
||||
targetPort: 8848
|
||||
nodePort: 30002
|
||||
name: nacos-port
|
||||
- port: 9848
|
||||
targetPort: 9848
|
||||
nodePort: 31002
|
||||
name: nacos-podsa
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
# nexus-pvc.yaml
|
||||
#apiVersion: v1
|
||||
#kind: PersistentVolumeClaim
|
||||
#metadata:
|
||||
# name: nexus-pvc
|
||||
# namespace: microservices
|
||||
#spec:
|
||||
# accessModes:
|
||||
# - ReadWriteOnce
|
||||
# resources:
|
||||
# requests:
|
||||
# storage: 10Gi
|
||||
# storageClassName: standard
|
||||
---
|
||||
# nexus-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nexus
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nexus
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nexus
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: http_proxy
|
||||
value: http://172.20.32.253:3128
|
||||
- name: https_proxy
|
||||
value: http://172.20.32.253:3128
|
||||
name: nexus
|
||||
image: 172.20.32.234:8888/base_images/nexus3:3.29.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8081
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
requests:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- name: nexus-data
|
||||
mountPath: /nexus-data
|
||||
volumes:
|
||||
- name: nexus-data
|
||||
hostPath:
|
||||
path: /data/k8s-data/nexus-data/
|
||||
type: DirectoryOrCreate
|
||||
---
|
||||
# nexus-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nexus
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: nexus
|
||||
type: NodePort
|
||||
ports:
|
||||
- name: web
|
||||
protocol: TCP
|
||||
port: 8081
|
||||
targetPort: 8081
|
||||
nodePort: 30016
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: node-exporter
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 9100
|
||||
targetPort: 9100
|
||||
selector:
|
||||
app: node-exporter
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: node-exporter
|
||||
namespace: monitoring
|
||||
labels:
|
||||
app: node-exporter
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: node-exporter
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: node-exporter
|
||||
spec:
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- image: prom/node-exporter
|
||||
name: node-exporter
|
||||
ports:
|
||||
- name: scrape
|
||||
containerPort: 9100
|
||||
hostPort: 9100
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: prometheus-config
|
||||
namespace: monitoring
|
||||
data:
|
||||
prometheus.yml: |
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
scrape_configs:
|
||||
- job_name: 'nginx-ingress'
|
||||
static_configs:
|
||||
- targets: [ingress-nginx-controller.ingress-nginx.svc.cluster.local:10254]
|
||||
- job_name: 'nginx'
|
||||
static_configs:
|
||||
- targets: [172.20.32.201:4040]
|
||||
- job_name: 'kube-state-metrics'
|
||||
honor_timestamps: true
|
||||
static_configs:
|
||||
- targets: [kube-state-metrics.monitoring.svc.cluster.local:8080]
|
||||
metric_relabel_configs:
|
||||
- target_label: cluster
|
||||
replacement: "osredm-cluster"
|
||||
- job_name: 'node-exporter'
|
||||
static_configs:
|
||||
- targets: [node-exporter.monitoring.svc.cluster.local:9100]
|
||||
- job_name: 'cadvisor'
|
||||
scrape_interval: 50s
|
||||
scrape_timeout: 50s
|
||||
static_configs:
|
||||
- targets: [cadvisor.monitoring.svc.cluster.local:8080]
|
||||
- job_name: 'kubernetes-cadvisor'
|
||||
scheme: https
|
||||
kubernetes_sd_configs:
|
||||
- role: node
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_node_name]
|
||||
target_label: __metrics_path__
|
||||
replacement: /metrics/cadvisor
|
||||
- action: replace
|
||||
source_labels: [__address__]
|
||||
regex: (.*)
|
||||
target_label: __address__
|
||||
replacement: ${1}:10250
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_node_label_(.+)
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: prometheus
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: prometheus
|
||||
spec:
|
||||
containers:
|
||||
- name: prometheus
|
||||
image: prom/prometheus:latest
|
||||
ports:
|
||||
- containerPort: 9090
|
||||
volumeMounts:
|
||||
- name: prometheus-config-volume
|
||||
mountPath: /etc/prometheus
|
||||
volumes:
|
||||
- name: prometheus-config-volume
|
||||
configMap:
|
||||
name: prometheus-config
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: prometheus-ingress
|
||||
namespace: monitoring
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
spec:
|
||||
rules:
|
||||
- host: # 替换为你的域名
|
||||
http:
|
||||
paths:
|
||||
- path: /prometheus
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: prometheus
|
||||
port:
|
||||
number: 9090
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: prometheus
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- nodes/metrics
|
||||
- nodes/proxy
|
||||
verbs: ["get"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: prometheus
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: prometheus
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 9090
|
||||
targetPort: 9090
|
||||
selector:
|
||||
app: prometheus
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# sentinel-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: osredm-sentinel
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sentinel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: sentinel
|
||||
spec:
|
||||
containers:
|
||||
- name: sentinel
|
||||
image: 172.20.32.234:8888/base_images/sentinel-dashboard:1.8.7
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Shanghai
|
||||
ports:
|
||||
- containerPort: 8858
|
||||
resources:
|
||||
limits:
|
||||
memory: "1500Mi"
|
||||
---
|
||||
# sentinel-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: osredm-sentinel
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: sentinel
|
||||
ports:
|
||||
- port: 8858
|
||||
targetPort: 8858
|
||||
nodePort: 30014
|
||||
name: sentinel-port
|
||||
type: NodePort
|
||||
|
|
@ -1,213 +0,0 @@
|
|||
# 定义 es configmap
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: elasticsearch-config
|
||||
namespace: microservices # 根据实际情况修改命名空间
|
||||
data:
|
||||
elasticsearch.yml: |
|
||||
cluster.name: my-elasticsearch-cluster
|
||||
node.name: node-1
|
||||
network.host: 0.0.0.0
|
||||
http.port: 9200
|
||||
discovery.type: single-node
|
||||
---
|
||||
# 定义 Elasticsearch 的 StatefulSet
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: elasticsearch
|
||||
namespace: microservices
|
||||
spec:
|
||||
serviceName: elasticsearch
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: elasticsearch
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: elasticsearch
|
||||
spec:
|
||||
containers:
|
||||
- name: elasticsearch
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 9200
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /_cluster/health
|
||||
port: 9200
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 30
|
||||
timeoutSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
env:
|
||||
- name: discovery.type
|
||||
value: single-node
|
||||
- name: bootstrap.memory_lock
|
||||
value: "true"
|
||||
- name: ES_JAVA_OPTS
|
||||
value: "-Xms1g -Xmx1g"
|
||||
volumeMounts:
|
||||
- name: elasticsearch-config
|
||||
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
|
||||
subPath: elasticsearch.yml
|
||||
- name: elasticsearch-data
|
||||
mountPath: /usr/share/elasticsearch/data
|
||||
- name: elasticsearch-plugins
|
||||
mountPath: /usr/share/elasticsearch/plugins
|
||||
volumes:
|
||||
- name: elasticsearch-config
|
||||
configMap:
|
||||
name: elasticsearch-config
|
||||
- name: elasticsearch-data
|
||||
hostPath:
|
||||
path: /data/docker-data/skywalking/elasticsearch/data
|
||||
- name: elasticsearch-plugins
|
||||
hostPath:
|
||||
path: /data/docker-data/skywalking/elasticsearch/plugins
|
||||
restartPolicy: Always
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
initContainers:
|
||||
- name: fix-permissions
|
||||
image: busybox:1.35
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["sh", "-c", "chown -R 1000:1000 /usr/share/elasticsearch/data"]
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: elasticsearch-data
|
||||
mountPath: /usr/share/elasticsearch/data
|
||||
---
|
||||
# SkyWalking OAP 的 Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: skywalking-oap
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: skywalking-oap
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: skywalking-oap
|
||||
spec:
|
||||
containers:
|
||||
- name: oap
|
||||
image: apache/skywalking-oap-server:9.4.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 11800
|
||||
- containerPort: 12800
|
||||
env:
|
||||
- name: SW_STORAGE
|
||||
value: elasticsearch
|
||||
- name: SW_STORAGE_ES_CLUSTER_NODES
|
||||
value: elasticsearch:9200
|
||||
- name: SW_HEALTH_CHECKER
|
||||
value: default
|
||||
- name: SW_TELEMETRY
|
||||
value: prometheus
|
||||
- name: SW_ENABLE_UPDATE_UI_TEMPLATE
|
||||
value: "true"
|
||||
- name: JAVA_OPTS
|
||||
value: "-Xms2048m -Xmx2048m"
|
||||
resources:
|
||||
requests:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
restartPolicy: Always
|
||||
---
|
||||
# SkyWalking UI 的 Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: skywalking-ui
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: skywalking-ui
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: skywalking-ui
|
||||
spec:
|
||||
containers:
|
||||
- name: ui
|
||||
image: apache/skywalking-ui:9.4.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Shanghai
|
||||
- name: SW_OAP_ADDRESS
|
||||
value: http://skywalking-oap:12800
|
||||
- name: SW_ZIPKIN_ADDRESS
|
||||
value: http://skywalking-oap:9412
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: Always
|
||||
---
|
||||
# Elasticsearch 的 Service
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: elasticsearch
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: elasticsearch
|
||||
ports:
|
||||
- port: 9200
|
||||
targetPort: 9200
|
||||
type: ClusterIP
|
||||
---
|
||||
# SkyWalking OAP 的 Service
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: skywalking-oap
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: skywalking-oap
|
||||
ports:
|
||||
- port: 11800
|
||||
targetPort: 11800
|
||||
name: port-11800
|
||||
- port: 12800
|
||||
targetPort: 12800
|
||||
name: port-12800
|
||||
---
|
||||
# SkyWalking UI 的 Service
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: skywalking-ui
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: skywalking-ui
|
||||
ports:
|
||||
- port: 8080
|
||||
nodePort: 30013
|
||||
name: skywalking-ui
|
||||
type: NodePort
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
# skywalking-oap.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: skywalking-oap
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: skywalking-oap
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: skywalking-oap
|
||||
spec:
|
||||
containers:
|
||||
- name: oap
|
||||
image: apache/skywalking-oap-server:9.4.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 11800
|
||||
- containerPort: 12800
|
||||
---
|
||||
# skywalking-ui.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: skywalking-ui
|
||||
namespace: microservices
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: skywalking-ui
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: skywalking-ui
|
||||
spec:
|
||||
containers:
|
||||
- name: ui
|
||||
image: apache/skywalking-ui:9.4.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Shanghai
|
||||
- name: SW_OAP_ADDRESS
|
||||
value: http://skywalking-oap:12800
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
---
|
||||
# skywalking-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: skywalking-oap
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: skywalking-oap
|
||||
ports:
|
||||
- port: 11800
|
||||
targetPort: 11800
|
||||
name: port-11800
|
||||
- port: 12800
|
||||
targetPort: 12800
|
||||
name: port-12800
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: skywalking-ui
|
||||
namespace: microservices
|
||||
spec:
|
||||
selector:
|
||||
app: skywalking-ui
|
||||
ports:
|
||||
- port: 8080
|
||||
nodePort: 30013
|
||||
name: skywalking-ui
|
||||
type: NodePort
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: monitoring-grafana
|
||||
namespace: monitoring
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
task: monitoring
|
||||
k8s-app: grafana
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
task: monitoring
|
||||
k8s-app: grafana
|
||||
spec:
|
||||
containers:
|
||||
- name: grafana
|
||||
image: hujinzhong/heapster-grafana-amd64:v5.0.4
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: /etc/ssl/certs
|
||||
name: ca-certificates
|
||||
readOnly: true
|
||||
- mountPath: /var
|
||||
name: grafana-storage
|
||||
env:
|
||||
- name: INFLUXDB_HOST
|
||||
value: monitoring-influxdb
|
||||
- name: GF_SERVER_HTTP_PORT
|
||||
value: "3000"
|
||||
# The following env variables are required to make Grafana accessible via
|
||||
# the kubernetes api-server proxy. On production clusters, we recommend
|
||||
# removing these env variables, setup auth for grafana, and expose the grafana
|
||||
# service using a LoadBalancer or a public IP.
|
||||
- name: GF_AUTH_BASIC_ENABLED
|
||||
value: "false"
|
||||
- name: GF_AUTH_ANONYMOUS_ENABLED
|
||||
value: "true"
|
||||
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
|
||||
value: Admin
|
||||
- name: GF_SERVER_ROOT_URL
|
||||
# If you're only using the API Server proxy, set this value instead:
|
||||
# value: /api/v1/namespaces/monitoring/services/monitoring-grafana/proxy
|
||||
value: /
|
||||
volumes:
|
||||
- name: ca-certificates
|
||||
hostPath:
|
||||
path: /etc/ssl/certs
|
||||
- name: grafana-storage
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
# For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
|
||||
# If you are NOT using this as an addon, you should comment out this line.
|
||||
kubernetes.io/cluster-service: 'true'
|
||||
kubernetes.io/name: monitoring-grafana
|
||||
name: monitoring-grafana
|
||||
namespace: monitoring
|
||||
spec:
|
||||
# In a production setup, we recommend accessing Grafana through an external Loadbalancer
|
||||
# or through a public IP.
|
||||
# type: LoadBalancer
|
||||
# You could also use NodePort to expose the service at a randomly-generated port
|
||||
# type: NodePort
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 3000
|
||||
selector:
|
||||
k8s-app: grafana
|
||||
type: NodePort
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: prometheus
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/metrics"
|
||||
verbs:
|
||||
- get
|
||||
Loading…
Reference in New Issue