Skip to content

Commit

Permalink
Allow to customize cheHost (#380)
Browse files Browse the repository at this point in the history
* Allow to customize cheHost

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Aug 12, 2020
1 parent bd8679d commit bcf77d4
Show file tree
Hide file tree
Showing 29 changed files with 2,343 additions and 176 deletions.
19 changes: 15 additions & 4 deletions .ci/cico_minishift_nightly.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ init() {
export SCRIPT_DIR=$(dirname "$SCRIPT")
export RAM_MEMORY=8192
export NAMESPACE="che"
export OPERATOR_IMAGE="quay.io/eclipse/che-operator:test"
export PLATFORM="openshift"

if [[ ${WORKSPACE} ]] && [[ -d ${WORKSPACE} ]]; then
Expand Down Expand Up @@ -63,14 +64,24 @@ run() {
spec:
auth:
updateAdminPassword: false
openShiftoAuth: false
EOL

self_signed_minishift


# Build operator image
buildCheOperatorImage "minishift" ${OPERATOR_IMAGE}

# Use custom changes, don't pull image from quay.io
cat ${OPERATOR_REPO}/deploy/operator.yaml | \
sed 's|imagePullPolicy: Always|imagePullPolicy: IfNotPresent|' | \
sed 's|quay.io/eclipse/che-operator:nightly|'${OPERATOR_IMAGE}'|' | \
oc apply -n ${NAMESPACE} -f -

echo "======= Che cr patch ======="
cat /tmp/che-cr-patch.yaml
chectl server:start --platform=minishift --skip-kubernetes-health-check --installer=operator --chenamespace=${NAMESPACE} --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml
cat /tmp/che-cr-patch.yaml
chectl server:start --platform=minishift --skip-kubernetes-health-check --installer=operator --chenamespace=${NAMESPACE} --che-operator-cr-patch-yaml=/tmp/che-cr-patch.yaml --che-operator-image ${OPERATOR_IMAGE}

# Create and start a workspace
getCheAcessToken # Function from ./util/ci_common.sh
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml
Expand Down
8 changes: 6 additions & 2 deletions .ci/cico_olm_minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export CHANNEL
NAMESPACE="che"
export NAMESPACE

# Operator image
OPERATOR_IMAGE="quay.io/eclipse/che-operator:nightly"
export OPERATOR_IMAGE

# run function run the tests in ci of custom catalog source.
function run() {
# Execute test catalog source script
Expand All @@ -45,8 +49,8 @@ function run() {

# Create and start a workspace
getCheAcessToken
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml

getCheAcessToken
chectl workspace:list
waitWorkspaceStart
Expand Down
6 changes: 3 additions & 3 deletions .ci/cico_olm_openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ function run() {

source "${OPERATOR_REPO}"/.ci/util/ci_common.sh
oc project ${NAMESPACE}

# Create and start a workspace
getCheAcessToken
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml

getCheAcessToken
chectl workspace:list
waitWorkspaceStart
Expand Down
3 changes: 3 additions & 0 deletions .ci/cico_updates_minishift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ installLatestCheStable() {
sed -i "s/pluginRegistryImage: ''/pluginRegistryImage: quay.io\/eclipse\/che-plugin-registry:"${previousPackageVersion}"/" ${OPERATOR_REPO}/tmp/che-operator/crds/org_v1_che_cr.yaml
sed -i "s/identityProviderImage: ''/identityProviderImage: quay.io\/eclipse\/che-keycloak:"${previousPackageVersion}"/" ${OPERATOR_REPO}/tmp/che-operator/crds/org_v1_che_cr.yaml

# set 'openShiftoAuth: false'
sed -i "s/openShiftoAuth: .*/openShiftoAuth: false/" ${OPERATOR_REPO}/tmp/che-operator/crds/org_v1_che_cr.yaml

# Start last stable version of che
chectl server:start --platform=minishift --skip-kubernetes-health-check --che-operator-cr-yaml=${OPERATOR_REPO}/tmp/che-operator/crds/org_v1_che_cr.yaml \
--che-operator-image=quay.io/eclipse/che-operator:${previousPackageVersion} --installer=operator
Expand Down
12 changes: 6 additions & 6 deletions .ci/util/ci_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ installStartDocker() {
printInfo "Installing docker..."
yum install --assumeyes -d1 yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

printInfo "Starting docker service..."
yum install --assumeyes -d1 docker-ce
systemctl start docker
Expand Down Expand Up @@ -86,8 +86,8 @@ buildCheOperatorImage() {
if [ -z "${1}" ]; then
printError "Platform is required to build che operator image."
fi
PLATFORM="${1}"
OPERATOR_IMAGE="quay.io/eclipse/che-operator:nightly"
local PLATFORM="${1}"
local OPERATOR_IMAGE=${2:-"quay.io/eclipse/che-operator:nightly"}
cd "$OPERATOR_REPO" && docker build -t "${OPERATOR_IMAGE}" -f Dockerfile . && docker save "${OPERATOR_IMAGE}" > operator.tar
eval $(${PLATFORM} docker-env) && docker load -i operator.tar && rm operator.tar
}
Expand All @@ -98,7 +98,7 @@ minishift_installation() {
if [ ! -d "$OPERATOR_REPO/tmp" ]; then mkdir -p "$OPERATOR_REPO/tmp" && chmod 777 "$OPERATOR_REPO/tmp"; fi
curl -L https://github.com/minishift/minishift/releases/download/v$MSFT_RELEASE/minishift-$MSFT_RELEASE-linux-amd64.tgz \
-o ${OPERATOR_REPO}/tmp/minishift-$MSFT_RELEASE-linux-amd64.tar && tar -xvf ${OPERATOR_REPO}/tmp/minishift-$MSFT_RELEASE-linux-amd64.tar -C /usr/local/bin --strip-components=1

printInfo "Setting github token and start a new minishift VM."
github_token_set
minishift start --memory=8192 && eval $(minishift oc-env)
Expand All @@ -115,14 +115,14 @@ generate_self_signed_certs() {
-out cert.pem \
-days 365 \
-subj "/CN=*.${IP_ADDRESS}.nip.io" \
-nodes && cat cert.pem key.pem > ca.crt
-nodes && cat cert.pem key.pem > ca.crt
}

installEpelRelease() {
if yum repolist | grep epel; then
printWarn "Epel already installed, skipping instalation."
else
#excluding mirror1.ci.centos.org
#excluding mirror1.ci.centos.org
printInfo "Installing epel..."
yum install -d1 --assumeyes epel-release
yum update --assumeyes -d1
Expand Down
13 changes: 9 additions & 4 deletions deploy/crds/org_v1_che_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,17 @@ spec:
cheFlavor:
description: Flavor of the installation. This is either `che` for
upstream Che installations, or `codeready` for CodeReady Workspaces
installation. In most cases the default value should not be overriden.
installation. In most cases the default value should not be overridden.
type: string
cheHost:
description: Public hostname of the installed Che server. This will
be automatically set by the operator. In most cases the default
value set by the operator should not be overriden.
description: Public hostname of the installed Che server. If value
is omitted then it will be automatically set by the operator.
(see the `cheHostTLSSecret` field).
type: string
cheHostTLSSecret:
description: Name of a secret containing certificates to secure
ingress/route for the custom hostname of the installed Che server.
(see the `cheHost` field).
type: string
cheImage:
description: Overrides the container image used in Che deployment.
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- name: RELATED_IMAGE_devfile_registry
value: quay.io/eclipse/che-devfile-registry:nightly
- name: RELATED_IMAGE_che_tls_secrets_creation_job
value: quay.io/eclipse/che-tls-secret-creator:alpine-3029769
value: quay.io/eclipse/che-tls-secret-creator:alpine-d1ed4ad
- name: RELATED_IMAGE_pvc_jobs
value: registry.access.redhat.com/ubi8-minimal:8.2-345
- name: RELATED_IMAGE_postgres
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
- name: RELATED_IMAGE_devfile_registry
value: quay.io/eclipse/che-devfile-registry:nightly
- name: RELATED_IMAGE_che_tls_secrets_creation_job
value: quay.io/eclipse/che-tls-secret-creator:alpine-3029769
value: quay.io/eclipse/che-tls-secret-creator:alpine-d1ed4ad
- name: RELATED_IMAGE_pvc_jobs
value: registry.access.redhat.com/ubi8-minimal:8.2-345
- name: RELATED_IMAGE_postgres
Expand Down
1 change: 1 addition & 0 deletions deploy/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ rules:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- '*'
- apiGroups:
Expand Down
Loading

0 comments on commit bcf77d4

Please sign in to comment.