1
- import { HARVESTER_KUBECONFIG_PATH , PREVIEW_K3S_KUBECONFIG_PATH } from "../jobs/build/const" ;
2
- import { exec } from "../util/shell" ;
3
- import { getGlobalWerftInstance } from "../util/werft" ;
1
+ import { HARVESTER_KUBECONFIG_PATH , PREVIEW_K3S_KUBECONFIG_PATH } from "../jobs/build/const" ;
2
+ import { exec } from "../util/shell" ;
3
+ import { getGlobalWerftInstance } from "../util/werft" ;
4
4
5
5
import * as Manifests from "./manifests" ;
6
6
import * as shell from "shelljs" ;
@@ -59,7 +59,7 @@ export function startVM(options: { name: string, cpu: number, memory: number })
59
59
cpu : options . cpu ,
60
60
memory : options . memory
61
61
} ) ,
62
- { validate : false } ,
62
+ { validate : false } ,
63
63
) ;
64
64
65
65
kubectlApplyManifest (
@@ -171,7 +171,7 @@ export function waitForVMReadiness(options: { name: string; timeoutSeconds: numb
171
171
const startTime = Date . now ( ) ;
172
172
const ready = exec (
173
173
`kubectl --kubeconfig ${ HARVESTER_KUBECONFIG_PATH } -n ${ namespace } wait --for=condition=ready --timeout=${ options . timeoutSeconds } s pod -l kubevirt.io=virt-launcher -l harvesterhci.io/vmName=${ options . name } ` ,
174
- { dontCheckRc : true , silent : true } ,
174
+ { dontCheckRc : true , silent : true } ,
175
175
) ;
176
176
177
177
if ( ready . code == 0 ) {
@@ -196,13 +196,13 @@ export function copyk3sKubeconfig(options: { name: string; timeoutMS: number; sl
196
196
while ( true ) {
197
197
const status = exec (
198
198
`ssh -i /workspace/.ssh/id_rsa_harvester_vm [email protected] -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 'sudo cat /etc/rancher/k3s/k3s.yaml' > ${ PREVIEW_K3S_KUBECONFIG_PATH } ` ,
199
- { silent : true , dontCheckRc : true , slice : options . slice } ,
199
+ { silent : true , dontCheckRc : true , slice : options . slice } ,
200
200
) ;
201
201
202
202
if ( status . code == 0 ) {
203
203
exec (
204
204
`kubectl --kubeconfig ${ PREVIEW_K3S_KUBECONFIG_PATH } config set clusters.default.server https://${ options . name } .kube.gitpod-dev.com:6443` ,
205
- { silent : true , slice : options . slice } ,
205
+ { silent : true , slice : options . slice } ,
206
206
) ;
207
207
return ;
208
208
}
@@ -215,7 +215,7 @@ export function copyk3sKubeconfig(options: { name: string; timeoutMS: number; sl
215
215
}
216
216
217
217
werft . log ( options . slice , `Wasn't able to copy out kubeconfig yet. Sleeping 5 seconds` ) ;
218
- exec ( "sleep 5" , { silent : true , slice : options . slice } ) ;
218
+ exec ( "sleep 5" , { silent : true , slice : options . slice } ) ;
219
219
}
220
220
}
221
221
@@ -244,7 +244,12 @@ export function stopKubectlPortForwards() {
244
244
*/
245
245
export function installRookCeph ( options : { kubeconfig : string } ) {
246
246
exec (
247
- `kubectl --kubeconfig ${ options . kubeconfig } apply -f .werft/vm/manifests/rook-ceph/crds.yaml -f .werft/vm/manifests/rook-ceph/common.yaml -f .werft/vm/manifests/rook-ceph/operator.yaml` ,
247
+ `kubectl --kubeconfig ${ options . kubeconfig } apply -f .werft/vm/manifests/rook-ceph/crds.yaml --server-side --force-conflicts`
248
+ ) ;
249
+ exec (
250
+ `kubectl --kubeconfig ${ options . kubeconfig } wait --for condition=established --timeout=120s crd/cephclusters.ceph.rook.io`
251
+ ) ;
252
+ exec ( `kubectl --kubeconfig ${ options . kubeconfig } apply -f .werft/vm/manifests/rook-ceph/common.yaml -f .werft/vm/manifests/rook-ceph/operator.yaml`
248
253
) ;
249
254
exec ( `kubectl --kubeconfig ${ options . kubeconfig } apply -f .werft/vm/manifests/rook-ceph/cluster-test.yaml` ) ;
250
255
exec ( `kubectl --kubeconfig ${ options . kubeconfig } apply -f .werft/vm/manifests/rook-ceph/storageclass-test.yaml` ) ;
@@ -257,15 +262,15 @@ export function installRookCeph(options: { kubeconfig: string }) {
257
262
export function installFluentBit ( options : { namespace : string ; kubeconfig : string ; slice : string } ) {
258
263
exec (
259
264
`kubectl --kubeconfig ${ options . kubeconfig } create secret generic fluent-bit-external --save-config --dry-run=client --from-file=credentials.json=/mnt/fluent-bit-external/credentials.json -o yaml | kubectl --kubeconfig ${ options . kubeconfig } apply -n ${ options . namespace } -f -` ,
260
- { slice : options . slice , dontCheckRc : true } ,
265
+ { slice : options . slice , dontCheckRc : true } ,
261
266
) ;
262
267
exec ( `helm3 --kubeconfig ${ options . kubeconfig } repo add fluent https://fluent.github.io/helm-charts` , {
263
268
slice : options . slice ,
264
269
dontCheckRc : true ,
265
270
} ) ;
266
- exec ( `helm3 --kubeconfig ${ options . kubeconfig } repo update` , { slice : options . slice , dontCheckRc : true } ) ;
271
+ exec ( `helm3 --kubeconfig ${ options . kubeconfig } repo update` , { slice : options . slice , dontCheckRc : true } ) ;
267
272
exec (
268
273
`helm3 --kubeconfig ${ options . kubeconfig } upgrade --install fluent-bit fluent/fluent-bit -n ${ options . namespace } -f .werft/vm/charts/fluentbit/values.yaml` ,
269
- { slice : options . slice , dontCheckRc : true } ,
274
+ { slice : options . slice , dontCheckRc : true } ,
270
275
) ;
271
276
}
0 commit comments