3
3
The ` kuberift ` server needs access to your cluster's API server and credentials
4
4
to connect to it. There are a couple ways to do this:
5
5
6
- - On cluster - you can run it on cluster. Check out the [ helm chart] [ helm-chart ]
7
- for an easy way to get started. By running it on cluster, you get access and
8
- credentials automatically. The server then needs to be exposed so that you can
9
- connect to it. This can be done by any TCP load balancer. If you're running in
10
- the cloud, setting the server's service to ` type: LoadBalancer ` is the
11
- easiest. Alternatives include using the [ gateway api] [ gateway-api ] or
12
- configuring your ingress controller to route TCP.
13
- - Off cluster - if you're already using jump hosts to get into your cluster,
14
- kuberift can run there. All you need to do is create a ` kubeconfig ` that uses
15
- the correct service account. There are [ some plugins] [ sa-plugin ] to make this
16
- easy. You'll still need a valid ` ClusterRole ` and ` ClusterRoleBinding ` setup.
17
- Take a look at the sample [ rbac] [ helm-rbac ] to see what do to there.
6
+ - [ On cluster] ( #on-cluster )
7
+ - [ Off cluster] ( #off-cluster )
18
8
19
9
[ gateway-api ] : https://gateway-api.sigs.k8s.io
20
10
[ helm-chart ] : #helm
21
11
[ sa-plugin] :
22
12
https://github.com/superbrothers/kubectl-view-serviceaccount-kubeconfig-plugin
23
13
[ helm-rbac ] : helm/templates/rbac.yaml
24
14
25
- ## Helm
15
+ ## Features
16
+
17
+ All the functionality is controlled via feature flags in the server:
18
+
19
+ - ` pty ` - Dashboard when ` ssh ` happens.
20
+ - ` sftp ` - Enables ` scp ` and ` sftp ` .
21
+ - ` ingress-tunnel ` - Provides ` ssh -L ` forwarding from a local port to the
22
+ cluster.
23
+ - ` egress-tunnel ` - Provides ` ssh -R ` forwarding from the cluster to a local
24
+ port.
25
+
26
+ ## Bring Your Own Provider
27
+
28
+ By default, kuberift provides Github and Google authentication via.
29
+ [ auth0] [ auth0 ] . To get your own setup using auth0, check out their
30
+ [ instructions] [ auth0-setup ] .
31
+
32
+ You can, alternatively, use your own provider. It must support the [ device
33
+ code] [ device-code ] flow and have a URL that has the openid configuration. Take a
34
+ look at the configuration for ` kuberift serve ` for the required values.
35
+
36
+ [ auth0 ] : https://auth0.com
37
+ [ auth0-setup] :
38
+ https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow/call-your-api-using-the-device-authorization-flow#prerequisites
39
+ [ device-code ] : https://www.oauth.com/oauth2-servers/device-flow/
40
+
41
+ ## On-Cluster
42
+
43
+ Check out the [ helm chart] [ helm-chart ] for an easy way to get started. If not
44
+ using helm, there are some things to be aware of:
45
+
46
+ - Credentials need to be mounted into the pod, see [ Server RBAC] ( #server-rbac )
47
+ for a minimal list of permissions.
48
+ - You need the pod to be reachable from where you're running ` ssh ` . This can be
49
+ done by any TCP load balancer. If you're running in the cloud, setting the
50
+ server's service to ` type: LoadBalancer ` is the easiest. Alternatives include
51
+ using the [ gateway api] [ gateway-api ] or configuring your ingress controller to
52
+ route TCP.
53
+
54
+ ### Helm
26
55
27
56
There is a provided ` getting-started.yaml ` set of values. To install this on
28
57
your cluster, you can run:
@@ -45,20 +74,21 @@ For more detailed instructions, take a look at the [README][helm-readme].
45
74
46
75
[ helm-readme ] : helm/README.md
47
76
48
- ## Bring Your Own Provider
77
+ ## Off-Cluster
49
78
50
- By default, kuberift provides Github and Google authentication via.
51
- [ auth0] [ auth0 ] . To get your own setup using auth0, check out their
52
- [ instructions] [ auth0-setup ] .
79
+ If you're already using jump hosts to get into your cluster, kuberift can run
80
+ there. Here are some things to be aware of:
53
81
54
- You can, alternatively, use your own provider. It must support the [ device
55
- code] [ device-code ] flow and have a URL that has the openid configuration. Take a
56
- look at the configuration for ` kuberift serve ` for the required values.
57
-
58
- [ auth0 ] : https://auth0.com
59
- [ auth0-setup] :
60
- https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow/call-your-api-using-the-device-authorization-flow#prerequisites
61
- [ device-code ] : https://www.oauth.com/oauth2-servers/device-flow/
82
+ - Provide credentials by creating a ` kubeconfig ` that uses the correct service
83
+ account. here are [ some plugins] [ sa-plugin ] to make this easy. You'll still
84
+ need a valid ` ClusterRole ` and ` ClusterRoleBinding ` setup. Take a look at the
85
+ sample [ rbac] [ helm-rbac ] to see what do to there.
86
+ - For ` ingress-tunnel ` support, you'll need to have the server running on a
87
+ network that can reach IP addresses in the cluster (nodes, pods) and can
88
+ resolve cluster DNS.
89
+ - For ` egress-tunnel ` support, you'll need to have the server itself reachable
90
+ from any pod in the cluster. In addition, make sure to configure ` --pod-name ` ,
91
+ ` --pod-uid ` and ` --pod-ip ` to some real values in the ` serve ` command.
62
92
63
93
## Server RBAC
64
94
@@ -68,38 +98,23 @@ The kuberift server needs to be able to:
68
98
- Manage ` keys ` .
69
99
- Optionally update the CRDs.
70
100
71
- To do the minimum of this, you can use the following ` ClusterRole ` + ` Role ` . For
72
- a more in-depth example, take a look at the
73
- [ helm config] ( helm/templates/rbac.yaml ) .
101
+ To do the minimum of this, you can use the following ` ClusterRole ` . For a more
102
+ in-depth example, take a look at the [ helm config] ( helm/templates/rbac.yaml ) .
74
103
75
104
``` yaml
76
105
apiVersion : rbac.authorization.k8s.io/v1
77
106
kind : ClusterRole
78
107
metadata :
79
108
name : impersonator
80
109
rules :
81
- - apiGroups :
82
- - ' '
110
+ - apiGroups : ['']
83
111
resources :
84
112
- users
85
113
- groups
86
114
verbs :
87
- - ' impersonate'
115
+ - impersonate
88
116
# Restrict the groups/users that can be impersonated through kuberift.
89
117
# resourceNames:
90
118
# - foo@bar.com
91
119
# - my_group
92
- ---
93
- apiVersion : rbac.authorization.k8s.io/v1
94
- kind : Role
95
- metadata :
96
- name : kuberift
97
- rules :
98
- - apiGroups :
99
- - ' key.kuberift.com'
100
- resources :
101
- - keys
102
- verbs :
103
- - ' *'
104
- ---
105
120
```
0 commit comments