2021-08-31 22:11:22 +03:00
|
|
|
apiVersion: apps/v1
|
2017-05-01 20:26:16 +03:00
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2021-09-13 23:14:09 +03:00
|
|
|
namespace: prod
|
2017-05-01 20:26:16 +03:00
|
|
|
name: coordinator-deployment
|
|
|
|
spec:
|
2021-08-31 22:11:22 +03:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: coordinator
|
2017-05-01 20:26:16 +03:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: coordinator
|
2017-07-17 18:19:37 +03:00
|
|
|
annotations:
|
|
|
|
container.seccomp.security.alpha.kubernetes.io/coordinator: docker/default
|
|
|
|
container.apparmor.security.beta.kubernetes.io/coordinator: runtime/default
|
2017-05-01 20:26:16 +03:00
|
|
|
spec:
|
2021-09-13 23:14:09 +03:00
|
|
|
serviceAccountName: coordinator
|
2017-05-01 20:26:16 +03:00
|
|
|
containers:
|
|
|
|
- name: coordinator
|
2017-09-05 23:47:00 +03:00
|
|
|
image: gcr.io/symbolic-datum-552/coordinator:latest
|
2017-05-01 20:26:16 +03:00
|
|
|
imagePullPolicy: Always
|
2021-10-27 00:14:46 +03:00
|
|
|
command: ["/coordinator", "-listen-http=:80", "-listen-https-autocert=:443", "-autocert-bucket=farmer-golang-org-autocert-cache"]
|
2017-05-01 20:26:16 +03:00
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
- containerPort: 443
|
cmd/coordinator, cmd/buildlet, cmd/gomote: add SSH support
This adds an SSH server to farmer.golang.org on port 2222 that proxies
SSH connections to users' gomote-created buildlet instances.
For example:
$ gomote create openbsd-amd64-60
user-bradfitz-openbsd-amd64-60-1
$ gomote ssh user-bradfitz-openbsd-amd64-60-1
Warning: Permanently added '[localhost]:33351' (ECDSA) to the list of known hosts.
OpenBSD 6.0 (GENERIC.MP) golang/go#2319: Tue Jul 26 13:00:43 MDT 2016
Welcome to OpenBSD: The proactively secure Unix-like operating system.
Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code. With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.
$
As before, if the coordinator process is restarted (or crashes, is
evicted, etc), all gomote instances die.
Not yet supported:
* scp (help wanted)
* not all host types are configured. most are. some will need slight
config tweaks to the Docker image (e.g. adding openssh-server)
Supports currently:
* linux-amd64 (host type shared by 386, nacl)
* linux-arm
* linux-arm64
* darwin
* freebsd
* openbsd
* plan9-386
* windows
Implementation details:
* the ssh server process listens on port 2222 in the coordinator
(farmer.golang.org), which is behind a GKE TCP load balancer.
* the ssh server library is github.com/gliderlabs/ssh
* authentication is done via Github users' public keys. It's assumed
that gomote user == github user. But there's a mapping in the code
for known exceptions.
* we can't give out access to this too widely. too many things are
accessible from within the host environment if you look in the right
places. Details omitted. But the Go team and other trusted gomote
users can use this.
* the buildlet binary has a new /connect-ssh handler that acts like a
CONNECT request but instead of taking an explicit host:port, just
says "give me your machine's SSH connection". The buildlet can also
start sshd if needed for the environment. The /connect-ssh handler
also installs the coordinator's public key.
* a new buildlet client library method "ConnectSSH" hits the /connect-ssh
handler and returns a net.Conn.
* the coordinator's ssh.Handler is just running the OpenSSH ssh client.
* because the OpenSSH ssh child process can't connect to a net.Conn,
an emphemeral localhost port is created on the coordinator to proxy
between the ssh client and the net.Conn returned by ConnectSSH.
* The /connect-ssh handler requires http.Hijacker, which requires
fully compliant net.Conn implementations as of Go 1.8. So I needed
to flesh out revdial too, testing it with the
golang.org/x/net/nettest package.
* plan9 doesn't have an ssh server, so we use 0intro's new conterm
program (drawterm without GUI support) to connect to plan9 from the
coordinator ssh proxy instead of using the OpenSSH ssh client
binary.
* windows doesn't have an ssh server, so we enable the telnet service
and the coordinator ssh proxy uses telnet instead on the backend
on the private network. (There is a Windows ssh server but only in
new versions.)
Happy debugging over ssh!
Fixes golang/go#19956
Change-Id: I80a62064c5f85af1f195f980c862ba29af4015f0
Reviewed-on: https://go-review.googlesource.com/50750
Reviewed-by: Herbie Ong <herbie@google.com>
Reviewed-by: Jessie Frazelle <me@jessfraz.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-22 22:15:56 +03:00
|
|
|
- containerPort: 2222 # ssh proxy port
|
2019-05-02 23:32:40 +03:00
|
|
|
- containerPort: 8123 # module proxy port (internal, not accessible directly from public)
|
2017-05-01 20:26:16 +03:00
|
|
|
resources:
|
|
|
|
requests:
|
2019-04-24 00:46:28 +03:00
|
|
|
cpu: "2"
|
|
|
|
memory: "4Gi"
|
2021-10-13 23:23:53 +03:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
namespace: prod
|
|
|
|
name: coordinator
|
|
|
|
spec:
|
|
|
|
ports:
|
|
|
|
- port: 80
|
|
|
|
targetPort: 80
|
|
|
|
name: http
|
|
|
|
- port: 443
|
|
|
|
targetPort: 443
|
|
|
|
name: https
|
|
|
|
- port: 2222
|
|
|
|
targetPort: 2222
|
|
|
|
name: ssh
|
|
|
|
selector:
|
|
|
|
app: coordinator
|
|
|
|
type: LoadBalancer
|
|
|
|
loadBalancerIP: 107.178.219.46
|
|
|
|
externalTrafficPolicy: Local
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
namespace: prod
|
|
|
|
name: coordinator-internal
|
|
|
|
spec:
|
|
|
|
ports:
|
|
|
|
- port: 80
|
|
|
|
targetPort: 80
|
|
|
|
name: http
|
|
|
|
selector:
|
|
|
|
app: coordinator
|
|
|
|
type: ClusterIP
|