diff --git a/docker/ssh/Dockerfile b/docker/ssh/Dockerfile new file mode 100644 index 0000000..3e0ab71 --- /dev/null +++ b/docker/ssh/Dockerfile @@ -0,0 +1,7 @@ +FROM library/alpine +RUN apk add --no-cache openssh && \ + sed -i /etc/ssh/sshd_config -e s/'#Port.*'/'Port 2222'/ -e s/'AllowTcpForwarding.*'/'AllowTcpForwarding yes'/ +RUN adduser -D -s /bin/ash beagle +ADD beagle.key /home/beagle/.ssh/authorized_keys +RUN passwd -u beagle && \ + chown -R beagle:beagle /home/beagle diff --git a/docker/ssh/beagle.key b/docker/ssh/beagle.key new file mode 100644 index 0000000..48e2766 --- /dev/null +++ b/docker/ssh/beagle.key @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5y7Ipbp3pjiG2XVolwrWn1W7xXWBER7UNd67h1coGhjkysieclFdL6ODxueqAoo5CEQJAhZJHh/X1vbY6Ux7AmdKQXqLKmk/B4rWgspF9wUCQe0E6Z9CGXDzthPzu1y/PEh8MGqEPZ5CSE6MSmXPVNCo7QBV5J1u872qxYUZwdqguQVCSfi2rlXPb9YbH7hPxiB6g1pKYyBrTnYimmFhQUmf5c9H0/mIEs45m2cro1ROeD+ywoQGcJp538qNa+cAjh8FrgediehHTspq/Lp1NXMWgX+DmsqS6i985lP6h7F0/zqv/ok0CZ+XoHVsa+7TiqRZ6KjL2IsIQtgirL0ux debian@beagleyellow diff --git a/ssh/deploy.yaml b/ssh/deploy.yaml new file mode 100644 index 0000000..3474763 --- /dev/null +++ b/ssh/deploy.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + app: ssh + name: ssh +spec: + replicas: 1 + selector: + matchLabels: + app: ssh + strategy: {} + template: + metadata: + creationTimestamp: null + labels: + app: ssh + spec: + containers: + - image: imartyn/ssh + name: alpine + command: + - sh + - -c + - ssh-keygen -A; /usr/sbin/sshd -D -p 22 + ports: + - containerPort: 22 + name: ssh + protocol: TCP + hostPort: 22 + - containerPort: 8096 + name: jelly + protocol: TCP + resources: {} +status: {} diff --git a/ssh/service-jelly.yaml b/ssh/service-jelly.yaml new file mode 100644 index 0000000..b722b7a --- /dev/null +++ b/ssh/service-jelly.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: ssh + name: remote-jelly + namespace: cluster-ingress +spec: + ports: + - port: 8096 + selector: + app: ssh + type: ClusterIP diff --git a/ssh/service-ssh.yaml b/ssh/service-ssh.yaml new file mode 100644 index 0000000..a1a9f65 --- /dev/null +++ b/ssh/service-ssh.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: ssh + name: ssh + namespace: cluster-ingress +spec: + ports: + - port: 22 + selector: + app: ssh + type: NodePort