Skip to content

Commit

Permalink
Merge pull request kabanero-io#273 from dacleyra/262
Browse files Browse the repository at this point in the history
262
  • Loading branch information
kaczyns authored Oct 31, 2019
2 parents 5c1dcc0 + 297be29 commit 30acd0e
Show file tree
Hide file tree
Showing 6 changed files with 625 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ deploy:
- provider: releases
api_key:
secure: "oYX+vkYZbMPD6ZrTfgpgG0Hxug9jUP6ogVEEOQJnRw+eU7qUAfZT2pyl7fLwfMVUAum/Gp/uWRXYbohCxtyV18VIjBMbM4lsTrWSrggzq6JlMOd/J8Fx/BkWHDFQ0nx4MlDL8BdJbhUjrSleOKp8mW+yJhxuaq1z87svjZ6jxZeaGRTo5jxBcAmATB+VOKUm0z7cxoZC1p0IyQYhAPEVJ2GQd2/jDhRCJvTp99WTgg5PmUA350rSIObzB1Tf+o+gmUCl+Yi3fE1ITTeGU/lam0CXGGMZnDJVeDg6NGmP2f9hbYGyb5yim2xQoIUOgB21XNRRFydhTZaNy4saHaay5EL4KFDvDZ5CLBEr0y9GF9ODi2hNZ1QmlQ6S+HSQ8KXAKNC1kEYnF2N5f7uakEBtwvr4Y+1AtCFSc9bjPlgy3uGWGgTCjy/swchf8fMp56SmocLHII4enj5ESTGvn2t8efjCq13/sGZJSOKrQ+1CLUlPyG+zi/O456umMBx203rFRaNMkb+aZFFt/nQNzF/kSXegfpV9x70bZPQvqWbZ30jZX7UxaxGef/f+IjDPYvz8aEKA0HZH7goEQfFOZ8NAakZEPyd+I82yQJykAYsXHTMgiAj1VUetQCNqvKUtWp2aG0FtYiTo3uO1f/efq9+Ah8TJcCwyNcUCspScc8owOtI="
file: "deploy/kabanero-operators.yaml"
file:
- "deploy/kabanero-subscriptions.yaml"
- "deploy/kabanero-customresources.yaml"
- "deploy/install.sh"
- "deploy/uninstall.sh"
skip_cleanup: true
on:
repo: kabanero-io/kabanero-operator
Expand Down
14 changes: 5 additions & 9 deletions .travis/prepare_release.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/bin/bash
BASEPATH=$(dirname $(dirname $0))

# Split the IMAGE variable into repository and tag parts
# e.g. kabanero/kabanero-operator:0.1.1 -> kabanero/kabanero-operator
IFS=’:’ read -ra REPOSITORY <<< "$IMAGE"
# Split the REGISTRY_IMAGE variable into repository and tag parts
# e.g. kabanero/kabanero-operator-registry:0.3.0 -> kabanero/kabanero-operator-registry
IFS=’:’ read -ra REPOSITORY <<< "$REGISTRY_IMAGE"

# Levearge the gen_operator_deployment.sh script to generate deploy/kabanero-operators.yaml
$BASEPATH/contrib/gen_operator_deployment.sh $REPOSITORY:$TRAVIS_TAG

# Assure pull policies are set
sed -i.bak -e 's!imagePullPolicy: .*$!imagePullPolicy: Always!' deploy/kabanero-operators.yaml
# Set the tag for the kabanero CatalogSource
sed -i.bak -e "s,kabanero/kabanero-operator-registry:latest,kabanero/kabanero-operator-registry:$TRAVIS_TAG," deploy/kabanero-subscriptions.yaml
165 changes: 165 additions & 0 deletions deploy/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
#!/bin/bash

set -Eeox pipefail

RELEASE="${RELEASE:-0.3.0}"
KABANERO_SUBSCRIPTIONS_YAML="${KABANERO_SUBSCRIPTIONS_YAML:-https://github.com/kabanero-io/kabanero-operator/releases/download/$RELEASE/kabanero-subscriptions.yaml}"
KABANERO_CUSTOMRESOURCES_YAML="${KABANERO_CUSTOMRESOURCES_YAML:-https://github.com/kabanero-io/kabanero-operator/releases/download/$RELEASE/kabanero-customresources.yaml}"
SLEEP_LONG="${SLEEP_LONG:-5}"
SLEEP_SHORT="${SLEEP_SHORT:-2}"

