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
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type HostProcess struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HostProcessSpec `json:"spec,omitempty"`
Status HostProcessStatus `json:"status,omitempty"`
}
type HostProcessList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HostProcess `json:"items"`
}
type HostProcessRestartPolicy string
const (
HostProcessRestartNever HostProcessRestartPolicy = "Never"
HostProcessRestartOnFailure HostProcessRestartPolicy = "OnFailure"
HostProcessRestartAlways HostProcessRestartPolicy = "Always"
)
type HostProcessPlacement string
const (
HostProcessPlacementSupervisor HostProcessPlacement = "supervisor"
HostProcessPlacementBootstrap HostProcessPlacement = "bootstrap"
)
type HostProcessSpec struct {
Unit string `json:"unit"`
Description string `json:"description,omitempty"`
Asset *HostProcessAsset `json:"asset,omitempty"`
Exec string `json:"exec,omitempty"`
Argv []string `json:"argv,omitempty"`
Env []HostProcessEnv `json:"env,omitempty"`
EnvFiles []string `json:"envFiles,omitempty" apigen:"userEndpoint"`
WorkDir string `json:"workDir,omitempty"`
Output *HostProcessOutput `json:"output,omitempty"`
Limits *HostProcessLimits `json:"limits,omitempty"`
RestartPolicy HostProcessRestartPolicy `json:"restartPolicy,omitempty"`
Stop *HostProcessStop `json:"stop,omitempty"`
After []string `json:"after,omitempty"`
Wants []string `json:"wants,omitempty"`
Slice string `json:"slice,omitempty"`
PrivateHostname string `json:"privateHostname,omitempty"`
FdStore int32 `json:"fdStore,omitempty"`
Readiness *HostProcessReadiness `json:"readiness,omitempty"`
RestartKey string `json:"restartKey,omitempty"`
Placement HostProcessPlacement `json:"placement"`
}
type HostProcessAsset struct {
Name string `json:"name"`
Sha256 string `json:"sha256"`
}
type HostProcessEnv struct {
Name string `json:"name"`
Value string `json:"value"`
}
type HostProcessOutput struct {
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
CapBytes int64 `json:"capBytes,omitempty"`
}
type HostProcessLimits struct {
MemoryMax string `json:"memoryMax,omitempty"`
CpuWeight int64 `json:"cpuWeight,omitempty"`
CpuQuotaPercent int32 `json:"cpuQuotaPercent,omitempty"`
TasksMax int64 `json:"tasksMax,omitempty"`
}
type HostProcessStop struct {
Signal string `json:"signal,omitempty"`
GraceSeconds int32 `json:"graceSeconds,omitempty"`
}
type HostProcessReadiness struct {
Exec []string `json:"exec,omitempty"`
Tcp bool `json:"tcp,omitempty"`
HttpPath string `json:"httpPath,omitempty" apigen:"userEndpoint"`
PgxSocketDir string `json:"pgxSocketDir,omitempty"`
UnixSocket string `json:"unixSocket,omitempty"`
}
type HostProcessPhase string
const (
HostProcessPhasePending HostProcessPhase = "Pending"
HostProcessPhaseStarting HostProcessPhase = "Starting"
HostProcessPhaseRunning HostProcessPhase = "Running"
HostProcessPhaseStopping HostProcessPhase = "Stopping"
HostProcessPhaseStopped HostProcessPhase = "Stopped"
HostProcessPhaseFailed HostProcessPhase = "Failed"
HostProcessPhaseLost HostProcessPhase = "Lost"
)
type HostProcessLostReason string
const (
HostProcessLostHostRebooted HostProcessLostReason = "HostRebooted"
HostProcessLostUnitGone HostProcessLostReason = "UnitGone"
HostProcessLostUnitFailed HostProcessLostReason = "UnitFailed"
HostProcessLostOOMKilled HostProcessLostReason = "OOMKilled"
HostProcessLostIdentityMismatch HostProcessLostReason = "IdentityMismatch"
HostProcessLostManagerRestarted HostProcessLostReason = "ManagerRestarted"
)
type HostProcessStatus struct {
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Phase HostProcessPhase `json:"phase,omitempty"`
LostReason HostProcessLostReason `json:"lostReason,omitempty"`
Message string `json:"message,omitempty"`
Runtime *HostProcessRuntime `json:"runtime,omitempty"`
LastResult *HostProcessResult `json:"lastResult,omitempty"`
RestartKey string `json:"restartKey,omitempty"`
Listeners []HostProcessListener `json:"listeners,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
type HostProcessRuntime struct {
Backend string `json:"backend"`
Unit string `json:"unit"`
InvocationID string `json:"invocationID,omitempty"`
Pid int64 `json:"pid,omitempty"`
StartTicks int64 `json:"startTicks,omitempty"`
HostBootID string `json:"hostBootID,omitempty"`
Manager string `json:"manager,omitempty"`
ActiveSince string `json:"activeSince,omitempty"`
}
type HostProcessResult struct {
Result string `json:"result,omitempty"`
ExitCode int32 `json:"exitCode,omitempty"`
Signal string `json:"signal,omitempty"`
At string `json:"at,omitempty"`
}
type HostProcessListener struct {
Name string `json:"name"`
Address string `json:"address"`
}