grafana / grafana-operator

An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
https://grafana.github.io/grafana-operator/
Apache License 2.0
863 stars 384 forks source link

How to enable Grafana HTTPS in V5 on Openshift. #1612

Closed bjwyun closed 1 month ago

bjwyun commented 1 month ago

Hi all, I'm trying to enable https grafana url in the openshift cluster. And I create a secret to save tls.key, tls.crt.


In

Grafana Operator
4.10.1 provided by Red Hat

I can create the Grafana CR as follows to enable Https:

apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
  creationTimestamp: '2024-07-16T09:28:24Z'
  generation: 2
  managedFields:
    - apiVersion: integreatly.org/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        'f:spec':
          .: {}
          'f:config':
            .: {}
            'f:server':
              .: {}
              'f:cert_file': {}
              'f:cert_key': {}
              'f:protocol': {}
          'f:secrets': {}
      manager: Mozilla
      operation: Update
      time: '2024-07-16T09:30:30Z'
    - apiVersion: integreatly.org/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        'f:status':
          .: {}
          'f:message': {}
          'f:phase': {}
          'f:previousServiceName': {}
      manager: manager
      operation: Update
      subresource: status
      time: '2024-07-16T09:30:47Z'
  name: example
  namespace: my-grafana
  resourceVersion: '20356640'
  uid: f7e0b464-3dcb-4edc-b78b-f65d0e057196
spec:
  config:
    server:
      cert_file: /etc/grafana-secrets/grafana-tls-secret/tls.crt
      cert_key: /etc/grafana-secrets/grafana-tls-secret/tls.key
      protocol: https
  secrets:
    - grafana-tls-secret
status:
  message: success
  phase: reconciling
  previousServiceName: grafana-service

but in V5 if I do the similar things, the grafana-tls-secret will not be mounted into container. Could you help to give an example about enabling https with V5 operator ? thanks.