# Check Subscriptions: subscription-name, namespace
checksub () {
echo "Waiting for Subscription $1 InstallPlan to complete."

# Wait for the InstallPlan to be generated and available on status
unset INSTALL_PLAN
until oc get subscription $1 -n $2 --output=jsonpath={.status.installPlanRef.name}
do
sleep $SLEEP_SHORT
done

# Get the InstallPlan
until [ -n "$INSTALL_PLAN" ]
do
sleep $SLEEP_SHORT
INSTALL_PLAN=$(oc get subscription $1 -n $2 --output=jsonpath={.status.installPlanRef.name})
done

# Wait for the InstallPlan to Complete
unset PHASE
until [ "$PHASE" == "Complete" ]
do
PHASE=$(oc get installplan $INSTALL_PLAN -n $2 --output=jsonpath={.status.phase})
sleep $SLEEP_SHORT
done

# Get installed CluserServiceVersion
unset CSV
until [ -n "$CSV" ]
do
sleep $SLEEP_SHORT
CSV=$(oc get subscription $1 -n $2 --output=jsonpath={.status.installedCSV})
done

# Wait for the CSV
unset PHASE
until [ "$PHASE" == "Succeeded" ]
do
PHASE=$(oc get clusterserviceversion $CSV -n $2 --output=jsonpath={.status.phase})
sleep $SLEEP_SHORT
done
}

### CatalogSource

# Install Kabanero CatalogSource
oc apply -f $KABANERO_SUBSCRIPTIONS_YAML --selector kabanero.io/install=00-catalogsource

# Check the CatalogSource is ready
unset LASTOBSERVEDSTATE
until [ "$LASTOBSERVEDSTATE" == "READY" ]
do
echo "Waiting for CatalogSource kabanero-catalog to be ready."
LASTOBSERVEDSTATE=$(oc get catalogsource kabanero-catalog -n openshift-marketplace --output=jsonpath={.status.connectionState.lastObservedState})
sleep $SLEEP_SHORT
done

### Subscriptions

# Install 10-subscription (elasticsearch, jaeger, kiali)
oc apply -f $KABANERO_SUBSCRIPTIONS_YAML --selector kabanero.io/install=10-subscription

# Verify Subscriptions
checksub elasticsearch-operator openshift-operators
checksub jaeger-product openshift-operators
checksub kiali-ossm openshift-operators

# Install 11-subscription (servicemesh)
oc apply -f $KABANERO_SUBSCRIPTIONS_YAML --selector kabanero.io/install=11-subscription

# Verify Subscriptions
checksub servicemeshoperator openshift-operators

# Install 12-subscription (eventing, serving)
oc apply -f $KABANERO_SUBSCRIPTIONS_YAML --selector kabanero.io/install=12-subscription

# Verify Subscriptions
checksub knative-eventing-operator-alpha-community-operators-openshift-marketplace openshift-operators
checksub serverless-operator openshift-operators

# Install 13-subscription (pipelines, appsody)
oc apply -f $KABANERO_SUBSCRIPTIONS_YAML --selector kabanero.io/install=13-subscription

# Verify Subscriptions
checksub openshift-pipelines-operator-dev-preview-community-operators-openshift-marketplace openshift-operators
checksub appsody-operator-certified-beta-certified-operators-openshift-marketplace openshift-operators

# Install 14-subscription (che, kabanero)
oc apply -f $KABANERO_SUBSCRIPTIONS_YAML --selector kabanero.io/install=14-subscription

# Verify Subscriptions
checksub eclipse-che kabanero
checksub kabanero-operator kabanero


### CustomResources

# ServiceMeshControlplane
oc apply -f $KABANERO_CUSTOMRESOURCES_YAML --selector kabanero.io/install=20-cr-servicemeshcontrolplane

# Check the ServiceMeshControlPlane is ready, last condition should reflect readiness
unset STATUS
unset TYPE
until [ "$STATUS" == "True" ] && [ "$TYPE" == "Ready" ]
do
echo "Waiting for ServiceMeshControlPlane basic-install to be ready."
TYPE=$(oc get servicemeshcontrolplane -n istio-system basic-install --output=jsonpath={.status.conditions[-1:].type})
STATUS=$(oc get servicemeshcontrolplane -n istio-system basic-install --output=jsonpath={.status.conditions[-1:].status})
sleep $SLEEP_SHORT
done

