forked from cloudfoundry-incubator/quarks-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev-env-kind.yaml
104 lines (92 loc) · 3.23 KB
/
dev-env-kind.yaml
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
#
#
# The dev-env-kind.yaml packs a development flow
# for running cf-operator + quarks-job
# into a single configuration file.
# This flow involves:
# - compiling a binary
# - building a Docker img using the above binary
# - Installing a helm chart using the above docker img
#
#
# To download the latest havener, please refer to https://github.com/homeport/havener,
# or trigger the following cmd:
# curl -sL https://raw.githubusercontent.com/homeport/havener/master/scripts/download-latest.sh | bash
#
#
# To install the charts, run it as follows:
#
# havener deploy --config dev-env-kind.yaml
#
# Make sure:
#
# - You have created a kind cluster named "kubecf", e.g.:
# `kind create cluster --name=kubecf`
#
# - You can make use of the following:
#
# kubectl create serviceaccount --namespace kube-system tiller
# kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
# kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
#
name: cf-operator-quarks
releases:
- name: cf-operator
namespace: cfo
location: helm/cf-operator/
overrides:
image:
tag: (( env DOCKER_IMAGE_TAG ))
repository: (( env DOCKER_REPOSITORY ))
org: (( env DOCKER_ORGANIZATION ))
customResources:
enableInstallation: (( env CRDS_ENABLED ))
env:
DOCKER_IMAGE_TAG: (( shell . bin/include/versioning && echo "${ARTIFACT_VERSION}" ))
DOCKER_REPOSITORY: cf-operator
DOCKER_ORGANIZATION: cfcontainerization
CRDS_ENABLED: false
GO111MODULE: (( shell echo "${GO111MODULE}" ))
before:
- cmd: /bin/bash
args:
- -c
- |
#!/bin/bash
set -euo -x pipefail
# SOME VALIDATIONS FOR BINARIES
set +e
helm version > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "PLEASE INSTALL HELM."; exit 1
fi
set -e
# SET REQUIRED ENVIRONMENT VARIABLES
export GO111MODULE=${GO111MODULE:-on}
# BUILD CF-OPERATOR IMG
./bin/build-image
./bin/build-helm
. bin/include/versioning
. bin/include/docker
echo "cf-operator docker image is ${DOCKER_IMAGE_ORG}/${DOCKER_IMAGE_REPOSITORY}:${ARTIFACT_VERSION}"
kind load docker-image "${DOCKER_IMAGE_ORG}/${DOCKER_IMAGE_REPOSITORY}:${ARTIFACT_VERSION}" --loglevel debug
# CLEANUP RESOURCES
export RELEASE_NAMESPACE="cfo"
kubectl -n "${RELEASE_NAMESPACE}" delete mutatingwebhookconfiguration cf-operator-hook-${RELEASE_NAMESPACE} --ignore-not-found=true
kubectl -n "${RELEASE_NAMESPACE}" delete validatingwebhookconfiguration cf-operator-hook-${RELEASE_NAMESPACE} --ignore-not-found=true
kubectl -n "${RELEASE_NAMESPACE}" delete secret cf-operator-webhook-server-cert --ignore-not-found=true
after:
- cmd: /bin/bash
args:
- -c
- |
#!/bin/bash
export RELEASE_NAMESPACE="cfo"
echo -e "\nCurrent generated mutating webhooks"
kubectl -n "${RELEASE_NAMESPACE}" get mutatingwebhookconfigurations
echo -e "\nCurrent generated validation webhooks"
kubectl -n "${RELEASE_NAMESPACE}" get validatingwebhookconfigurations
echo -e "\nCurrent generated CRDs webhooks"
kubectl -n "${RELEASE_NAMESPACE}" get customresourcedefinitions
echo -e "\nCurrent pods"
kubectl -n "${RELEASE_NAMESPACE}" get pods