--- apiVersion: v1 kind: Namespace metadata: name: flux-system --- apiVersion: v1 kind: Namespace metadata: name: monitoring --- apiVersion: v1 kind: Namespace metadata: name: golang --- apiVersion: apps/v1 kind: Deployment metadata: name: webapp namespace: golang spec: replicas: 3 selector: matchLabels: app: webapp role: scrape-target template: metadata: labels: app: webapp role: scrape-target annotations: prometheus.io/scrape: 'true' prometheus.io/port: '3000' prometheus.io/path: '/metrics' spec: containers: - name: golang image: public.ecr.aws/awsvijisarathy/prometheus-webapp:2.0 imagePullPolicy: Always resources: requests: cpu: "128m" memory: "128Mi" ports: - name: http containerPort: 3000 protocol: TCP --- apiVersion: v1 kind: Service metadata: name: webapp-svc namespace: golang spec: sessionAffinity: None type: ClusterIP ports: - port: 80 protocol: TCP targetPort: 3000 selector: app: webapp role: scrape-target