How to Access Kubernetes Git Container via Ingress via HTTP as well as SSH


#1

Hi,
I have a small kubernetes (1.3) cluster (basically one node) and would like to install gogs in there. Gogs is “installed” using Helm. I do have the following templates in my helm chart:

Deployment (using image gogs:0.9.97, having containerPort 3000 (http) as well as 2222 (ssh)
Ingress (this is only for Port 80)
Service (Port 80 (http) as well as 2222 (ssh))
The http-stuff is configured correctly and I can access the container as well as the contained git-repositories via http without any trouble. Now I would like to use ssh for the git-connections as well. I tried the --tcp-services-configmap configuration of nginx-ingress, but to no avail. The log of the Ingress Controller states, that the configured service does not have any active endpoints, which I find rather strange, since the http stuff is working.

UPDATE

I just did an nmap on the DNS and the port 2222 is not open. This looks like a konfiguration problem. The port is open on the container (tested by connecting to the cluster ip from the ndoe).

Guess that the problem is that the log of the Ingress Controller states, that the configured service does not have any active endpoints.

My Service onfiguration is:

apiVersion: v1
kind: Service
metadata:
name: {{ template “fullname” . }}
labels:
app: {{ template “fullname” . }}
spec:
ports:
- name: http
port: 80
targetPort: http
protocol: TCP
- name: ssh
port: 2222
targetPort: ssh
protocol: TCP
selector:
app: {{ template “fullname” . }}
The config-map is:

apiVersion: v1
kind: ConfigMap
metadata:
name: tcp-configmap-ssh
data:
2222: “default/{{ template “fullname” . }}:2222”

Thank you