Grafana正在生成具有基本URL的链接:http://localhost:3000 而不是使用我的url

Grafana正在生成具有基本URL的链接:http://localhost:3000 而不是使用我的url,grafana,Grafana,我用Kubernetes部署了grafana 7,以下是我的部署: apiVersion: apps/v1 kind: Deployment metadata: name: grafana-core namespace: monitoring labels: app: grafana component: core spec: selector: matchLabels: app: grafana replicas: 1 templa

我用Kubernetes部署了grafana 7,以下是我的部署:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana-core
  namespace: monitoring
  labels:
    app: grafana
    component: core
spec:
  selector:
    matchLabels:
      app: grafana

  replicas: 1
  template:
    metadata:
      labels:
        app: grafana
        component: core
    spec:
      initContainers:
      - name: init-chown-data
        image: grafana/grafana:7.0.3
        imagePullPolicy: IfNotPresent
        securityContext:
          runAsUser: 0
        command: ["chown", "-R", "472:472", "/var/lib/grafana"]
        volumeMounts:
        - name: grafana-persistent-storage
          mountPath: /var/lib/grafana
      containers:
      - image: grafana/grafana:7.0.3
        name: grafana-core
        imagePullPolicy: IfNotPresent
        securityContext:
          runAsUser: 472
        # env:
        envFrom:
          - secretRef:
              name: grafana-env
        env:
          # The following env variables set up basic auth twith the default admin user and admin password.
          - name: GF_INSTALL_PLUGINS
            value: grafana-clock-panel,grafana-simple-json-datasource,camptocamp-prometheus-alertmanager-datasource
          - name: GF_AUTH_BASIC_ENABLED
            value: "true"
          - name: GF_SECURITY_ADMIN_USER
            valueFrom:
              secretKeyRef:
                name: grafana
                key: admin-username
          - name: GF_SECURITY_ADMIN_PASSWORD
            valueFrom:
              secretKeyRef:
                name: grafana
                key: admin-password
          - name: GF_AUTH_ANONYMOUS_ENABLED
            value: "false"
        readinessProbe:
          httpGet:
            path: /login
            port: 3000
          initialDelaySeconds: 30
          timeoutSeconds: 1
        volumeMounts:
        - name: grafana-persistent-storage
          mountPath: /var/lib/grafana
        - name: grafana-datasources
          mountPath: /etc/grafana/provisioning/datasources
      volumes:
      - name: grafana-persistent-storage
        persistentVolumeClaim:
          claimName: grafana-storage
      - name: grafana-datasources
        configMap:
          name: grafana-datasources
      nodeSelector:
        kops.k8s.io/instancegroup: monitoring-nodes
它工作正常,但每次生成URL时,都会使用基本URL:http://localhost:3000 而不是使用
https://grafana.company.com


我在哪里可以配置它?我找不到处理它的环境变量。

在Grafana配置文件中配置
[server]
root\u url
选项,或将环境变量
GF\u server\u root\u url
配置为
https://grafana.company.com/

检查pod上的/etc/grafana/grafana.ini文件。这应该是保持这种形状。