forked from kubernetes-el/kubernetes-el
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes-vars.el
247 lines (184 loc) · 8.08 KB
/
kubernetes-vars.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
;;; kubernetes-vars.el --- Customizable interface for Kubernetes package. -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(defgroup kubernetes nil
"Emacs porcelain for Kubernetes."
:group 'tools
:prefix "kubernetes-")
(defcustom kubernetes-show-message t
"If non-nil, show log messages from `kubernetes-el'."
:group 'kubernetes
:type 'boolean)
(defcustom kubernetes-kubectl-timeout-seconds 25
"How long to wait for kubectl before giving up."
:group 'kubernetes
:type 'integer)
(defcustom kubernetes-default-proxy-port 8001
"Default port to run kubectl proxies on."
:group 'kubernetes
:type 'kubernetes--positive-int
:link '(url-link "https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#proxy"))
(defcustom kubernetes-kubectl-executable "kubectl"
"The kubectl command used for Kubernetes commands."
:group 'kubernetes
:type 'string)
(defconst kubernetes-overview-views-alist
'((overview . (context overview))
(configmaps . (context configmaps))
(deployments . (context deployments))
(statefulsets . (context statefulsets))
(ingress . (context ingress))
(jobs . (context jobs))
(pods . (context pods))
(secrets . (context secrets))
(services . (context services))
(nodes . (context nodes))
(persistentvolumeclaims . (context persistentvolumeclaims)))
"Enumerates the different views that can be displayed in the overview.
Each element is a cons-cell of the form (SYMBOL . LIST), where
SYMBOL is a name for the view, and LIST is a list of resource
types that should be displayed.")
(defcustom kubernetes-overview-custom-views-alist nil
"Enumerates the different views that can be displayed in the overview.
Each element is a cons-cell of the form (SYMBOL . LIST), where
SYMBOL is a name for the view, and LIST is a list of resource
types that should be displayed."
:group 'kubernetes
:type '(alist :key-type symbol
:value-type (set (const context)
(const configmaps)
(const deployments)
(const statefulsets)
(const ingress)
(const overview)
(const pods)
(const secrets)
(const services)
(const nodes)
(const persistentvolumeclaims))))
(defcustom kubernetes-default-overview-view 'overview
"The view to use when first opening the overview.
It should be one of the keys defined in
`kubernetes-overview-views-alist' or
`kubernetes-overview-custom-views-alist'."
:group 'kubernetes
:type 'symbol)
(defcustom kubernetes-default-overview-namespace nil
"The Kubernetes namespace to select on `kubernetes-overview'.
Uses the default namespace if nil."
:group 'kubernetes
:type 'string)
(defcustom kubernetes-commands-display-buffer-select t
"Whether to select Kubernetes buffers automatically."
:group 'kubernetes
:type 'boolean)
(defcustom kubernetes-commands-display-buffer-function 'kubernetes-commands-display-buffer-fullframe
"The function used display a Kubernetes buffer.
The function must take a single argument, which is the buffer to display."
:group 'kubernetes
:type '(radio (function-item kubernetes-commands-display-buffer-fullframe)
(function-item display-buffer)
(function :tag "Function")))
(defcustom kubernetes-pod-restart-warning-threshold 5
"The threshold for pod restarts above which a pod is highlighted."
:group 'kubernetes
:type 'number)
(defcustom kubernetes-poll-frequency 5
"The frequency in seconds at which to poll Kubernetes for changes."
:group 'kubernetes
:type 'integer)
(defcustom kubernetes-redraw-frequency 5
"The buffer redraw frequency in seconds.
This is the frequency at which Kubernetes buffers will be redrawn
to match the current state. This variable should be tuned to
balance interface stuttering with update frequency."
:group 'kubernetes
:type 'integer)
(defcustom kubernetes-json-mode 'javascript-mode
"The mode to use when rendering pretty-printed JSON."
:group 'kubernetes
:type 'function)
(defcustom kubernetes-default-exec-command "bash"
"The default command to use when exec'ing into a pod's container."
:group 'kubernetes
:type 'string)
(defcustom kubernetes-clean-up-interactive-exec-buffers t
"If non-nil, automatically kill interactive exec buffers on process exit."
:group 'kubernetes
:type 'boolean)
(defcustom kubernetes-minimum-error-display-time 10
"Minimum time in seconds for which errors will be displayed in overview buffer."
:group 'kubernetes
:type 'integer)
(defcustom kubernetes-kubectl-flags nil
"A list of extra commandline flags to pass to kubectl.
It is a list, where each element is assumed to be a flag of the
form \"--flag=value\" or \"-flag\"."
:type '(repeat (string :tag "Argument"))
:group 'kubernetes)
(defcustom kubernetes-pods-display-completed nil
"If non-nil, display completed pods."
:group 'kubernetes
:type 'boolean)
(defface kubernetes-dimmed
'((((class color) (background light)) :foreground "grey50")
(((class color) (background dark)) :foreground "grey50"))
"Face for text that shouldn't stand out."
:group 'kubernetes)
(defface kubernetes-context-name
'((((class color) (background light)) :foreground "SkyBlue4")
(((class color) (background dark)) :foreground "LightSkyBlue1"))
"Face for context names in report buffers."
:group 'kubernetes)
(defface kubernetes-json-key
'((((class color) (background light)) :foreground "grey30" :weight bold)
(((class color) (background dark)) :foreground "grey80" :weight bold))
"Face for keys in pretty-printed parsed JSON."
:group 'kubernetes)
(defface kubernetes-progress-indicator
'((t :inherit shadow))
"Face for progress indicators."
:group 'kubernetes)
(defface kubernetes-pending-deletion
'((t :inherit shadow :strike-through t))
"Face for pods awaiting deletion."
:group 'kubernetes)
(defface kubernetes-delete-mark
'((t :inherit error))
"Face for deletion mark indicators."
:group 'kubernetes)
(defface kubernetes-selector
'((t :foreground "DarkSeaGreen2"))
"Face for labels used as selectors."
:group 'kubernetes)
(defface kubernetes-namespace
'((t :foreground "LightGoldenrod2"))
"Face for namespace references."
:group 'kubernetes)
(defconst kubernetes-display-pods-buffer-name "*kubernetes pods*")
(defconst kubernetes-display-config-buffer-name "*kubernetes config*")
(defconst kubernetes-display-deployment-buffer-name "*kubernetes deployment*")
(defconst kubernetes-display-node-buffer-name "*kubernetes node*")
(defconst kubernetes-display-statefulset-buffer-name "*kubernetes statefulset*")
(defconst kubernetes-display-ingress-buffer-name "*kubernetes ingress*")
(defconst kubernetes-display-job-buffer-name "*kubernetes job*")
(defconst kubernetes-display-configmap-buffer-name "*kubernetes configmap*")
(defconst kubernetes-display-service-buffer-name "*kubernetes service*")
(defconst kubernetes-display-configmaps-buffer-name "*kubernetes configmaps*")
(defconst kubernetes-display-namespace-buffer-name "*kubernetes namespace*")
(defconst kubernetes-display-secret-buffer-name "*kubernetes secret*")
(defconst kubernetes-display-secrets-buffer-name "*kubernetes secrets*")
(defconst kubernetes-display-persistentvolumeclaim-buffer-name "*kubernetes persistentvolumeclaims*")
(defconst kubernetes-overview-buffer-name "*kubernetes overview*")
(defconst kubernetes-log-line-buffer-name "*log line*")
(defconst kubernetes-logs-buffer-name "*kubernetes logs*")
(defconst kubernetes-pod-buffer-name "*kubernetes pod*")
(defconst kubernetes-exec-buffer-name "*kubernetes exec*")
(defconst kubernetes-exec-vterm-buffer-name "*kubernetes exec vterm*")
(defconst kubernetes-label-query-buffer-name "*kubernetes-label-query*")
(defvar kubernetes-poll-hook nil
"Hook run every time polling should occur.")
(defvar kubernetes-redraw-hook nil
"Hook run every time redrawing should occur.")
(provide 'kubernetes-vars)
;;; kubernetes-vars.el ends here