Skip to content

Commit

Permalink
chore: Update Helm chart workflow
Browse files Browse the repository at this point in the history
Closes: vmware-samples#464 vmware-samples#466 vmware-samples#467
Signed-off-by: Michael Gasch <mgasch@vmware.com>
  • Loading branch information
Michael Gasch committed Jun 29, 2021
1 parent 550d9c8 commit 69af9e4
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 24 deletions.
64 changes: 47 additions & 17 deletions .github/workflows/router-verify-helm.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
name: VMware Event Router Helm Test

# triggered on every PR and commit on changes inside the vmware-event-router
# (Helm) chart directory
# triggered on every push and PRs but only when changes inside
# vmware-event-router (sub)dir(s)
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "vmware-event-router/chart/**"
- 'vmware-event-router/**'
push:
paths:
- "vmware-event-router/chart/**"
schedule:
# runs daily
- cron: '0 0 * * *'
- 'vmware-event-router/**'

env:
KIND_VERSION: v0.11.1
NAMESPACE: vmware
KO_DOCKER_REPO: kind.local

jobs:
openfaas:
name: OpenFaaS Event Processor
runs-on: ubuntu-latest
env:
KO_DOCKER_REPO: kind.local
KIND_VERSION: v0.10.0
NAMESPACE: vmware
timeout-minutes: 15

steps:
- name: Set up Go 1.15.x
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Setup ko
uses: imjasonh/setup-ko@v0.4 # will install latest ko version

- name: Check out code onto GOPATH
uses: actions/checkout@v2
with:
Expand All @@ -49,6 +55,12 @@ jobs:
# Create a cluster!
kind create cluster --config kind.yaml --wait 3m
- name: Build router image with ko
working-directory: ./vmware-event-router
run: |
# loads image into kind
ko publish -B github.com/vmware-samples/vcenter-event-broker-appliance/vmware-event-router/cmd/router
- name: Install OpenFaaS with Helm
run: |
kubectl create ns openfaas && kubectl create ns openfaas-fn
Expand All @@ -74,6 +86,10 @@ jobs:
run: |
echo "::group::Create override.yaml"
cat << EOF > override.yaml
image:
repository: kind.local/router
pullPolicy: IfNotPresent
tag: "latest"
eventrouter:
config:
logLevel: debug
Expand Down Expand Up @@ -109,15 +125,20 @@ jobs:
name: Knative Event Processor
runs-on: ubuntu-latest
env:
KO_DOCKER_REPO: kind.local
KIND_VERSION: v0.10.0
NAMESPACE: vmware
KNATIVE_VERSION: v0.22.0
KNATIVE_VERSION: v0.23.0
BROKER_NAMESPACE: default
BROKER_NAME: default
timeout-minutes: 15

steps:
- name: Set up Go 1.15.x
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Setup ko
uses: imjasonh/setup-ko@v0.4 # will install latest ko version

- name: Check out code onto GOPATH
uses: actions/checkout@v2
with:
Expand All @@ -142,9 +163,13 @@ jobs:
# Create a cluster!
kind create cluster --config kind.yaml --wait 3m
- name: Build router image with ko
working-directory: ./vmware-event-router
run: |
# loads image into kind
ko publish -B github.com/vmware-samples/vcenter-event-broker-appliance/vmware-event-router/cmd/router
- name: Setup Knative Serving
env:
KNATIVE_VERSION: v0.22.0
run: |
echo "::group::Serving CRDs"
kubectl apply -f https://github.com/knative/serving/releases/download/${KNATIVE_VERSION}/serving-crds.yaml
Expand All @@ -157,6 +182,7 @@ jobs:
echo "::endgroup::"
echo "::group::Ingress"
echo "waiting 10s before proceeding..." && sleep 10 # hack: give webhook mutating admission controllers some time to settle
kubectl apply -f https://github.com/knative/net-kourier/releases/download/${KNATIVE_VERSION}/kourier.yaml
kubectl -n kourier-system wait --timeout=3m --for=condition=Available deploy/3scale-kourier-gateway
kubectl patch configmap/config-network \
Expand Down Expand Up @@ -206,6 +232,10 @@ jobs:
run: |
echo "::group::Create override.yaml"
cat << EOF > override.yaml
image:
repository: kind.local/router
pullPolicy: IfNotPresent
tag: "latest"
eventrouter:
config:
logLevel: debug
Expand Down
9 changes: 5 additions & 4 deletions vmware-event-router/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -680,16 +680,17 @@ Knative environment with `Serving` and `Eventing` CRDs installed.

```console
# only for Knative-based deployments
$ kubectl create clusterrolebinding veba-addressable-resolver --clusterrole=addressable-resolver --serviceaccount=vmware:vmware-event-router
$ kubectl create clusterrolebinding veba-addressable-resolver --clusterrole=knative-serving-aggregated-addressable-resolver --serviceaccount=vmware:vmware-event-router
```

<details><summary>Addressable Resolver Permissions</summary>

```console
$ kubectl describe clusterrole addressable-resolver
Name: addressable-resolver
Labels: eventing.knative.dev/release=v0.18.4
Annotations: PolicyRule:
Name: knative-serving-aggregated-addressable-resolver
Labels: serving.knative.dev/release=v0.23.0
Annotations: <none>
PolicyRule:
Resources Non-Resource URLs Resource Names Verbs
--------- ----------------- -------------- -----
services [] [] [get list watch]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.eventrouter.eventProcessor "knative" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -7,8 +8,9 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: addressable-resolver
name: knative-serving-aggregated-addressable-resolver
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
{{- end }}
4 changes: 4 additions & 0 deletions vmware-event-router/chart/templates/400_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ spec:
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
containers:
{{- if .Values.image.tag }}
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
{{- else }}
- image: {{ .Values.image.repository }}:{{ .Chart.AppVersion }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.eventrouter.config }}
name: vmware-event-router
Expand Down
1 change: 1 addition & 0 deletions vmware-event-router/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ replicaCount: 1
image:
repository: vmware/veba-event-router
pullPolicy: Always
tag: "" # can be overwritten for testing

imagePullSecrets: []
nameOverride: ""
Expand Down
4 changes: 2 additions & 2 deletions vmware-event-router/deploy/event-router-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ metadata:
name: vmware-event-router
spec:
ports:
- port: 8080
- port: 8082
protocol: TCP
targetPort: 8080
targetPort: 8082 # must match port defined in metrics server section
selector:
app: vmware-event-router
sessionAffinity: None
Expand Down

0 comments on commit 69af9e4

Please sign in to comment.