@@ -24,6 +24,7 @@ A simple static analysis tool to explore a Kubernetes cluster.
24
24
## Main features
25
25
26
26
The left part of the screen contains the controls for the main view:
27
+
27
28
- View: choose your view
28
29
- Workloads: deployments, controllers, pods, services, ingresses... and how they interact with each other
29
30
- Network policies: network routes allowed between pods, based on network policy declarations
@@ -32,75 +33,88 @@ The left part of the screen contains the controls for the main view:
32
33
- by pod namespace
33
34
- by pod labels
34
35
- by pod name
35
- - \[ Network policies view only\] Include ingress neighbors: also display pods that can reach those in the current selection
36
- - \[ Network policies view only\] Include egress neighbors: also display pods that can be reached by those in the current selection
36
+ - \[ Network policies view only\] Include ingress neighbors: also display pods that can reach those in the current
37
+ selection
38
+ - \[ Network policies view only\] Include egress neighbors: also display pods that can be reached by those in the
39
+ current selection
37
40
- Display options: customize how items are displayed
38
41
- Auto-refresh: automatically refresh the view every 2 seconds
39
42
- Auto-zoom: automatically resize the view to fit all the elements to display
40
43
- Show namespace prefix: add the namespace to the name of the displayed items
41
- - Always display large datasets: try to render the data even if the number of item is high (may slow down your browser)
44
+ - Always display large datasets: try to render the data even if the number of item is high (may slow down your
45
+ browser)
42
46
- \[ Network policies view only\] Highlight non isolated pods (ingress): color pods with no ingress network policy
43
47
- \[ Network policies view only\] Highlight non isolated pods (egress): color pods with no egress network policy
44
48
- \[ Health view only\] Highlight pods with container not running: color pods with at least one container not running
45
49
- \[ Health view only\] Highlight pods with container not ready: color pods with at least one container not ready
46
- - \[ Health view only\] Highlight pods with container restarted: color pods with at least one container which restarted
50
+ - \[ Health view only\] Highlight pods with container restarted: color pods with at least one container which
51
+ restarted
47
52
48
53
The main view shows the graph or list of items, depending on the selected view, filters and display options:
54
+
49
55
- Zoom in and out by scrolling
50
56
- Drag and drop graph elements to draw the perfect map of your cluster
51
57
- Hover over any graph element to display details: name, namespace, labels, isolation (ingress/egress)... and more!
52
58
53
59
In the top left part of the screen you will find action buttons to:
54
- - Export the current graph as PNG to use it in slides or share it
60
+
61
+ - Export the current graph as PNG to use it in slides or share it
55
62
- Go fullscreen and use Karto as an office (or situation room) dashboard!
56
63
57
64
## Installation
58
65
59
66
There are two ways to install and run Karto:
60
- - To deploy it inside the Kubernetes cluster to analyze, proceed to the
61
- [ Run inside a cluster] ( #run-inside-a-cluster ) section.
62
- - To run it on any machine outside the Kubernetes cluster to analyze, refer to the
63
- [ Run outside a cluster] ( #run-outside-a-cluster ) section.
67
+
68
+ - To deploy it inside the Kubernetes cluster to analyze, proceed to the
69
+ [ Run inside a cluster] ( #run-inside-a-cluster ) section.
70
+ - To run it on any machine outside the Kubernetes cluster to analyze, refer to the
71
+ [ Run outside a cluster] ( #run-outside-a-cluster ) section.
64
72
65
73
### Run inside a cluster
66
74
67
75
#### Deployment
68
76
69
77
Simply apply the provided descriptor:
78
+
70
79
``` shell script
71
80
kubectl apply -f deploy/k8s.yml
72
81
```
82
+
73
83
This will:
84
+
74
85
- create a ` karto ` namespace
75
- - create a ` karto ` service account with a role allowing to watch the resources displayed by Karto (namespaces, pods,
86
+ - create a ` karto ` service account with a role allowing to watch the resources displayed by Karto (namespaces, pods,
76
87
network policies, services, deployments...)
77
88
- deploy an instance of the application in this namespace with this service account
78
89
79
90
#### Exposition
80
91
81
92
Once deployed, the application must be exposed. For a quick try, use ` port-forward ` :
93
+
82
94
``` shell script
83
95
kubectl -n karto port-forward < pod name> 8000:8000
84
96
```
97
+
85
98
The will exposed the app on your local machine on ` localhost:8000 ` .
86
99
87
100
For a long-term solution, investigate the use of a [ LoadBalancer service] (
88
101
https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types ) or an [ Ingress] (
89
102
https://kubernetes.io/docs/concepts/services-networking/ingress/ ).
90
103
91
- * Remember to always secure the access to the application as it obviously displays sensitive data about your cluster.*
104
+ * Remember to always secure the access to the application as it obviously displays sensitive data about your cluster.*
92
105
93
106
#### Cleanup
94
107
95
108
Delete everything using the same descriptor:
109
+
96
110
``` shell script
97
111
kubectl delete -f deploy/k8s.yml
98
112
```
99
113
100
114
### Run outside a cluster
101
115
102
116
For this to work, a local ` kubeconfig ` file with existing connection information to the target cluster must be present
103
- on the machine (if you already use ` kubectl ` locally, you are good to go!).
117
+ on the machine (if you already use ` kubectl ` locally, you are good to go!).
104
118
105
119
Simply download the Karto binary from the [ releases page] ( https://github.com/Zenika/karto/releases ) and run it!
106
120
@@ -109,28 +123,33 @@ Simply download the Karto binary from the [releases page](https://github.com/Zen
109
123
### Prerequisites
110
124
111
125
The following tools must be available locally:
112
- - [ Go] ( https://golang.org/doc/install ) (tested with Go 1.17)
113
- - [ NodeJS] ( https://nodejs.org/en/download/ ) (tested with NodeJS 14)
126
+
127
+ - [ Go] ( https://golang.org/doc/install ) (tested with Go 1.18)
128
+ - [ NodeJS] ( https://nodejs.org/en/download/ ) (tested with NodeJS 16)
114
129
115
130
### Run the frontend in dev mode
116
131
117
132
In the ` front ` directory, execute:
133
+
118
134
``` shell script
119
135
yarn start
120
136
```
137
+
121
138
This will expose the app in dev mode on ` localhost:3000 ` with a proxy to ` localhost:8000 ` for the API calls.
122
139
123
140
### Run the backend locally
124
141
125
- In the ` back ` directory, execute:
142
+ In the ` back ` directory, execute:
143
+
126
144
``` shell script
127
145
go build karto
128
146
./karto
129
147
```
130
148
131
149
### Test suites
132
150
133
- To run the entire backend test suite, execute in the ` back ` directory:
151
+ To run the entire backend test suite, execute in the ` back ` directory:
152
+
134
153
``` shell script
135
154
go test ./...
136
155
```
@@ -141,17 +160,21 @@ In production mode, the frontend is packaged in the go binary using [embed](http
141
160
configuration, the frontend is served on the ` / ` route and the API on the ` /api ` route.
142
161
143
162
To compile the Karto binary from source, first compile the frontend source code. In the ` front ` directory, execute:
163
+
144
164
``` shell script
145
165
yarn build
146
166
```
167
+
147
168
This will generate a ` build ` directory in ` front ` .
148
169
149
170
Then, make a copy in a directory visible by the backend module:
171
+
150
172
``` shell script
151
173
cp -R front/build/* back/exposition/frontend
152
174
```
153
175
154
176
Finally, compile the go binary in the ` back ` directory:
177
+
155
178
``` shell script
156
179
go build karto
157
180
```
0 commit comments