I have 1 AKS clusters with multiple services and 1 ingress controller
I have a requirement for 1 of the service to listen to tcp on port 11112
Below is my deployment file
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: xxx-py
name: xxx-py
spec:
replicas: 2
selector:
matchLabels:
app: xxx-py
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: xxx-py
spec:
containers:
- image: prodacr01.azurecr.io/xxxpy:#{Build.BuildId}#
name: xxx-py
imagePullPolicy: Always
resources: {}
ports:
- containerPort: 8000
- containerPort: 11112
imagePullSecrets:
- name: regcred
status: {}
---
apiVersion: v1
kind: Service
metadata:
name: xxx-py
labels:
run: xxx-py
spec:
ports:
- name: httpapp
protocol: TCP
port: 80
targetPort: 8000
- name: dapp
protocol: TCP
port: 11112
targetPort: 11112
selector:
app: xxx-py
What changes are required to make it accessible on 11112?
I have created the different deployments to expose the service to port 11112
I have created the sample nginx deployment file
Created the deployment using below command
To check the deployment
pod kubectl get pods
I have created the manifest file for service type of clusterIP
To deploy the file and check the services which we have created use the below commands
To view the service
kubectl get service my-np-service --output yaml
If the nodes in the cluster have an external IP address use the below command
We can check with the Loadbalancer/cluster/nodeport IP weather servoce are exposed to 11112 port ot not
We can also use the below command to expose the service to 11112 port