Skip to content

Commit

Permalink
SSH support
Browse files Browse the repository at this point in the history
  • Loading branch information
oskar-s9s committed Apr 9, 2024
1 parent b8283ff commit 74bd641
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
14 changes: 14 additions & 0 deletions charts/clustercontrol/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
- name: cmon-ssh
image: {{ .Values.cmon.image | required ".Values.cmon.image is missing" }}
command: ['sh', '-c', '/usr/sbin/cmon-ssh']
ports:
- containerPort: 9511
protocol: TCP
name: cmon-ssh9511
volumeMounts:
- mountPath: /etc/cmon.d/
name: cmon-master-pv
{{ if .Values.cmon.sshKeysSecretName }}
- mountPath: /root/.ssh-keys-user
name: ssh-keys-user
{{ end }}
volumes:
- name: cmon-master-pv
persistentVolumeClaim:
Expand Down
61 changes: 61 additions & 0 deletions charts/clustercontrol/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ metadata:
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_pass_header Server;
add_header Server $upstream_http_server;
more_set_headers "Set-Cookie: $sent_http_set_cookie; Path=/";
spec:
ingressClassName: {{ .Values.cmon.ingress.ingressClassName | default "nginx" }}
Expand All @@ -98,4 +99,64 @@ spec:
number: 9501
path: /cmon/(.*)
pathType: ImplementationSpecific
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "cc.name" . }}-cmon-ssh-ingress
annotations:
kubernetes.io/tls-acme: "true"
{{ if .Values.cmon.ingress.ssl.clusterIssuer }}
cert-manager.io/cluster-issuer: {{ .Values.cmon.ingress.ssl.clusterIssuer }}
{{ end }}
nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: {{ .Values.cmon.ingress.ingressClassName | default "nginx" }}
tls:
- hosts:
- {{ .Values.fqdn }}
secretName: {{ .Values.fqdn }}
rules:
- host: {{ .Values.fqdn }}
http:
paths:
- path: /cmon-ssh/(.*)
pathType: ImplementationSpecific
backend:
service:
name: cmon-master
port:
number: 9511
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "cc.name" . }}-websocket-cmon-ssh-ingress
annotations:
kubernetes.io/tls-acme: "true"
{{ if .Values.cmon.ingress.ssl.clusterIssuer }}
cert-manager.io/cluster-issuer: {{ .Values.cmon.ingress.ssl.clusterIssuer }}
{{ end }}
nginx.ingress.kubernetes.io/rewrite-target: /cmon/ws/$1
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
spec:
ingressClassName: {{ .Values.cmon.ingress.ingressClassName | default "nginx" }}
tls:
- hosts:
- {{ .Values.fqdn }}
secretName: {{ .Values.fqdn }}
rules:
- host: {{ .Values.fqdn }}
http:
paths:
- path: /cmon-ssh/cmon/ws/(.*)
pathType: Prefix
backend:
service:
name: cmon-master
port:
number: 9511
{{ end }}
4 changes: 4 additions & 0 deletions charts/clustercontrol/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec:
protocol: TCP
targetPort: 3000
name: 3000-port
- port: 9511
protocol: TCP
targetPort: 9511
name: 9511-port
selector:
app: cmon-master
run: cmon-master
Expand Down

0 comments on commit 74bd641

Please sign in to comment.