Skip to content

Commit

Permalink
chore: Remove support for External Knative Processor
Browse files Browse the repository at this point in the history
Signed-off-by: William Lam <wlam@vmware.com>
  • Loading branch information
William Lam committed Jan 10, 2022
1 parent dc4dfab commit 55c3d80
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 143 deletions.
18 changes: 0 additions & 18 deletions docs/kb/install-knative.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@ Deploy the VMware Event Broker Appliance OVA to your vCenter Server using the vS
* Enable Webhook Event Provider - Enable Webhook Event Provider
* Basic Auth Username (Optional) - Username to login to webhook endpoint
* Basic Auth Password (Optional) - Password to login to webhook endpoint
#### **Event Processor Configuration** (**Required**)
* Event Processor - Choose Knative

> **Note:** Selecting Knative here will default to using the Embedded Knative deployment within the VMware Event Broker Appliance. If this is your intent, you **do not have to fill** in any of the settings for the Knative Configuration section below. The Knative Configuration section below is for use with **an External Knative** installation.
#### **Existing Knative Environment Configuration** (**Optional**)

**<font color="red">This configuration option has been deprecated in the VMware Event Broker Appliance v0.7 release in favor of the default embedded Knative installation and thus will be removed in next release.</font>**

If you do want the Embedded Knative deployment in the VMware Event Broker Appliance and you have your own External Knative installation, the following settings are required.

* Host - Knative host (e.g. mybroker.corp.local:8080)
* Leave `host` field blank to automatically enable the embedded Knative broker
* Scheme - HTTP or HTTPS protocol the broker is using
* Disable Knative host TLS Verification - Only applicable for HTTPs scheme. If you have a self-signed SSL Certificate, you will need to check this box.
* Path - Additional path to append to the host if required, e.g. "/default/broker"

