instruction: Create automated Grafana dashboards for Deploy Grafana on Kubernetes | Grafana documentation Path:
output: Deploy Grafana on Kubernetes | Grafana documentation Path: Copied! Products Open Source Solutions Learn Docs Pricing Downloads Contact us Sign in Create free account Contact us Products All Products LGTM+ Stack Logs powered by Grafana Loki Grafana for visualization Traces powered by Grafana Tempo Metrics powered by Grafana Mimir and Prometheus Profiles powered by Grafana Pyroscope Key Capabilities AI/ML insights Identify anomalies and reduce toil Contextual root cause analysis Automated anomaly correlation SLO management Create SLOs and error budget alerts Alerting Trigger alerts from any data source Plugins Connect Grafana to data sources, apps, and more Observability Solutions Frontend Observability Gain real user monitoring insights Application Observability Monitor application performance Infrastructure observability Ensure infrastructure health and performance Testing Performance & load testing powered by Grafana k6 Synthetic Monitoring powered by Grafana k6 IRM Grafana IRM Observability native incident response Incident Routine task automation for incidents OnCall Flexible on-call management Deploy The Stack Grafana Cloud Fully managed Grafana Enterprise Self-managed Open Source All Open Source Grafana Loki Multi-tenant log aggregation system Grafana Query, visualize, and alert on data Grafana Tempo High-scale distributed tracing backend Grafana Mimir Scalable and performant metrics backend Grafana Pyroscope Scalable continuous profiling backend Grafana Beyla eBPF auto-instrumentation Grafana Faro Frontend application observability web SDK Grafana Alloy OpenTelemetry Collector distribution with Prometheus pipelines Grafana k6 Load testing for engineering teams Prometheus Monitor Kubernetes and cloud native OpenTelemetry Instrument and collect telemetry data Graphite Scalable monitoring for time series data All Community resources Dashboard templates Try out and share prebuilt visualizations Prometheus exporters Get your metrics into Prometheus quickly Solutions All end-to-end solutions Opinionated solutions that help you get there easier and faster Kubernetes Monitoring Get K8s health, performance, and cost monitoring from cluster to container Application Observability Monitor application performance Frontend Observability Gain real user monitoring insights Incident Response & Management Detect and respond to incidents with a simplified workflow All monitoring and visualization solutions monitor infrastructure Out-of-the-box KPIs, dashboards, and alerts for observability Linux Windows Docker Postgres MySQL AWS Kafka Jenkins RabbitMQ MongoDB Microsoft Azure Google Cloud All monitoring solutions visualize any data Instantly connect all your data sources to Grafana MongoDB AppDynamics Oracle GitLab Jira Salesforce Splunk Datadog New Relic Snowflake All visualization solutions Learn All Learn Stay up to date ObservabilityCON 2025 (7-9 Oct) Our flagship observability event New GrafanaCON 2025 Our annual OSS community conference Blog News, releases, cool stories, and more Observability survey report 2025 Industry insights on the state of observability New Benefits of Observability New research, reports, and insights New Story of Grafana 10 years of Grafana Events Upcoming in-person and virtual events Success stories By use case, product, and industry Technical learning Documentation All the docs Webinars and videos Demos, webinars, and feature tours Tutorials Step-by-step guides Workshops Free, in-person or online Learning Journeys Expert guidance for mastering our platform Writers' Toolkit Contribute to technical documentation provided by Grafana Labs Plugin development Visit the Grafana developer portal for tools and resources for extending Grafana with plugins. new Professional Services Expert guidance and training Join the community Community Join the Grafana community new Community forums Ask the community for help Community Slack Real-time engagement Grafana Champions Contribute to the community new Community organizers Host local meetups new Docs Pricing Help build the future of open source observability software Open positions Check out the open source projects we support Downloads Sign in LGTM+ Stack Logs powered by Grafana Loki Grafana for visualization Traces powered by Grafana Tempo Metrics powered by Grafana Mimir and Prometheus Profiles powered by Grafana Pyroscope Key Capabilities AI/ML insights Identify anomalies and reduce toil Contextual root cause analysis Automated anomaly correlation SLO management Create SLOs and error budget alerts Alerting Trigger alerts from any data source Plugins Connect Grafana to data sources, apps, and more Observability Solutions Frontend Observability Gain real user monitoring insights Application Observability Monitor application performance Infrastructure observability Ensure infrastructure health and performance Testing Performance & load testing powered by Grafana k6 Synthetic Monitoring powered by Grafana k6 IRM Grafana IRM Observability native incident response Incident Routine task automation for incidents OnCall Flexible on-call management Deploy The Stack Grafana Cloud Fully managed Grafana Enterprise Self-managed The actually useful free plan Grafana, of course 14 day retention 10k series Prometheus metrics 500 VUh k6 testing 50 GB logs, traces, and profiles 50k frontend sessions 2,232 app o11y host hours 2,232 k8s monitoring host hours 37,944 k8s monitoring container hours and more cool stuff Create free account No credit card needed, ever. Grafana Loki Multi-tenant log aggregation system Grafana Query, visualize, and alert on data Grafana Tempo High-scale distributed tracing backend Grafana Mimir Scalable and performant metrics backend Grafana Pyroscope Scalable continuous profiling backend Grafana Beyla eBPF auto-instrumentation Grafana Faro Frontend application observability web SDK Grafana Alloy OpenTelemetry Collector distribution with Prometheus pipelines Grafana k6 Load testing for engineering teams Prometheus Monitor Kubernetes and cloud native OpenTelemetry Instrument and collect telemetry data Graphite Scalable monitoring for time series data All Community resources Dashboard templates Try out and share prebuilt visualizations Prometheus exporters Get your metrics into Prometheus quickly end-to-end solutions Opinionated solutions that help you get there easier and faster Kubernetes Monitoring Get K8s health, performance, and cost monitoring from cluster to container Application Observability Monitor application performance Frontend Observability Gain real user monitoring insights Incident Response & Management Detect and respond to incidents with a simplified workflow monitor infrastructure Out-of-the-box KPIs, dashboards, and alerts for observability Linux Windows Docker Postgres MySQL AWS Kafka Jenkins RabbitMQ MongoDB Microsoft Azure Google Cloud visualize any data Instantly connect all your data sources to Grafana MongoDB AppDynamics Oracle GitLab Jira Salesforce Splunk Datadog New Relic Snowflake All monitoring and visualization solutions Stay up to date ObservabilityCON 2025 (7-9 Oct) Our flagship observability event New GrafanaCON 2025 Our annual OSS community conference Blog News, releases, cool stories, and more Observability survey report 2025 Industry insights on the state of observability New Benefits of Observability New research, reports, and insights New Story of Grafana 10 years of Grafana Events Upcoming in-person and virtual events Success stories By use case, product, and industry Technical learning Documentation All the docs Webinars and videos Demos, webinars, and feature tours Tutorials Step-by-step guides Workshops Free, in-person or online Learning Journeys Expert guidance for mastering our platform Writers' Toolkit Contribute to technical documentation provided by Grafana Labs Plugin development Visit the Grafana developer portal for tools and resources for extending Grafana with plugins. new Professional Services Expert guidance and training Join the community Community Join the Grafana community new Community forums Ask the community for help Community Slack Real-time engagement Grafana Champions Contribute to the community new Community organizers Host local meetups new Featured Getting started with managing your metrics, logs, and traces using Grafana Learn how to unify, correlate, and visualize data with dashboards using Grafana. Learn more → Site search Ask Grot AI init()"> Menu Technical documentation Plugin catalog Choose a product Cloud Alerting Application Observability Asserts Cloud Provider Observability Drilldown apps Fleet Management Frontend Observability IRM k6 Performance Testing Kubernetes Monitoring Logs AI and Machine Learning Metrics Profiles SLO Synthetic Monitoring Traces Grafana Enterprise Alerting Drilldown apps Helm Charts Logs Metrics Traces Alerting Alloy Beyla Drilldown apps Faro Grafana Helm Charts k6 k6 Studio Loki Mimir OnCall OpenTelemetry Pyroscope Tempo Viewing: v12.1 (latest) Find another version Grafana documentation What's new What's new in Grafana v12.1 What's new in Grafana v12.0 What's new in Grafana v11.6 What's new in Grafana v11.5 What's new in Grafana v11.4 What's new in Grafana v11.3 What's new in Grafana v11.2 What's new in Grafana v11.1 What's new in Grafana v11.0 What's new in Grafana v10.4 What's new in Grafana v10.3 What's new in Grafana v10.2 What's new in Grafana v10.1 What's new in Grafana v10.0 What's new in Grafana v9.5 What's new in Grafana v9.4 What's new in Grafana v9.3 What's new in Grafana v9.2 Breaking changes Breaking changes in Grafana v11.0 Breaking changes in Grafana v10.3 Breaking changes in Grafana v10.0 Upgrade Grafana Upgrade strategies Upgrade to v12.1 Upgrade to v12.0 Upgrade to v11.6 Upgrade to v11.5 Upgrade to v11.4 Upgrade to v11.3 Upgrade to v11.2 Upgrade to v11.1 Upgrade to v11.0 Upgrade to v10.4 Upgrade to v10.3 Upgrade to v10.2 Upgrade to v10.1 Upgrade to v10.0 Upgrade to v9.5 Upgrade to v9.4 Upgrade to v9.3 Upgrade to v9.2 Upgrade to v9.1 Upgrade to v9.0 Upgrade to v8.5 Upgrade to v8.4 Upgrade to v8.3 Upgrade to v8.2 Upgrade to v8.1 Upgrade to v8.0 About Grafana Grafana Enterprise Grafana Cloud Introduction What is Prometheus? Dashboard overview Introduction to time series Time series dimensions Histograms and heatmaps Exemplars Glossary Get started with Grafana Open Source Build your first dashboard Get started with Grafana and Prometheus Get started with Grafana and InfluxDB Get started with Grafana and MS SQL Server Set up Install Grafana Debian or Ubuntu RHEL or Fedora SUSE or openSUSE Grafana Docker image Grafana on Kubernetes Grafana on Helm Charts macOS Windows Configure Grafana Configure Grafana Enterprise Configure feature toggles Configure profiling and tracing Configure custom branding Settings updates at runtime Configure data source proxy Start Grafana Sign in to Grafana Configure security Plan your IAM integration strategy Configure authentication Basic auth Passwordless Anonymous access LDAP LDAP user interface Enhanced LDAP SAML SAML user interface SAML configuration options Configure SAML signing and encryption Configure Role and Team sync for SAML Configure Organisation mapping for SAML Configure SAML single logout Configure SAML with Entra ID Configure SAML with Okta Troubleshooting Generic OAuth Azure AD/Entra ID OAuth GitHub OAuth GitLab OAuth Google OAuth Grafana Cloud OAuth2 Keycloak OAuth2 Multiple providers with Keycloak Okta OIDC Auth proxy JWT Configure SCIM provisioning Manage users and teams with SCIM Configure SCIM with Azure AD Configure SCIM with Okta Configure database encryption Encrypt database secrets using Google Cloud KMS Encrypt database secrets using Hashicorp Vault Encrypt database secrets using AWS KMS Encrypt database secrets using Azure Key Vault Integrate Grafana with Hashicorp Vault Audit a Grafana instance Export logs of usage insights Configure secret scanning Configure Team Sync Configure request security Configure security hardening Set up Grafana monitoring Set up HA Set up HTTPS Set up image rendering Monitor the image renderer Troubleshooting Set up Grafana Live Configure a Docker image Administration Back up Grafana Data source management Label Based Access Control (LBAC) for data sources Configure LBAC for data sources for Loki Configure LBAC for data sources for Prometheus Create LBAC for data sources rules for a supported data source Grafana Teams Configure Grafana Teams Administer Grafana Teams Manage organizations User management Server user management Assign or remove Grafana server administrator privileges Add or remove a user in an organization Change a user's organization permissions Manage user preferences Manage users in an organization Manage dashboard permissions Grafana Advisor Recorded queries Roles and permissions Role-based access control (RBAC) Plan your RBAC rollout strategy Configure RBAC Assign RBAC roles Manage RBAC roles Provisioning RBAC with Grafana Provisioning RBAC with Terraform RBAC role definitions RBAC permissions, actions, and scopes RBAC for app plugins Troubleshooting RBAC View server statistics and license Grafana Enterprise license Activate a Grafana Enterprise license purchased through AWS Marketplace Activate a Grafana Enterprise license from AWS Marketplace on EKS Activate a Grafana Enterprise license from AWS Marketplace on ECS Activate a Grafana Enterprise license from AWS on an instance deployed outside of AWS Manage your Grafana Enterprise license in AWS Marketplace Transfer your AWS Marketplace Grafana Enterprise license Organization preferences Plugin management Customize navigation placement of plugin pages Provision Grafana Service accounts Migrate API keys Correlations Correlation Permissions Add permissions Create a new correlation Use variables and transformations in a correlation Use correlations in visualizations Announcement banner Migrate from Grafana OSS/Enterprise to Grafana Cloud Manually migrate to Grafana Cloud Migrate to Grafana Cloud using the Grafana Cloud Migration Assistant Data sources Alertmanager Amazon CloudWatch AWS authentication Query editor Template variables Azure Monitor Query editor Template variables Elasticsearch Configure Elasticsearch Query editor Template variables Google Cloud Monitoring Authentication Query editor Template variables Graphite Configure Query editor Template variables InfluxDB Configure the InfluxDB data source Query editor Template variables Loki Configure Loki Query editor Template variables Jaeger Microsoft SQL Server Configure Query editor Template variables MySQL Configure the MySQL data source MySQL query editor OpenTSDB Parca PostgreSQL Configure Query editor Prometheus Configure the Prometheus data source Prometheus query editor Prometheus template variables Pyroscope Configure Pyroscope How profiling and tracing work together Configure traces to profiles Query profile data Tempo Configure Tempo Best practices Use traces in Grafana Link to a trace ID Upload JSON trace file Trace correlations Query tracing data TraceQL query structure Search traces Write TraceQL queries Service Graph and Service Graph view Span filters TestData Zipkin Dashboards Use dashboards Build dashboards Create a dashboard Import dashboards Modify dashboard settings Manage dashboard links Dashboard URL variables Manage library panels Manage version history Annotate visualizations JSON model Best practices Manage dashboards Search dashboards Manage playlists Reporting Settings Sharing Shared dashboards Variables Add variables Inspect variables Variable syntax Assess dashboard usage Troubleshoot dashboards Panels and visualizations Visualizations Time series Alert list Annotations list Bar chart Bar gauge Candlestick Canvas Dashboard list Datagrid Flame graph Gauge Geomap Heatmap Histogram Logs News Node graph Pie chart Stat State timeline Status history Table Text Traces Trend XY chart Panel overview Panel editor The panel inspect view Query and transform data Write expression queries SQL expressions Share query results Transform data Troubleshoot queries Calculation types Configure panel options Configure standard options Configure a legend Configure tooltips Configure data links and actions Configure value mappings Configure thresholds Configure field overrides Search Explore Get started with Explore Query management in Explore Query inspector in Explore Correlations Editor in Explore Logs in Explore Traces in Explore Simplified exploration Logs Drilldown Access or Install Get started Labels and Fields Log patterns Viewing JSON logs Sorting and ordering Troubleshooting Profiles Drilldown Access or install Profile settings Concepts What is profiling? Continuous profiling Understand profiling types Flame graphs Get started Determine your use case Choose a view Investigate trends and spikes Use Flame graph AI Traces Drilldown Access or install Concepts Traces and telemetry Trace structure Visualize data Glossary Get started Investigate trends and spikes Choose span data Choose a RED metric Analyze tracing data Add filters View exemplars UI reference Metrics Drilldown Metrics and telemetry Get started Drill down your metrics Investigations app Investigations Start investigations Compare time ranges Observability as Code Get started with Observability as Code Grafana CLI Install Grafana CLI Set up Grafana CLI Manage resources with Grafana CLI JSON schema v2 annotations schema PanelKind schema LibraryPanelKind schema layout schema links schema timesettings schema variables schema Foundation SDK Automate dashboard provisioning with CI/CD Provision resources and sync dashboards Git Sync Set up Git Sync Set up file provisioning Work with provisioned dashboards Manage repositories Alerting Introduction Alert rules Queries and conditions Labels and annotations Alert rule evaluation No Data and Error states Stale alert instances Alert rule state and health Evaluation within a group Notifications Contact points Notification policies Grouping Templates Configure alert rules Configure Grafana-managed alert rules Create and link alert rules to panels Import to Grafana-managed rules Configure data source-managed alert rules Create recording rules Create Grafana-managed recording rules Create data source-managed recording rules Migrate recorded queries Template annotations and labels Template reference Examples Template language Configure notifications Configure contact points Alertmanager Amazon SNS Discord Email Google Chat Grafana IRM Jira Microsoft Teams MQTT Opsgenie PagerDuty Slack Telegram Webhook Configure notification policies Configure mute timings Configure silences Template notifications Manage templates Template reference Examples Template language Use images Monitor alerts View alert rules View alert state View alert state history View active notifications Declare incidents from firing alerts Additional configuration Configure roles and permissions Configure RBAC Manage access using roles Manage access using folders or data sources Configure Alertmanagers Configure alert state history Provision Alerting resources Use configuration files to provision Use Terraform to provision Export alerting resources Use the HTTP API to manage alerting resources Configure high availability Meta monitoring Performance considerations and limitations Best Practices Handle connectivity errors Handle missing data Examples of multi-dimensional alerts Examples of table data Examples of dynamic thresholds Examples of dynamic labels Tutorials Troubleshooting Send panel to support Send a support bundle to support Generate a HAR capture Developers HTTP API Authentication Examples API Tutorial: Create Service Account tokens and dashboards for an organization cURL examples Admin HTTP API Alerting Provisioning HTTP API Annotations HTTP API Correlations HTTP API Dashboard HTTP API Dashboard Permissions HTTP API Dashboard Versions HTTP API Data source HTTP API Datasource LBAC rules HTTP API Datasource Permissions HTTP API Folder HTTP API Folder Permissions HTTP API Folder/Dashboard Search HTTP API Library Element HTTP API Licensing HTTP API New API Structure Organization HTTP API Other HTTP API Playlist HTTP API Preferences API Query and Resource Caching HTTP API Query History HTTP API RBAC HTTP API Reporting API Service account HTTP API Shared Dashboards HTTP API Short URL HTTP API Snapshot API SSO Settings API Team HTTP API Team Sync HTTP API User HTTP API Contribute to Grafana Contributor License Agreement (CLA) Angular support deprecation Plugins using AngularJS Grafana server CLI Release notes Copyright notice Scroll for more Documentation Grafana documentation Set up Install Grafana Grafana on Kubernetes Enterprise Open source Deploy Grafana on Kubernetes You can use Grafana Cloud to avoid installing, maintaining, and scaling your own instance of Grafana. Create a free account to get started, which includes free forever access to 10k metrics, 50GB logs, 50GB traces, 500VUh k6 testing & more. On this page, you will find instructions for installing and running Grafana on Kubernetes using Kubernetes manifests for the setup. If Helm is your preferred option, refer to Grafana Helm community charts . Watch this video to learn more about installing Grafana on Kubernetes: Before you begin To follow this guide: You need the latest version of Kubernetes running either locally or remotely on a public or private cloud. If you plan to use it in a local environment, you can use various Kubernetes options such as minikube , kind , Docker Desktop , and others. If you plan to use Kubernetes in a production setting, it&rsquo;s recommended to utilize managed cloud services like Google Kubernetes Engine (GKE) , Amazon Elastic Kubernetes Service (EKS) , or Azure Kubernetes Service (AKS) . System requirements This section provides minimum hardware and software requirements. Minimum Hardware Requirements Disk space: 1 GB Memory: 750 MiB (approx 750 MB) CPU: 250m (approx 0.25 cores) Supported databases For a list of supported databases, refer to supported databases . Supported web browsers For a list of support web browsers, refer to supported web browsers . Note Enable port 3000 in your network environment, as this is the Grafana default port. Deploy Grafana OSS on Kubernetes This section explains how to install Grafana OSS using Kubernetes. Note If you want to install Grafana Enterprise on Kubernetes, refer to Deploy Grafana Enterprise on Kubernetes . If you deploy an application in Kubernetes, it will use the default namespace which may already have other applications running. This can result in conflicts and other issues. It is recommended to create a new namespace in Kubernetes to better manage, organize, allocate, and manage cluster resources. For more information about Namespaces, refer to the official Kubernetes documentation . To create a namespace, run the following command: bash Copy kubectl create namespace my-grafana In this example, the namespace is my-grafana To verify and view the newly created namespace, run the following command: bash Copy kubectl get namespace my-grafana The output of the command provides more information about the newly created namespace. Create a YAML manifest file named grafana.yaml . This file will contain the necessary code for deployment. bash Copy touch grafana.yaml In the next step you define the following three objects in the YAML file. Object Description Persistent Volume Claim (PVC) This object stores the data. Service This object provides network access to the Pod defined in the deployment. Deployment This object is responsible for creating the pods, ensuring they stay up to date, and managing Replicaset and Rolling updates. Copy and paste the following contents and save it in the grafana.yaml file. yaml Copy --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: grafana-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: grafana name: grafana spec: selector: matchLabels: app: grafana template: metadata: labels: app: grafana spec: securityContext: fsGroup: 472 supplementalGroups: - 0 containers: - name: grafana image: grafana/grafana:latest imagePullPolicy: IfNotPresent ports: - containerPort: 3000 name: http-grafana protocol: TCP readinessProbe: failureThreshold: 3 httpGet: path: /robots.txt port: 3000 scheme: HTTP initialDelaySeconds: 10 periodSeconds: 30 successThreshold: 1 timeoutSeconds: 2 livenessProbe: failureThreshold: 3 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 tcpSocket: port: 3000 timeoutSeconds: 1 resources: requests: cpu: 250m memory: 750Mi volumeMounts: - mountPath: /var/lib/grafana name: grafana-pv volumes: - name: grafana-pv persistentVolumeClaim: claimName: grafana-pvc --- apiVersion: v1 kind: Service metadata: name: grafana spec: ports: - port: 3000 protocol: TCP targetPort: http-grafana selector: app: grafana sessionAffinity: None type: LoadBalancer Run the following command to send the manifest to the Kubernetes API server: bash Copy kubectl apply -f grafana.yaml --namespace=my-grafana This command creates the PVC, Deployment, and Service objects. Complete the following steps to verify the deployment status of each object. a. For PVC, run the following command: bash Copy kubectl get pvc --namespace=my-grafana -o wide b. For Deployment, run the following command: bash Copy kubectl get deployments --namespace=my-grafana -o wide c. For Service, run the following command: bash Copy kubectl get svc --namespace=my-grafana -o wide Access Grafana on Managed K8s Providers In this task, you access Grafana deployed on a Managed Kubernetes provider using a web browser. Accessing Grafana via a web browser is straightforward if it is deployed on a Managed Kubernetes Provider as it uses the cloud provider’s LoadBalancer to which the external load balancer routes are automatically created. Run the following command to obtain the deployment information: bash Copy kubectl get all --namespace=my-grafana The output returned should look similar to the following: bash Copy NAME READY STATUS RESTARTS AGE pod/grafana-69946c9bd6-kwjb6 1/1 Running 0 7m27s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/grafana LoadBalancer 10.5.243.226 1.120.130.330 3000:31171/TCP 7m27s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/grafana 1/1 1 1 7m29s NAME DESIRED CURRENT READY AGE replicaset.apps/grafana-69946c9bd6 1 1 1 7m30s Identify the EXTERNAL-IP value in the output and type it into your browser. The Grafana sign-in page appears. To sign in, enter admin for both the username and password. If you do not see the EXTERNAL-IP, complete the following steps: a. Run the following command to do a port-forwarding of the Grafana service on port 3000 . bash Copy kubectl port-forward service/grafana 3000:3000 --namespace=my-grafana For more information about port-forwarding, refer to Use Port Forwarding to Access Applications in a Cluster . b. Navigate to localhost:3000 in your browser. The Grafana sign-in page appears. c. To sign in, enter admin for both the username and password. Access Grafana using minikube There are multiple ways to access the Grafana UI on a web browser when using minikube. For more information about minikube, refer to How to access applications running within minikube . This section lists the two most common options for accessing an application running in minikube. Option 1: Expose the service This option uses the type: LoadBalancer in the grafana.yaml service manifest, which makes the service accessible through the minikube service command. For more information, refer to minikube Service command usage . Run the following command to obtain the Grafana service IP: bash Copy minikube service grafana --namespace=my-grafana The output returns the Kubernetes URL for service in your local cluster. bash Copy |------------|---------|-------------|------------------------------| | NAMESPACE | NAME | TARGET PORT | URL | |------------|---------|-------------|------------------------------| | my-grafana | grafana | 3000 | http://192.168.122.144:32182 | |------------|---------|-------------|------------------------------| Opening service my-grafana/grafana in default browser... http://192.168.122.144:32182 Run a curl command to verify whether a given connection should work in a browser under ideal circumstances. bash Copy curl 192.168.122.144:32182 The following example output shows that an endpoint has been located: &lt;a href="/login">Found&lt;/a>. Access the Grafana UI in the browser using the provided IP:Port from the command above. For example 192.168.122.144:32182 The Grafana sign-in page appears. To sign in to Grafana, enter admin for both the username and password. Option 2: Use port forwarding If Option 1 does not work in your minikube environment (this mostly depends on the network), then as an alternative you can use the port forwarding option for the Grafana service on port 3000 . For more information about port forwarding, refer to Use Port Forwarding to Access Applications in a Cluster . To find the minikube IP address, run the following command: bash Copy minikube ip The output contains the IP address that you use to access the Grafana Pod during port forwarding. A Pod is the smallest deployment unit in Kubernetes and is the core building block for running applications in a Kubernetes cluster. For more information about Pods, refer to Pods . To obtain the Grafana Pod information, run the following command: bash Copy kubectl get pods --namespace=my-grafana The output should look similar to the following: bash Copy NAME READY STATUS RESTARTS AGE grafana-58445b6986-dxrrw 1/1 Running 0 9m54s The output shows the Grafana POD name in the NAME column, that you use for port forwarding. Run the following command for enabling the port forwarding on the POD: bash Copy kubectl port-forward pod/grafana-58445b6986-dxrrw --namespace=my-grafana --address 0.0.0.0 3000:3000 To access the Grafana UI on the web browser, type the minikube IP along with the forwarded port. For example 192.168.122.144:3000 The Grafana sign-in page appears. To sign in to Grafana, enter admin for both the username and password. Update an existing deployment using a rolling update strategy Rolling updates enable deployment updates to take place with no downtime by incrementally updating Pods instances with new ones. The new Pods will be scheduled on nodes with available resources. For more information about rolling updates, refer to Performing a Rolling Update . The following steps use the kubectl annotate command to add the metadata and keep track of the deployment. For more information about kubectl annotate , refer to kubectl annotate documentation . Note Instead of using the annotate flag, you can still use the --record flag. However, it has been deprecated and will be removed in the future version of Kubernetes. See: https://github.com/kubernetes/kubernetes/issues/40422 To view the current status of the rollout, run the following command: bash Copy kubectl rollout history deployment/grafana --namespace=my-grafana The output will look similar to this: bash Copy deployment.apps/grafana REVISION CHANGE-CAUSE 1 NONE The output shows that nothing has been updated or changed after applying the grafana.yaml file. To add metadata to keep record of the initial deployment, run the following command: bash Copy kubectl annotate deployment/grafana kubernetes.io/change-cause=&#39;deployed the default base yaml file&#39; --namespace=my-grafana To review the rollout history and verify the changes, run the following command: bash Copy kubectl rollout history deployment/grafana --namespace=my-grafana You should see the updated information that you added in the CHANGE-CAUSE earlier. Change Grafana image version To change the deployed Grafana version, run the following kubectl edit command: bash Copy kubectl edit deployment grafana --namespace=my-grafana In the editor, change the container image under the kind: Deployment section. For example: From yaml image: grafana/grafana-oss:10.0.1 To yaml image: grafana/grafana-oss-dev:10.1.0-124419pre Save the changes. Once you save the file, you receive a message similar to the following: bash Copy deployment.apps/grafana edited This means that the changes have been applied. To verify that the rollout on the cluster is successful, run the following command: bash Copy kubectl rollout status deployment grafana --namespace=my-grafana A successful deployment rollout means that the Grafana Dev cluster is now available. To check the statuses of all deployed objects, run the following command and include the -o wide flag to get more detailed output: bash Copy kubectl get all --namespace=my-grafana -o wide You should see the newly deployed grafana-oss-dev image. To verify it, access the Grafana UI in the browser using the provided IP:Port from the command above. The Grafana sign-in page appears. To sign in to Grafana, enter admin for both the username and password. In the top-right corner, click the help icon. The version information appears. Add the change cause metadata to keep track of things using the commands: bash Copy kubectl annotate deployment grafana --namespace=my-grafana kubernetes.io/change-cause=&#39;using grafana-oss-dev:10.1.0-124419pre for testing&#39; To verify, run the kubectl rollout history command: bash Copy kubectl rollout history deployment grafana --namespace=my-grafana You will see an output similar to this: bash Copy deployment.apps/grafana REVISION CHANGE-CAUSE 1 deploying the default yaml 2 using grafana-oss-dev:10.1.0-124419pre for testing This means that REVISION#2 is the current version. Note The last line of the kubectl rollout history deployment command output is the one which is currently active and running on your Kubernetes environment. Roll back a deployment When the Grafana deployment becomes unstable due to crash looping, bugs, and so on, you can roll back a deployment to an earlier version (a REVISION ). By default, Kubernetes deployment rollout history remains in the system so that you can roll back at any time. For more information, refer to Rolling Back to a Previous Revision . To list all possible REVISION values, run the following command: bash Copy kubectl rollout history deployment grafana --namespace=my-grafana To roll back to a previous version, run the kubectl rollout undo command and provide a revision number. Example: To roll back to a previous version, specify the REVISION number, which appears after you run the kubectl rollout history deployment command, in the --to-revision parameter. bash Copy kubectl rollout undo deployment grafana --to-revision=1 --namespace=my-grafana To verify that the rollback on the cluster is successful, run the following command: bash Copy kubectl rollout status deployment grafana --namespace=my-grafana Access the Grafana UI in the browser using the provided IP:Port from the command above. The Grafana sign-in page appears. To sign in to Grafana, enter admin for both the username and password. In the top-right corner, click the help icon to display the version number. To see the new rollout history, run the following command: bash Copy kubectl rollout history deployment grafana --namespace=my-grafana If you need to go back to any other REVISION , just repeat the steps above and use the correct revision number in the --to-revision parameter. Provision Grafana resources using configuration files Provisioning can add, update, or delete resources specified in your configuration files when Grafana starts. For detailed information, refer to Grafana Provisioning . This section outlines general instructions for provisioning Grafana resources within Kubernetes, using a persistent volume to supply the configuration files to the Grafana pod. Add a new PersistentVolumeClaim to the grafana.yaml file. yaml Copy --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: grafana-provisioning-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Mi In the grafana.yaml file, mount the persistent volume into /etc/grafana/provisioning as follows. yaml Copy ... volumeMounts: - mountPath: /etc/grafana/provisioning name: grafana-provisioning-pv ... volumes: - name: grafana-provisioning-pv persistentVolumeClaim: claimName: grafana-provisioning-pvc ... Find or create the provision resources you want to add. For instance, create a alerting.yaml file adding a mute timing (alerting resource). yaml Copy apiVersion: 1 muteTimes: - orgId: 1 name: MuteWeekends time_intervals: - weekdays: [saturday, sunday] By default, configuration files for alerting resources need to be placed in the provisioning/alerting directory. Save the alerting.yaml file in a directory named alerting , as we will next supply this alerting directory to the /etc/grafana/provisioning folder of the Grafana pod. Verify first the content of the provisioning directory in the running Grafana pod. bash Copy kubectl exec -n my-grafana &lt;pod_name&gt; -- ls /etc/grafana/provisioning/ bash Copy kubectl exec -n my-grafana &lt;pod_name&gt; -- ls /etc/grafana/provisioning/alerting Because the alerting folder is not available yet, the last command should output a No such file or directory error. Copy the local alerting directory to /etc/grafana/provisioning/ in the Grafana pod. bash Copy kubectl cp alerting my-grafana/&lt;pod_name&gt;:/etc/grafana/provisioning/ You can follow the same process to provision additional Grafana resources by supplying the following folders: provisioning/dashboards provisioning/datasources provisioning/plugins Verify the alerting directory in the running Grafana pod includes the alerting.yaml file. bash Copy kubectl exec -n my-grafana &lt;pod_name&gt; -- ls /etc/grafana/provisioning/alerting Restart the Grafana pod to provision the resources. bash Copy kubectl rollout restart -n my-grafana deployment --selector=app=grafana Note that rollout restart kills the previous pod and scales a new pod. When the old pod terminates, you may have to enable port-forwarding in the new pod. For instructions, refer to the previous sections about port forwarding in this guide. Verify the Grafana resources are properly provisioned within the Grafana instance. Troubleshooting This section includes troubleshooting tips you might find helpful when deploying Grafana on Kubernetes. Collecting logs It is important to view the Grafana server logs while troubleshooting any issues. To check the Grafana logs, run the following command: bash Copy # dump Pod logs for a Deployment (single-container case) kubectl logs --namespace=my-grafana deploy/grafana If you have multiple containers running in the deployment, run the following command to obtain the logs only for the Grafana deployment: bash Copy # dump Pod logs for a Deployment (multi-container case) kubectl logs --namespace=my-grafana deploy/grafana -c grafana For more information about accessing Kubernetes application logs, refer to Pods and Deployments . Increasing log levels to debug mode By default, the Grafana log level is set to info , but you can increase it to debug mode to fetch information needed to diagnose and troubleshoot a problem. For more information about Grafana log levels, refer to Configuring logs . The following example uses the Kubernetes ConfigMap which is an API object that stores non-confidential data in key-value pairs. For more information, refer to Kubernetes ConfigMap Concept . Create a empty file and name it grafana.ini and add the following: bash Copy [log] ; # Either &#34;debug&#34;, &#34;info&#34;, &#34;warn&#34;, &#34;error&#34;, &#34;critical&#34;, default is &#34;info&#34; ; # we change from info to debug level level = debug This example adds the portion of the log section from the configuration file. You can refer to the Configure Grafana documentation to view all the default configuration settings. To add the configuration file into the Kubernetes cluster via the ConfigMap object, run the following command: bash Copy kubectl create configmap ge-config --from-file=/path/to/file/grafana.ini --namespace=my-grafana To verify the ConfigMap object creation, run the following command: bash Copy kubectl get configmap --namespace=my-grafana Open the grafana.yaml file and In the Deployment section, provide the mount path to the custom configuration ( /etc/grafana ) and reference the newly created ConfigMap for it. bash Copy --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: grafana name: grafana # the rest of the code remains the same. ... .... ... requests: cpu: 250m memory: 750Mi volumeMounts: - mountPath: /var/lib/grafana name: grafana-pv # This is to mount the volume for the custom configuration - mountPath: /etc/grafana name: ge-config volumes: - name: grafana-pv persistentVolumeClaim: claimName: grafana-pvc # This is to provide the reference to the ConfigMap for the volume - name: ge-config configMap: name: ge-config Deploy the manifest using the following kubectl apply command: bash Copy kubectl apply -f grafana.yaml --namespace=my-grafana To verify the status, run the following commands: bash Copy # first check the rollout status kubectl rollout status deployment grafana --namespace=my-grafana # then check the deployment and configMap information kubectl get all --namespace=my-grafana To verify it, access the Grafana UI in the browser using the provided IP:Port The Grafana sign-in page appears. To sign in to Grafana, enter admin for both the username and password. Navigate to Server Admin > Settings and then search for log. You should see the level to debug mode. Using the &ndash;dry-run command You can use the Kubernetes --dry-run command to send requests to modifying endpoints and determine if the request would have succeeded. Performing a dry run can be useful for catching errors or unintended consequences before they occur. For more information, refer to Kubernetes Dry-run . Example: The following example shows how to perform a dry run when you make changes to the grafana.yaml such as using a new image version, or adding new labels and you want to determine if there are syntax errors or conflicts. To perform a dry run, run the following command: bash Copy kubectl apply -f grafana.yaml --dry-run=server --namespace=grafana If there are no errors, then the output will look similar to this: bash Copy persistentvolumeclaim/grafana-pvc unchanged (server dry run) deployment.apps/grafana unchanged (server dry run) service/grafana unchanged (server dry run) If there are errors or warnings, you will see them in the terminal. Remove Grafana If you want to remove any of the Grafana deployment objects, use the kubectl delete command . If you want to remove the complete Grafana deployment, run the following command: bash Copy kubectl delete -f grafana.yaml --namespace=my-grafana This command deletes the deployment, persistentvolumeclaim, and service objects. To delete the ConfigMap, run the following command: bash Copy kubectl delete configmap ge-config --namespace=my-grafana Deploy Grafana Enterprise on Kubernetes The process for deploying Grafana Enterprise is almost identical to the preceding process, except for additional steps that are required for adding your license file. Obtain Grafana Enterprise license To run Grafana Enterprise, you need a valid license. To obtain a license, contact a Grafana Labs representative . This topic assumes that you have a valid license in a license.jwt file. Associate your license with a URL that you can use later in the topic. Create license secret Create a Kubernetes secret from your license file using the following command: bash Copy kubectl create secret generic ge-license --from-file=/path/to/your/license.jwt Create Grafana Enterprise configuration Create a Grafana configuration file with the name grafana.ini Paste the following YAML contents into the file you created: yaml Copy [enterprise] license_path = /etc/grafana/license/license.jwt [server] root_url =/your/license/root/url Update the root_url field to the url associated with the license provided to you. Create Configmap for Grafana Enterprise configuration Create a Kubernetes Configmap from your grafana.ini file with the following command: bash Copy kubectl create configmap ge-config --from-file=/path/to/your/grafana.ini Create Grafana Enterprise Kubernetes manifest Create a grafana.yaml file, and copy-and-paste the following content into it. The following YAML is identical to the one for a Grafana installation, except for the additional references to the Configmap that contains your Grafana configuration file and the secret that has your license. yaml Copy --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: grafana-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: grafana name: grafana spec: selector: matchLabels: app: grafana template: metadata: labels: app: grafana spec: securityContext: fsGroup: 472 supplementalGroups: - 0 containers: - image: grafana/grafana-enterprise:latest imagePullPolicy: IfNotPresent name: grafana ports: - containerPort: 3000 name: http-grafana protocol: TCP readinessProbe: failureThreshold: 3 httpGet: path: /robots.txt port: 3000 scheme: HTTP initialDelaySeconds: 10 periodSeconds: 30 successThreshold: 1 timeoutSeconds: 2 resources: limits: memory: 4Gi requests: cpu: 100m memory: 2Gi volumeMounts: - mountPath: /var/lib/grafana name: grafana-pv - mountPath: /etc/grafana name: ge-config - mountPath: /etc/grafana/license name: ge-license volumes: - name: grafana-pv persistentVolumeClaim: claimName: grafana-pvc - name: ge-config configMap: name: ge-config - name: ge-license secret: secretName: ge-license --- apiVersion: v1 kind: Service metadata: name: grafana spec: ports: - port: 3000 protocol: TCP targetPort: http-grafana selector: app: grafana sessionAffinity: None type: LoadBalancer Caution If you use LoadBalancer in the Service and depending on your cloud platform and network configuration, doing so might expose your Grafana instance to the Internet. To eliminate this risk, use ClusterIP to restrict access from within the cluster Grafana is deployed to. To send the manifest to Kubernetes API Server, run the following command: kubectl apply -f grafana.yaml To verify the manifest was sent, run the following command: kubectl port-forward service/grafana 3000:3000 Navigate to localhost:3000 in your browser. You should see the Grafana login page. Use admin for both the username and password to login. To verify you are working with an enterprise license, scroll to the bottom of the page where you should see Enterprise (Licensed) . Was this page helpful? Yes No Suggest an edit in GitHub Create a GitHub issue Email docs@grafana.com Help and support Community Related resources from Grafana Labs Additional helpful documentation, links, and articles: 17 Sep Getting started with managing your metrics, logs, and traces using Grafana In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics. 60 min Getting started with Grafana dashboard design In this webinar, you'll learn how to design stylish and easily accessible Grafana dashboards that tell a story. 60 min Building advanced Grafana dashboards In this webinar, we’ll demo how to build and format Grafana dashboards. Is this page helpful? Yes No On this page Before you begin System requirements Minimum Hardware Requirements Supported databases Supported web browsers Deploy Grafana OSS on Kubernetes Access Grafana on Managed K8s Providers Access Grafana using minikube Option 1: Expose the service Option 2: Use port forwarding Update an existing deployment using a rolling update strategy Change Grafana image version Roll back a deployment Provision Grafana resources using configuration files Troubleshooting Collecting logs Increasing log levels to debug mode Using the &ndash;dry-run command Remove Grafana Deploy Grafana Enterprise on Kubernetes Obtain Grafana Enterprise license Create license secret Create Grafana Enterprise configuration Create Configmap for Grafana Enterprise configuration Create Grafana Enterprise Kubernetes manifest Scroll for more Sign up for Grafana stack updates Subscribe Sorry, an error occurred. Email update@grafana.com for help. Note: By signing up, you agree to be emailed related product-level information. Products Grafana Cloud Grafana Enterprise Stack Grafana visualizations Plugins Grafana Cloud Logs Grafana Cloud Metrics Grafana Cloud Traces Grafana Cloud Profiles AI/ML tools for observability Application Observability Frontend Observability Grafana Cloud Asserts Grafana IRM Grafana k6 Grafana SLO Synthetic Monitoring Solutions Pricing Open Source Grafana Grafana Alloy Grafana Beyla Grafana Faro Grafana k6 Grafana Loki Grafana Mimir Grafana OnCall Grafana Pyroscope Grafana Tanka Grafana Tempo Graphite OpenTelemetry Prometheus Dashboard templates Downloads &nbsp; GitHub Learn Documentation Grafana Labs blog Webinars and videos Tutorials Workshops Events Community Professional Services Community forums Community Slack Grafana Champions Community organizers Observability Survey Report 2025 OSS vs Cloud Writers' Toolkit Plugin development Load testing OpenTelemetry Report Log monitoring Company Partnerships Our team Careers Success stories Newsroom Contact us Getting help Merch Open positions We're hiring The Story of Grafana Compare Grafana vs. Datadog Localized content Japanese pages German pages French pages Spanish pages Portuguese pages Grafana Cloud status Legal and Security Terms of Service Privacy Policy Trademark Policy Copyright 2025 &copy; Grafana Labs Grafana Labs uses cookies for the normal operation of this website. Learn more. Got it!