-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cedc043
commit 4f2ebd4
Showing
11 changed files
with
191 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,15 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal | |
|
||
LABEL MAINTAINER "Adrian Riobo" "<[email protected]>" | ||
|
||
WORKDIR / | ||
COPY --from=builder /workspace/out/qe-eventmanager . | ||
#USER 65532:65532 | ||
COPY --from=builder /workspace/out/qe-eventmanager /workspace/images/builder/entrypoint.sh /usr/local/bin/ | ||
|
||
ENTRYPOINT ["/qe-eventmanager"] | ||
ENTRYPOINT entrypoint.sh | ||
|
||
|
||
|
||
# "start", | ||
# "-b", "messaging-devops-broker02.web.stage.ext.phx2.redhat.com:61612", | ||
# "--ca-certs", "/etc/pki/ca-trust/source/anchors/2015-RH-IT-Root-CA.pem", | ||
# "--certificate-file", "/home/ariobolo/02OFFTOPIC/umb-certificates/psi-crcqe-openstack.crt", | ||
# "--private-key-file", "/home/ariobolo/02OFFTOPIC/umb-certificates/psi-crcqe-openstack.key", | ||
# "-k", "/home/ariobolo/02OFFTOPIC/umb-certificates/config"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
VALID_CONFIG=true | ||
# Check required ENVs | ||
if [ -z "${BROKERS}" ]; then | ||
echo "BROKERS ENV is required" | ||
VALID_CONFIG=false | ||
fi | ||
|
||
if [ -z "${CA}" ]; then | ||
echo "CA ENV is required" | ||
VALID_CONFIG=false | ||
fi | ||
|
||
if [ -z "${CERTIFICATE}" ]; then | ||
echo "CERTIFICATE ENV is required" | ||
VALID_CONFIG=false | ||
fi | ||
|
||
if [ -z "${KEY}" ]; then | ||
echo "KEY ENV is required" | ||
VALID_CONFIG=false | ||
fi | ||
|
||
if [ "${VALID_CONFIG}" = false ]; then | ||
echo "Add the required ENVs" | ||
exit 1 | ||
fi | ||
|
||
# Run qe-eventmanager | ||
if [ -z "${KUBECONFIG}" ]; then | ||
# Inside the cluster por running as SA with permissions | ||
qe-eventmanager start \ | ||
--brokers "${BROKERS}" \ | ||
--ca-certs "${CA}" \ | ||
--certificate-file "${CERTIFICATE}" \ | ||
--private-key-file "${KEY}" \ | ||
else | ||
# OCP Cluster access based on kubeconfig file | ||
qe-eventmanager start \ | ||
--brokers "${BROKERS}" \ | ||
--ca-certs "${CA}" \ | ||
--certificate-file "${CERTIFICATE}" \ | ||
--private-key-file "${KEY}" \ | ||
--kubeconfig "${KUBECONFIG}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
oc create secret generic qe-eventmanager-config \ | ||
--from-file=ca=ca.crt \ | ||
--from-file=certificate=user.crt \ | ||
--from-file=key=user.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: qe-eventmanager | ||
labels: | ||
app: qe-eventmanager | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: qe-eventmanager | ||
template: | ||
metadata: | ||
labels: | ||
app: qe-eventmanager | ||
spec: | ||
containers: | ||
- name: qe-eventmanager | ||
image: quay.io/ariobolo/qe-eventmanager:0.0.1 | ||
volumeMounts: | ||
- mountPath: /var/run/secrets/tokens | ||
name: vault-token | ||
serviceAccountName: pipeline-runner | ||
volumes: | ||
- name: vault-token | ||
projected: | ||
sources: | ||
- serviceAccountToken: | ||
path: vault-token | ||
expirationSeconds: 7200 | ||
audience: vault | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: pipeline-runner | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/part-of: qe-eventmanager | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: pipeline-runner | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/part-of: qe-eventmanager | ||
rules: | ||
- apiGroups: ["tekton.dev"] | ||
resources: ["tasks", "taskruns", "pipelines", "pipelineruns", "pipelineresources", "conditions"] | ||
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: pipeline-runner | ||
labels: | ||
app.kubernetes.io/component: rbac | ||
app.kubernetes.io/part-of: qe-eventmanager | ||
subjects: | ||
- kind: ServiceAccount | ||
name: pipeline-runner | ||
roleRef: | ||
kind: Role | ||
name: pipeline-runner | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package event | ||
package manager | ||
|
||
type Event interface { | ||
GetDestination() error | ||
|