> For more information on using the Knative Processor, please take a look at the [VMware Event Router documentation](https://github.com/vmware-samples/vcenter-event-broker-appliance/blob/development/vmware-event-router/README.MD){:target="_blank"}

#### **Custom TLS Certificate Configuration** (Optional)

Expand Down
2 changes: 1 addition & 1 deletion docs/site/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ id: functions
type: knative
title: Prebuilt Functions
description: Community-sourced and validated prebuilt functions for Knative with VEBA.
permalink: /examples-knative
permalink: /examples
images:
powercli: /assets/img/languages/powercli.png
python: /assets/img/languages/python.png
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,15 @@
#@ load("@ytt:data", "data")

#@ load("@ytt:json", "json")
#@ processor = json.decode(data.values.config)["EVENT_PROCESSOR_TYPE"]
#@ type = json.decode(data.values.config)["KNATIVE_DEPLOYMENT_TYPE"]
#@ vcenter = json.decode(data.values.config)["ESCAPED_VCENTER_SERVER"]
#@ vcenterUsername = json.decode(data.values.config)["ESCAPED_VCENTER_USERNAME"]
#@ vcenterPassword = json.decode(data.values.config)["ESCAPED_VCENTER_PASSWORD"]
#@ vcenterTls = json.decode(data.values.config)["VCENTER_DISABLE_TLS"]

#@ if processor == "Knative":
#@ processorName = "knative"
#@ end
#@ routerName = "vmware-event-router-config-" + processorName + "-" + data.values.eventProvider
#@ routerName = "vmware-event-router-config-knative-" + data.values.eventProvider

apiVersion: event-router.vmware.com/v1alpha1
eventProcessor:
#@ if processor == "Knative":
#@ if type == "external":
#@ knativeHost = json.decode(data.values.config)["KNATIVE_HOST"]
#@ knativeScheme = json.decode(data.values.config)["KNATIVE_SCHEME"]
#@ knativePath = json.decode(data.values.config)["KNATIVE_PATH"]
#@ knativeTls = json.decode(data.values.config)["KNATIVE_DISABLE_TLS"]
name: veba-knative
type: knative
knative:
#@ if knativeTls == "True":
insecureSSL: true
#@ else:
insecureSSL: false
#@ end
encoding: binary
destination:
uri:
host: #@ knativeHost
scheme: #@ knativeScheme
path: #@ knativePath
#@ else:
name: veba-knative
type: knative
knative:
Expand All @@ -48,8 +22,6 @@ eventProcessor:
kind: Broker
name: default
namespace: vmware-functions
#@ end
#@ end
eventProvider:
#@ if data.values.eventProvider == "vcenter":
name: veba-vc-01
Expand Down
12 changes: 0 additions & 12 deletions files/configs/ingress/templates/ingressroute-gateway-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#@ load("@ytt:json", "json")
#@ fqdn = json.decode(data.values.config)["HOSTNAME"]

#@ processorType = json.decode(data.values.config)["EVENT_PROCESSOR_TYPE"]
#@ knativeDeploymentType = json.decode(data.values.config)["KNATIVE_DEPLOYMENT_TYPE"]
#@ vebaUIUsername = json.decode(data.values.config)["ESCAPED_VCENTER_USERNAME_FOR_VEBA_UI"]
#@ vebaUIPassword = json.decode(data.values.config)["ESCAPED_VCENTER_PASSWORD_FOR_VEBA_UI"]
#@ webhookEnabled = json.decode(data.values.config)["WEBHOOK_ENABLED"]
Expand All @@ -14,10 +12,8 @@
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
#@ if processorType == "Knative" and knativeDeploymentType == "embedded":
annotations:
kubernetes.io/ingress.class: contour-external
#@ end
labels:
app: vmware
name: event-router
Expand Down Expand Up @@ -89,21 +85,16 @@ spec:
minimumProtocolVersion: "1.2"
secretName: #@ data.values.secretName
includes:
#@ if processorType == "Knative" and knativeDeploymentType == "embedded":
- name: sockeye
namespace: vmware-functions
#@ end
- name: cadvisor
namespace: vmware-system
#@ if processorType == "Knative":
---
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
#@ if knativeDeploymentType == "embedded":
annotations:
kubernetes.io/ingress.class: contour-external
#@ end
name: sockeye
namespace: vmware-functions
spec:
Expand All @@ -130,15 +121,12 @@ spec:
services:
- name: sockeye
port: 80
#@ end
---
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
#@ if processorType == "Knative" and knativeDeploymentType == "embedded":
annotations:
kubernetes.io/ingress.class: contour-external
#@ end
labels:
app: cadvisor
name: cadvisor
Expand Down
16 changes: 7 additions & 9 deletions files/setup-01-os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ echo -e "\e[92mConfiguring IP Tables for Antrea ..." > /dev/console
iptables -A INPUT -i gw0 -j ACCEPT
iptables-save > /etc/systemd/scripts/ip4save

if [ "${KNATIVE_DEPLOYMENT_TYPE}" == "embedded" ]; then
echo -e "\e[92mConfiguring Local Storage Volume ..." > /dev/console
parted ${LOCAL_STORAGE_DISK} --script mklabel gpt mkpart primary ext3 0% 100%
mkfs -t ext3 ${LOCAL_STORAGE_DISK}1
mkdir ${LOCAL_STOARGE_VOLUME_PATH}
chmod 777 ${LOCAL_STOARGE_VOLUME_PATH}
echo "${LOCAL_STORAGE_DISK}1 ${LOCAL_STOARGE_VOLUME_PATH} ext3 defaults 0 0" >> /etc/fstab
mount ${LOCAL_STOARGE_VOLUME_PATH}
fi
echo -e "\e[92mConfiguring Local Storage Volume ..." > /dev/console
parted ${LOCAL_STORAGE_DISK} --script mklabel gpt mkpart primary ext3 0% 100%
mkfs -t ext3 ${LOCAL_STORAGE_DISK}1
mkdir ${LOCAL_STOARGE_VOLUME_PATH}
chmod 777 ${LOCAL_STOARGE_VOLUME_PATH}
echo "${LOCAL_STORAGE_DISK}1 ${LOCAL_STOARGE_VOLUME_PATH} ext3 defaults 0 0" >> /etc/fstab
mount ${LOCAL_STOARGE_VOLUME_PATH}
12 changes: 5 additions & 7 deletions files/setup-04-kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ do
sleep 10
done

if [ "${KNATIVE_DEPLOYMENT_TYPE}" == "embedded" ]; then
echo -e "\e[92mDeploying Local Storage Provisioner ..." > /dev/console
mkdir -p ${LOCAL_STOARGE_VOLUME_PATH}/local-path-provisioner
chmod 777 ${LOCAL_STOARGE_VOLUME_PATH}/local-path-provisioner
kubectl apply -f /root/download/local-path-storage.yaml
kubectl patch sc local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
fi
echo -e "\e[92mDeploying Local Storage Provisioner ..." > /dev/console
mkdir -p ${LOCAL_STOARGE_VOLUME_PATH}/local-path-provisioner
chmod 777 ${LOCAL_STOARGE_VOLUME_PATH}/local-path-provisioner
kubectl apply -f /root/download/local-path-storage.yaml
kubectl patch sc local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

echo -e "\e[92mCreating VMware namespaces ..." > /dev/console
kubectl create namespace vmware-system
Expand Down
9 changes: 3 additions & 6 deletions files/setup-06-event-processor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ kubectl -n vmware-system create secret generic basic-auth \

VEBA_CONFIG_FILE=/root/config/veba-config.json

echo -e "\e[92mSetting up Knative Processor ..." > /dev/console
grep -q "Processor:" /etc/veba-release || echo "Processor: Knative" >> /etc/veba-release

for EVENT_PROVIDER in ${EVENT_PROVIDERS[@]};
do
# Setup Event Processor Configuration File
EVENT_ROUTER_CONFIG_TEMPLATE=/root/config/event-router/templates/vmware-event-router-config-template.yaml
EVENT_ROUTER_CONFIG=/root/config/event-router/vmware-event-router-config-${EVENT_PROVIDER}.yaml

if [ "${EVENT_PROCESSOR_TYPE}" == "Knative" ]; then
echo -e "\e[92mSetting up Knative Processor ..." > /dev/console

grep -q "Processor:" /etc/veba-release || echo "Processor: Knative" >> /etc/veba-release
fi

ytt --data-value eventProvider=${EVENT_PROVIDER} --data-value-file config=${VEBA_CONFIG_FILE} -f ${EVENT_ROUTER_CONFIG_TEMPLATE} > ${EVENT_ROUTER_CONFIG}
done
12 changes: 5 additions & 7 deletions files/setup-09-ingress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ fi
kubectl -n vmware-system create secret tls ${CERT_NAME} --key ${KEY_FILE} --cert ${CERT_FILE}

# Knative Contour for Knative Embedded Broker
if [ "${KNATIVE_DEPLOYMENT_TYPE}" == "embedded" ]; then
echo -e "\e[92mDeploying Knative Contour ..." > /dev/console
echo -e "\e[92mDeploying Knative Contour ..." > /dev/console

kubectl create -n contour-external secret tls default-cert --key ${KEY_FILE} --cert ${CERT_FILE}
kubectl apply -f /root/download/contour-delegation.yaml
kubectl patch configmap -n knative-serving config-contour -p '{"data":{"default-tls-secret":"contour-external/default-cert"}}'
kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$CN_NAME\": \"\"}}"
fi
kubectl create -n contour-external secret tls default-cert --key ${KEY_FILE} --cert ${CERT_FILE}
kubectl apply -f /root/download/contour-delegation.yaml
kubectl patch configmap -n knative-serving config-contour -p '{"data":{"default-tls-secret":"contour-external/default-cert"}}'
kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$CN_NAME\": \"\"}}"

echo -e "\e[92mDeploying Ingress ..." > /dev/console

Expand Down
6 changes: 1 addition & 5 deletions files/setup-098-dcui-endpoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ DCUI_ENDPOINTS_FILE=/etc/veba-endpoints
cat > ${DCUI_ENDPOINTS_FILE} <<EOF
Appliance Configuration,Install Logs,/bootstrap
Appliance Configuration,Resource Utilization,/top
Appliance Configuration,Events,/events
EOF

# For Knative deployment, Sockeye is deployed and exposes via /events endpoint
if [ ${EVENT_PROCESSOR_TYPE} == "Knative" ]; then
echo "Appliance Configuration,Events,/events" >> ${DCUI_ENDPOINTS_FILE}
fi

# For Webhook Provider
if [ ${WEBHOOK_ENABLED} == "True" ]; then
echo "Appliance Configuration,Webhook,/webhook" >> ${DCUI_ENDPOINTS_FILE}
Expand Down
30 changes: 3 additions & 27 deletions files/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ HORIZON_DISABLE_TLS=$(/root/setup/getOvfProperty.py "guestinfo.horizon_disable_t
WEBHOOK_ENABLED=$(/root/setup/getOvfProperty.py "guestinfo.webhook")
WEBHOOK_USERNAME=$(/root/setup/getOvfProperty.py "guestinfo.webhook_username")
WEBHOOK_PASSWORD=$(/root/setup/getOvfProperty.py "guestinfo.webhook_password")
EVENT_PROCESSOR_TYPE=$(/root/setup/getOvfProperty.py "guestinfo.event_processor_type")
KNATIVE_HOST=$(/root/setup/getOvfProperty.py "guestinfo.knative_host")
KNATIVE_SCHEME=$(/root/setup/getOvfProperty.py "guestinfo.knative_scheme" | tr [:upper:] [:lower:])
KNATIVE_DISABLE_TLS=$(/root/setup/getOvfProperty.py "guestinfo.knative_disable_tls_verification")
KNATIVE_PATH=$(/root/setup/getOvfProperty.py "guestinfo.knative_path")
CUSTOM_VEBA_TLS_PRIVATE_KEY=$(/root/setup/getOvfProperty.py "guestinfo.custom_tls_private_key")
CUSTOM_VEBA_TLS_CA_CERT=$(/root/setup/getOvfProperty.py "guestinfo.custom_tls_ca_cert")
DOCKER_NETWORK_CIDR=$(/root/setup/getOvfProperty.py "guestinfo.docker_network_cidr")
Expand Down Expand Up @@ -77,17 +72,6 @@ else
EVENT_PROVIDERS+=("horizon")
fi

# Determine Knative deployment model
if [ "${EVENT_PROCESSOR_TYPE}" == "Knative" ]; then
if [ ! -z ${KNATIVE_HOST} ]; then
KNATIVE_DEPLOYMENT_TYPE="external"
else
KNATIVE_DEPLOYMENT_TYPE="embedded"
fi
else
KNATIVE_DEPLOYMENT_TYPE="na"
fi

# Customize the POD CIDR Network if provided or else default to 10.10.0.0/16
if [ -z "${POD_NETWORK_CIDR}" ]; then
POD_NETWORK_CIDR="10.16.0.0/16"
Expand Down Expand Up @@ -142,12 +126,6 @@ else
"WEBHOOK_ENABLED": "${WEBHOOK_ENABLED}",
"ESCAPED_WEBHOOK_USERNAME": ${ESCAPED_WEBHOOK_USERNAME},
"ESCAPED_WEBHOOK_PASSWORD": ${ESCAPED_WEBHOOK_PASSWORD},
"EVENT_PROCESSOR_TYPE": "${EVENT_PROCESSOR_TYPE}",
"KNATIVE_DEPLOYMENT_TYPE": "${KNATIVE_DEPLOYMENT_TYPE}",
"KNATIVE_HOST": "${KNATIVE_HOST}",
"KNATIVE_SCHEME": "${KNATIVE_SCHEME}",
"KNATIVE_DISABLE_TLS": "${KNATIVE_DISABLE_TLS}",
"KNATIVE_PATH": "${KNATIVE_PATH}",
"CUSTOM_VEBA_TLS_PRIVATE_KEY": "${CUSTOM_VEBA_TLS_PRIVATE_KEY}",
"CUSTOM_VEBA_TLS_CA_CERT": "${CUSTOM_VEBA_TLS_CA_CERT}",
"DOCKER_NETWORK_CIDR": "${DOCKER_NETWORK_CIDR}",
Expand All @@ -173,10 +151,8 @@ EOF
echo -e "\e[92mStarting Kubernetes Configuration ..." > /dev/console
. /root/setup/setup-04-kubernetes.sh

if [ "${KNATIVE_DEPLOYMENT_TYPE}" == "embedded" ]; then
echo -e "\e[92mStarting Knative Configuration ..." > /dev/console
. /root/setup/setup-05-knative.sh
fi
echo -e "\e[92mStarting Knative Configuration ..." > /dev/console
. /root/setup/setup-05-knative.sh

echo -e "\e[92mStarting VMware Event Processor Configuration ..." > /dev/console
. /root/setup/setup-06-event-processor.sh
Expand All @@ -190,7 +166,7 @@ EOF
echo -e "\e[92mStarting Ingress Router Configuration ..." > /dev/console
. /root/setup/setup-09-ingress.sh

if [[ "${KNATIVE_DEPLOYMENT_TYPE}" == "embedded" ]] && [[ ! -z ${VCENTER_USERNAME_FOR_VEBA_UI} ]] && [[ ! -z ${VCENTER_PASSWORD_FOR_VEBA_UI} ]]; then
if [[ ! -z ${VCENTER_USERNAME_FOR_VEBA_UI} ]] && [[ ! -z ${VCENTER_PASSWORD_FOR_VEBA_UI} ]]; then
echo -e "\e[92mStarting Knative UI Configuration ..." > /dev/console
. /root/setup/setup-010-veba-ui.sh
fi
Expand Down
22 changes: 0 additions & 22 deletions manual/photon.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -127,28 +127,6 @@
<Label>Basic Auth Password (Optional)</Label>
<Description>Password to login to webhook endpoint</Description>
</Property>
<Category>Event Processor Configuration</Category>
<Property ovf:qualifiers="ValueMap{&quot;Knative&quot;, &quot;OpenFaaS&quot;, &quot;AWS EventBridge&quot;}" ovf:userConfigurable="true" ovf:value="Knative" ovf:type="string" ovf:key="guestinfo.event_processor_type">
<Label>Event Processor</Label>
<Description>Choose either Knative (default), OpenFaaS (deprecated), or AWS EventBridge (deprecated) and only fill in the configuration for the selected event processor below</Description>
</Property>
<Category>Existing Knative Environment Configuration (deprecated)</Category>
<Property ovf:key="guestinfo.knative_host" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Host</Label>
<Description>Knative Host (e.g. mybroker.corp.local:8080)</Description>
</Property>
<Property ovf:key="guestinfo.knative_scheme" ovf:qualifiers="ValueMap{&quot;HTTP&quot;,&quot;HTTPS&quot;}" ovf:userConfigurable="true" ovf:type="string" ovf:value="HTTP">
<Label>Scheme</Label>
<Description>Knative Scheme - HTTP or HTTPS protocol the broker is using</Description>
</Property>
<Property ovf:key="guestinfo.knative_disable_tls_verification" ovf:type="boolean" ovf:userConfigurable="true" ovf:value="false">
<Label>Disable Knative host TLS Verification</Label>
<Description>Disable TLS Verification for Knative host (only applicable if Knative Scheme is HTTPS and for self-sign certificate)</Description>
</Property>
<Property ovf:key="guestinfo.knative_path" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Path</Label>
<Description>Additional path to append to the host if required (e.g. /default/default)</Description>
</Property>
<Category>Custom TLS Certificate Configuration</Category>
<Property ovf:key="guestinfo.custom_tls_private_key" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Custom VMware Event Broker Appliance TLS Certificate Private Key (Base64)</Label>
Expand Down

0 comments on commit 55c3d80

Please sign in to comment.