# ServiceMeshMemberRole
oc apply -f $KABANERO_CUSTOMRESOURCES_YAML --selector kabanero.io/install=21-cr-servicemeshmemberrole

# Serving
oc apply -f $KABANERO_CUSTOMRESOURCES_YAML --selector kabanero.io/install=22-cr-knative-serving

# Check the KnativeServing is ready, last condition should reflect readiness
unset STATUS
unset TYPE
until [ "$STATUS" == "True" ] && [ "$TYPE" == "Ready" ]
do
echo "Waiting for KnativeServing knative-serving to be ready."
TYPE=$(oc get knativeserving knative-serving -n knative-serving --output=jsonpath={.status.conditions[-1:].type})
STATUS=$(oc get knativeserving knative-serving -n knative-serving --output=jsonpath={.status.conditions[-1:].status})
sleep $SLEEP_SHORT
done

# Kabanero
oc apply -f $KABANERO_CUSTOMRESOURCES_YAML --selector kabanero.io/install=23-cr-kabanero

# Check the Kabanero is ready
unset READY
until [ "$READY" == "True" ]
do
echo "Waiting for Kabanero kabanero to be ready."
READY=$(oc get kabanero kabanero -n kabanero --output=jsonpath={.status.kabaneroInstance.ready})
sleep $SLEEP_SHORT
done


# Github Sources
oc apply -f https://github.com/knative/eventing-contrib/releases/download/v0.9.0/github.yaml

# Need to wait for knative serving CRDs before installing tekton webhook extension
until oc get crd services.serving.knative.dev
do
echo "Waiting for CustomResourceDefinition services.serving.knative.dev to be ready."
sleep $SLEEP_SHORT
done

# Tekton Dashboard
oc new-project tekton-pipelines || true
oc apply -f https://github.com/tektoncd/dashboard/releases/download/v0.2.0/openshift-webhooks-extension.yaml
oc apply -f https://github.com/tektoncd/dashboard/releases/download/v0.2.0/openshift-tekton-dashboard.yaml
111 changes: 111 additions & 0 deletions deploy/kabanero-customresources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
apiVersion: v1
kind: Namespace
metadata:
name: istio-system
labels:
kabanero.io/install: 20-cr-servicemeshcontrolplane
kabanero.io/namespace: 'true'
---
apiVersion: maistra.io/v1
kind: ServiceMeshControlPlane
metadata:
name: basic-install
namespace: istio-system
labels:
kabanero.io/install: 20-cr-servicemeshcontrolplane
spec:
istio:
global:
multitenant: true
proxy:
autoInject: disabled
omitSidecarInjectorConfigMap: true
disablePolicyChecks: false
defaultPodDisruptionBudget:
enabled: false
istio_cni:
enabled: true
gateways:
istio-ingressgateway:
autoscaleEnabled: false
type: LoadBalancer
istio-egressgateway:
enabled: false
cluster-local-gateway:
autoscaleEnabled: false
enabled: true
labels:
app: cluster-local-gateway
istio: cluster-local-gateway
ports:
- name: status-port
port: 15020
- name: http2
port: 80
targetPort: 8080
- name: https
port: 443
mixer:
enabled: false
policy:
enabled: false
telemetry:
enabled: false
pilot:
autoscaleEnabled: false
sidecar: false
kiali:
enabled: false
tracing:
enabled: false
prometheus:
enabled: false
grafana:
enabled: false
sidecarInjectorWebhook:
enabled: false
---
apiVersion: maistra.io/v1
kind: ServiceMeshMemberRoll
metadata:
name: default
namespace: istio-system
labels:
kabanero.io/install: 21-cr-servicemeshmemberrole
spec:
members:
- knative-serving
- tekton-pipelines
- kabanero
---
apiVersion: v1
kind: Namespace
metadata:
name: knative-serving
labels:
kabanero.io/install: 22-cr-knative-serving
kabanero.io/namespace: 'true'
---
apiVersion: serving.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
namespace: knative-serving
labels:
kabanero.io/install: 22-cr-knative-serving
---
apiVersion: kabanero.io/v1alpha1
kind: Kabanero
metadata:
name: kabanero
namespace: kabanero
labels:
kabanero.io/install: 23-cr-kabanero
spec:
version: "0.2.0"
collections:
repositories:
- name: central
url: https://github.com/kabanero-io/collections/releases/download/0.2.0/kabanero-index.yaml
activateDefaultCollections: true
---
Loading

0 comments on commit 30acd0e

Please sign in to comment.