Deploy Grafana and Prometheus to AKS via Azure DevOps Pipeline

Chidiebere Ugwu 25 Reputation points
2024-07-06T07:03:20.4966667+00:00

I want to pull an app image from Azure container registry to AKS and install Grafana and Prometheus to AKS cluster via Azure DevOps pipeline using the code snippet below:

apiVersion: apps/v1
kind: Deployment
metadata:
name: schon-app
spec:
replicas: 2
selector:
matchLabels:
app: schon-app
template:
metadata:
labels:
app: schon-app
spec:
containers:
- name: schon-klinik-app
image: xxxxxxx.azurecr.io/schonapp:sck
ports:
- containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
name: schon-app-svc
spec:
selector:
app: schon-app
ports:
- protocol: TCP
port: 5000
targetPort: 5000
type: LoadBalancer
---
#Prometheus deployment
---
apiVersion: apps/v1 
kind: Deployment
metadata:
name: prom
labels:
app: prom
spec:
selector:
matchLabels:
app: prom
strategy:
type: Recreate
template:
metadata:
labels:
app: prom
spec: 
containers:
- name: prom
image: prom/prometheus
ports:
- containerPort: 9090
#Expose prometheus
---
apiVersion: v1
kind: Service
metadata:
name: prom
labels:
app: prom
spec:
selector:
app: prom
ports:
- protocol: TCP
port: 9090
targetPort: 9090
type: LoadBalancer
#Grafana deployment
---
apiVersion: apps/v1 
kind: Deployment
metadata:
name: grafana
labels:
app: grafana
spec:
selector:
matchLabels:
app: grafana
strategy:
type: Recreate
template:
metadata:
labels:
app: grafana
spec: 
containers:
- name: grafana
image: grafana/grafana
ports:
- containerPort: 3000
#Expose Grafana
---
apiVersion: v1
kind: Service
metadata:
name: grafana
labels:
app: grafana
spec:
selector:
app: grafana
ports:
- protocol: TCP
port: 3000
targetPort: 3000
type: LoadBalancer

But I keep getting the error as seen below:

Screenshot 2024-07-06 at 7.58.06 AM

need help with any suggestion or sample script to achieve that especially the Grafana and Prometheus aspect as the app deploys well if I remove the Grafana and Prometheus side.

Azure Managed Grafana
Azure Managed Grafana
An Azure service used to deploy Grafana dashboards for analytics and monitoring solutions.
108 questions
0 comments No comments
{count} votes

Accepted answer
  1. Iheanacho Chukwu 1,020 Reputation points
    2024-07-08T18:57:05.6233333+00:00

    It doesn't feel like here is the best place to address this, as it will require more troubleshooting specify to Azure DevOps. For a specialized assistance on Azure DevOps question, kindly just re-post your question on Developer Communityto receive insights from the targetted SMEs/audience. When posting I will suggest you share logs of your pipeline run and if possible your azure-pipeline.yaml file.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.