Browse Source

Update ipfs chart to use common service implementation

Waqar Ahmed 4 năm trước cách đây
mục cha
commit
af075c5ebf
1 tập tin đã thay đổi với 6 bổ sung31 xóa
  1. 6 31
      test/ipfs/1.0.1/templates/service.yaml

+ 6 - 31
test/ipfs/1.0.1/templates/service.yaml

@@ -1,31 +1,6 @@
-{{ $scheme := "http" }}
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ template "ipfs.fullname" . }}
-  labels:
-    app: {{ template "ipfs.name" . }}
-    chart: {{ template "ipfs.chart" . }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  type: "NodePort"
-  ports:
-    - name: swarm
-      port: {{ .Values.service.swarmPort }}
-      protocol: TCP
-      nodePort: {{ .Values.service.swarmPort }}
-      targetPort: 9401
-    - name: api
-      port: {{ .Values.service.apiPort }}
-      protocol: TCP
-      nodePort: {{ .Values.service.apiPort }}
-      targetPort: 9501
-    - name: gateway
-      port: {{ .Values.service.gatewayPort }}
-      protocol: TCP
-      nodePort: {{ .Values.service.gatewayPort }}
-      targetPort: 9880
-  selector:
-    app: {{ template "ipfs.name" . }}
-    release: {{ .Release.Name }}
+{{ $svc := .Values.service }}
+{{ $ports := list }}
+{{ $ports = mustAppend $ports (dict "name" "swarm" "port" $svc.swarmPort "nodePort" $svc.swarmPort "targetPort" 9401) }}
+{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.apiPort "nodePort" $svc.apiPort "targetPort" 9501) }}
+{{ $ports = mustAppend $ports (dict "name" "gateway" "port" $svc.gatewayPort "nodePort" $svc.gatewayPort "targetPort" 9880) }}
+{{ include "common.classes.service" (dict "type" "NodePort" ) }}