Hi all.
I am playing with pod initialization. Initial setup is minikube, I have Deployment + Service. When i run “minikube service grafana-service --url” i can access grafana. But for pod initialization I had to switch to Pod type. So instead of Deployment I have now Pod. Pod is also pointing same Service or vice versa service is now looking for Pod. But when i do “minikube service grafana-service --url” I cant access grafana. Any idea what I am doing wrong?
apiVersion: v1
kind: Pod
metadata:
name: grafana
spec:
initContainers:
- name: init-plugins
image: busybox:1.28
command:
- do some my logic
containers:
- name: grafana
image: grafana/grafana:latest
ports:
- containerPort: 3000
---
#apiVersion: apps/v1
#kind: Deployment
#metadata:
# name: grafana
#spec:
# selector:
# matchLabels:
# app: grafana
# replicas: 1
# template:
# metadata:
# labels:
# app: grafana
# spec:
# containers:
# - name: grafana
# image: grafana/grafana:latest
# ports:
# - containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
name: grafana-service
spec:
type: LoadBalancer
ports:
- port: 3000
targetPort: 3000
protocol: TCP
selector:
app: grafana
---