I have an application running on a pure docker environment. I wanted to deploy that in a k8s. Hence I created config maps, deployments etc. Below is the config file before deploying to k8s.
config:
message:
- type: "fusion:expense:expense_type:v1"
versions:
- version: "v1"
handler:
request_uri: "http://localhost:8082/api/v1/expenses/"
- version: "v2"
handler:
request_uri: "http://localhost:8082/api/v2/expenses/"
- type: "card_type"
versions:
- version: "v1"
handler:
request_uri: "http://localhost:8082/api/v1/cardtype"
ossprovider:
endpoint: "http://localhost:19000"
adaptors:
endpoint: http://localhost:8092/adaptors/
I created a service like
kind: Service
metadata:
name: fin-service
spec:
type: ClusterIP
ports:
- port: 8090
targetPort: 8090
protocol: TCP
name: http
- port: 8082
targetPort: 8082
protocol: TCP
- port: 19000
targetPort: 19000
protocol: TCP
selector:
fin-app
My deployment looks like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: fin
namespace: {{ .Values.namespace }}
labels:
fin
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
fin
template:
metadata:
labels:
fin
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.containers.oss_messaginglayer.name }}
image: {{ .Values.image.oss_messaginglayer.repository }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8090
protocol: TCP
Since I created a service, I wanted to use this service end point in the config file as fin-service instead of localhost.
app:
config:
message:
- type: "fusion:expense:expense_type:v1"
versions:
- version: "v1"
handler:
request_uri: "http://fin-service:8082/api/v1/expenses/"
- version: "v2"
handler:
request_uri: "http://fin-service:8082/api/v2/expenses/"
- type: "card_type"
versions:
- version: "v1"
handler:
request_uri: "http://fin-service:8082/api/v1/cardtype"
ossprovider:
endpoint: "http://fin-service:19000"
adaptors:
endpoint: http://fin-service:8092/adaptors/
But I get connection refused errors at http://fin-service:19000. Where am I going off the track?