Skip to content

Commit

Permalink
Split knative resources in 2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-farache authored and rgolangh committed Feb 1, 2024
1 parent d95ac1a commit e86466a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 64 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/move2kube-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,17 @@ jobs:
kubectl patch configmap/m2k-props \
--type merge \
-p '{"data": {"application.properties" :"move2kube_url=http://move2kube-instance-svc.default.svc.cluster.local:8080\nquarkus.rest-client.move2kube_yaml.url=http://move2kube-instance-svc.default.svc.cluster.local:8080\nquarkus.rest-client.notifications_yaml.url=http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}}'
-p '{"data": {"application.properties" :"move2kube_url=http://move2kube-instance-svc.default.svc.cluster.local:8080\nquarkus.rest-client.move2kube_yaml.url=http://move2kube-instance-svc.default.svc.cluster.local:8080\nquarkus.rest-client.notifications.url=http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}}'
kubectl delete pod -l "app=m2k"
kubectl get pods -o wide
- name: Deploy Knative function
run: |
###### workaround till https://issues.redhat.com/browse/FLPATH-892 is solved
yq --inplace '.spec.podTemplate.container |= ( . + {"imagePullPolicy": "IfNotPresent"} )' e2e/resources/knative-resources.yaml
yq --inplace '.spec.template.spec.containers[0] |= ( . + {"imagePullPolicy": "IfNotPresent"} )' e2e/resources/knative-service.yaml
###### end workaround
# deploy the manifests created by the ${{ steps.build-image.outputs.image }}"
kubectl apply -f e2e/resources/knative-service.yaml
kubectl apply -f e2e/resources/knative-resources.yaml
kubectl wait ksvc m2k-save-transformation-func --for=condition=Ready=true --timeout=5m
Expand Down
62 changes: 0 additions & 62 deletions e2e/resources/knative-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,68 +38,6 @@ metadata:
name: default
namespace: sonataflow-infra
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: m2k-save-transformation-func
spec:
template:
metadata:
name: m2k-save-transformation-func-v1
spec:
initContainers:
- name: volume-mount-hack
image: busybox
securityContext:
runAsUser: 0
allowPrivilegeEscalation: true
command: [ "sh", "-c", "cp /tmp/.ssh/id_rsa /etc/pre-install/. && chown 185 /etc/pre-install/id_rsa" ]
volumeMounts:
- name: ssh-priv-key
mountPath: "/tmp/.ssh/id_rsa"
subPath: id_rsa
readOnly: true
- name: pre-install
mountPath: /etc/pre-install
containers:
- image: quay.io/orchestrator/serverless-workflow-m2k-kfunc:latest
imagePullPolicy: Always
env:
- name: EXPORTED_FUNC
value: saveTransformation
- name: SSH_PRIV_KEY_PATH
value: /home/jboss/.ssh/id_rsa
- name: BROKER_URL
value: http://broker-ingress.knative-eventing.svc.cluster.local/sonataflow-infra/default
- name: MOVE2KUBE_API
value: http://move2kube-instance-svc.default.svc.cluster.local:8080/api/v1
name: user-container
volumeMounts:
- name: pre-install
readOnly: true
mountPath: "/home/jboss/.ssh/id_rsa"
subPath: id_rsa
- name: ssh-pub-key
readOnly: true
mountPath: "/home/jboss/.ssh/id_rsa.pub"
subPath: id_rsa.pub

readinessProbe:
successThreshold: 1
tcpSocket:
port: 0
volumes:
- name: ssh-priv-key
secret:
secretName: sshkeys
defaultMode: 384
- name: ssh-pub-key
secret:
secretName: sshkeys
- name: pre-install
emptyDir: { }

---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
Expand Down
62 changes: 62 additions & 0 deletions e2e/resources/knative-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: m2k-save-transformation-func
spec:
template:
metadata:
name: m2k-save-transformation-func-v1
spec:
initContainers:
- name: volume-mount-hack
image: busybox
securityContext:
runAsUser: 0
allowPrivilegeEscalation: true
command:
- sh
- -c
- cp /tmp/.ssh/id_rsa /etc/pre-install/. && chown 185 /etc/pre-install/id_rsa
volumeMounts:
- name: ssh-priv-key
mountPath: /tmp/.ssh/id_rsa
subPath: id_rsa
readOnly: true
- name: pre-install
mountPath: /etc/pre-install
containers:
- image: quay.io/orchestrator/serverless-workflow-m2k-kfunc:latest
imagePullPolicy: IfNotPresent
env:
- name: EXPORTED_FUNC
value: saveTransformation
- name: SSH_PRIV_KEY_PATH
value: /home/jboss/.ssh/id_rsa
- name: BROKER_URL
value: http://broker-ingress.knative-eventing.svc.cluster.local/sonataflow-infra/default
- name: MOVE2KUBE_API
value: http://move2kube-instance-svc.default.svc.cluster.local:8080/api/v1
name: user-container
volumeMounts:
- name: pre-install
readOnly: true
mountPath: /home/jboss/.ssh/id_rsa
subPath: id_rsa
- name: ssh-pub-key
readOnly: true
mountPath: /home/jboss/.ssh/id_rsa.pub
subPath: id_rsa.pub
readinessProbe:
successThreshold: 1
tcpSocket:
port: 0
volumes:
- name: ssh-priv-key
secret:
secretName: sshkeys
defaultMode: 384
- name: ssh-pub-key
secret:
secretName: sshkeys
- name: pre-install
emptyDir: {}

0 comments on commit e86466a

Please sign in to comment.