forked from nuvolaris/nuvolaris-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TaskfileDev.yml
104 lines (87 loc) · 3.11 KB
/
TaskfileDev.yml
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
version: '3'
vars:
WHISK: '{{default "whisk" .WHISK}}'
CONFIG: "tests/{{.KUBE}}/{{.WHISK}}.yaml"
# taken from the tag
OPERATOR_TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || git rev-parse --short HEAD
# taken from the Dockerfile - ovveridable with MY_OPERATOR_IMAGE
OPERATOR_IMAGE:
sh: awk -F= '/ARG OPERATOR_IMAGE_DEFAULT=/ { print $2 ; exit }' Dockerfile
# taken from the Dockerfile
CONTROLLER_TAG:
sh: awk -F= '/ENV CONTROLLER_TAG=/ { print $2 ; exit }' Dockerfile
CONTROLLER_IMAGE:
sh: awk -F= '/ENV CONTROLLER_IMAGE=/ { print $2 ; exit }' Dockerfile
env:
APIHOST:
sh: kubectl config view -o json | jq -r '.clusters[0].cluster.server' | sed -e 's|^.*//\(.*\):.*$|\1|'
tasks:
env: env
cli: poetry run ipython -i profile.ipy
run:
cmds:
# note that the .env is loaded after the env pameters
- env OPERATOR_IMAGE="${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}" ./run.sh
env:
CONTROLLER_IMAGE: "{{.CONTROLLER_IMAGE}}"
CONTROLLER_TAG: "{{.CONTROLLER_TAG}}"
OPERATOR_TAG: "{{.OPERATOR_TAG}}"
instance:
- envsubst <{{.CONFIG}} | kubectl -n nuvolaris apply -f -
show:
- echo "*** {{.CONFIG}}"
- envsubst <{{.CONFIG}}
destroy: kubectl -n nuvolaris delete wsk/controller
couchdb:
- rm -f deploy/*/kustomization.yaml deploy/*/__*
- task: permission
- kubectl apply -f deploy/couchdb
couchdb-forward:
- kubectl -n nuvolaris port-forward svc/couchdb 5985:5984
mongodb:
- kubectl apply -f deploy/mongodb-operator
- kubectl apply -f deploy/mongodb
defin: >
kubectl -n nuvolaris patch wsk/controller --type=merge --patch '{"metadata": {"finalizers":[] } }'
defin2: kubectl -n nuvolaris get wsk/controller -o yaml | grep -v Final | kubectl apply -f -
killpy: ps auwwx | grep python | awk '{print $2}' | xargs kill -9
enter: kubectl exec -ti nuvolaris-operator -- bash
mount:
- |-
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: nuvolaris
spec:
containers:
- name: busybox
image: busybox
command: ["sleep", "inf"]
volumeMounts:
- name: mount
mountPath: "/mnt"
volumes:
- name: mount
persistentVolumeClaim:
claimName: nuvolaris/couchdb-pvc-couchdb-0
EOF