Skip to content

Commit

Permalink
Merge pull request #255 from linkernetworks/phstsai/VX-270
Browse files Browse the repository at this point in the history
[Bug] VX-270: Change node to exported_node
  • Loading branch information
Hung-Wei Chiu authored Aug 17, 2018
2 parents d61f52d + ee26acc commit 0cc8bc9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
24 changes: 18 additions & 6 deletions deploy/helm/apps/charts/prometheus/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@ metadata:
spec:
selector:
app: prometheus
{{- if .Values.service.nodePort }}
type: NodePort
type: ClusterIP
ports:
- port: 9090
targetPort: 9090
nodePort: 30003
{{- else }}
type: ClusterIP

---

{{- if .Values.service.nodePort }}
kind: Service
apiVersion: v1
metadata:
labels:
app: prometheus
name: prometheus-external
namespace: vortex
spec:
selector:
app: prometheus
type: NodePort
ports:
- port: 9090
targetPort: 9090
{{- end }}
nodePort: 30003
{{- end }}
28 changes: 18 additions & 10 deletions deploy/helm/services/charts/mongodb/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@ metadata:
spec:
selector:
service: mongo
{{- if .Values.service.nodePort }}
type: NodePort
ports:
- port: 27017
nodePort: 31717
targetPort: 27017
protocol: TCP
{{- else }}
clusterIP: None
type: ClusterIP
ports:
- port: 27017
targetPort: 27017
{{- end }}


---

{{- if .Values.service.nodePort }}
apiVersion: v1
kind: Service
metadata:
name: mongo-external
namespace: vortex
spec:
selector:
service: mongo
type: NodePort
ports:
- port: 27017
nodePort: 31717
targetPort: 27017
protocol: TCP
{{- end }}
4 changes: 2 additions & 2 deletions src/prometheuscontroller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func GetPod(sp *serviceprovider.Container, id string) (entity.PodMetrics, error)
case "kube_pod_info":
pod.PodName = id
pod.IP = string(result.Metric["pod_ip"])
pod.Node = string(result.Metric["node"])
pod.Node = string(result.Metric["exported_node"])
pod.Namespace = string(result.Metric["namespace"])
pod.CreateByKind = string(result.Metric["created_by_kind"])
pod.CreateByName = string(result.Metric["created_by_name"])
Expand Down Expand Up @@ -331,7 +331,7 @@ func GetContainer(sp *serviceprovider.Container, id string) (entity.ContainerMet
case "kube_pod_container_info":
container.Detail.ContainerName = id
container.Detail.Pod = string(result.Metric["pod"])
container.Detail.Node = string(result.Metric["node"])
container.Detail.Node = string(result.Metric["exported_node"])
container.Detail.Image = string(result.Metric["image"])
container.Detail.Namespace = string(result.Metric["namespace"])

Expand Down

0 comments on commit 0cc8bc9

Please sign in to comment.