You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/06 08:44:40 UTC
[GitHub] [apisix-dashboard] wjmmjr edited a comment on issue #2122: Request help: could not login grafana
wjmmjr edited a comment on issue #2122:
URL: https://github.com/apache/apisix-dashboard/issues/2122#issuecomment-913308605
问题描述:grafana单独登录正常,作了页面嵌入,可以在apisix显示,但是登录成功后又会跳转登陆界面
环境:k8s
版本:apisix-dashboard-2.7、grafana8.1.2
**生产环境集成grafana有问题**
grafana配置:
`
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: grafana
labels:
app: grafana
spec:
serviceName: grafana
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
containers:
- env:
#允许页面嵌套,可实现在apisix-dashboard中嵌套grafana
- name: GF_SECURITY_ALLOW_EMBEDDING
value: "true"
name: grafana
image: 镜像地址/grafana:8.1.2
imagePullPolicy: Always
livenessProbe:
failureThreshold: 10
httpGet:
path: /api/health
port: 3000
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 30
ports:
- containerPort: 80
name: service
protocol: TCP
- containerPort: 3000
name: grafana
protocol: TCP
volumeMounts:
- mountPath: /etc/grafana/grafana.ini
name: config-volume
subPath: grafana.ini
- mountPath: /var/lib/grafana/data
name: grafana-storage
dnsPolicy: ClusterFirst
volumes:
- name: config-volume
configMap:
name: grafana
items:
- key: grafana.ini
path: grafana.ini
volumeClaimTemplates:
- metadata:
name: grafana-storage
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "gp3"
resources:
requests:
storage: 10Gi
---
kind: Service
apiVersion: v1
metadata:
name: grafana
spec:
selector:
app: grafana
ports:
- name: service
nodePort: 32765
port: 80
protocol: TCP
targetPort: 3000
type: NodePort
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana
namespace: datacenter
data:
grafana.ini: |
[analytics]
check_for_updates = true
[grafana_net]
url = https://grafana.net
[log]
mode = console
[paths]
data = /var/lib/grafana/data
logs = /var/log/grafana
plugins = /var/lib/grafana/plugins
provisioning = /etc/grafana/provisioning
`
登录界面
![eda045aa781e2ce724b56192f94a850](https://user-images.githubusercontent.com/18857921/132156000-6130a18c-04d1-4bb1-a5d5-942ccf99d9a6.png)
请求如下:
![fe51f0e706be2cd31bcbbfdfc2f18e2](https://user-images.githubusercontent.com/18857921/132187457-aa83cf2a-0761-4591-8fc7-3728fda0e309.png)
日志如下:
![3b6cf7eed151a7b21723ea0227f4712](https://user-images.githubusercontent.com/18857921/132156016-b749dcb8-4daf-4a6f-95ed-ca4472ce9889.png)
**测试环境集成grafana没问题**
正常登录请求如下:
![215209ced998e38665021aba4d00d87](https://user-images.githubusercontent.com/18857921/132187594-90474701-a7a0-4b48-b923-d57c730e99fb.png)
正常登录日志如下:
![fced2e0e9764bb8543180e35d94ba14](https://user-images.githubusercontent.com/18857921/132187688-071f84bd-1838-458f-a1d1-1850149d0692.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org