blob: 9c6e7a5d03fafc032fd4702bb01dbf464bbcf748 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: default
---
apiVersion: sources.knative.dev/v1
kind: SinkBinding
metadata:
name: jobs-service-postgresql-sb
spec:
sink:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
subject:
apiVersion: apps/v1
kind: Deployment
selector:
matchLabels:
app.kubernetes.io/name: jobs-service-postgresql
app.kubernetes.io/version: 999-SNAPSHOT
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: jobs-service-postgresql
app.kubernetes.io/version: 999-SNAPSHOT
name: jobs-service-postgresql
spec:
ports:
- name: http
port: 80
targetPort: 8080
selector:
app.kubernetes.io/name: jobs-service-postgresql
app.kubernetes.io/version: 999-SNAPSHOT
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: jobs-service-postgresql
app.kubernetes.io/version: 999-SNAPSHOT
name: jobs-service-postgresql
spec:
replicas: 1
# remove after https://issues.redhat.com/browse/KOGITO-8311 is done
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: jobs-service-postgresql
app.kubernetes.io/version: 999-SNAPSHOT
template:
metadata:
labels:
app.kubernetes.io/name: jobs-service-postgresql
app.kubernetes.io/version: 999-SNAPSHOT
spec:
containers:
- name: jobs-service-postgresql
image: docker.io/apache/incubator-kie-kogito-jobs-service-postgresql:main
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
protocol: TCP
env:
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KOGITO_SERVICE_URL
value: http://jobs-service-postgresql
- name: KOGITO_JOBS_SERVICE_HTTP_JOB_STATUS_CHANGE_EVENTS
value: "true"
- name: QUARKUS_DATASOURCE_USERNAME
value: postgres
- name: QUARKUS_DATASOURCE_PASSWORD
value: pass
- name: QUARKUS_DATASOURCE_JDBC_URL
value: jdbc:postgresql://timeouts-showcase-database:5432/postgres?currentSchema=jobs-service
- name: QUARKUS_DATASOURCE_REACTIVE_URL
value: postgresql://timeouts-showcase-database:5432/postgres?search_path=jobs-service
livenessProbe:
failureThreshold: 3
httpGet:
path: /q/health/live
port: 8080
scheme: HTTP
initialDelaySeconds: 0
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 10
readinessProbe:
failureThreshold: 3
httpGet:
path: /q/health/ready
port: 8080
scheme: HTTP
initialDelaySeconds: 0
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 10
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: jobs-service-postgresql-create-job-trigger
spec:
broker: default
filter:
attributes:
type: job.create
subscriber:
ref:
apiVersion: v1
kind: Service
name: jobs-service-postgresql
uri: /v2/jobs/events
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: jobs-service-postgresql-cancel-job-trigger
spec:
broker: default
filter:
attributes:
type: job.delete
subscriber:
ref:
apiVersion: v1
kind: Service
name: jobs-service-postgresql
uri: /v2/jobs/events