Skip to content

Commit

Permalink
e2e: Add sidecar container to get the logs of m2k
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Golan <[email protected]>
  • Loading branch information
rgolangh committed Jul 4, 2024
1 parent 7a566b9 commit 7194abb
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions e2e/resources/move2kube-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
- name: SSH_AUTH_SOCK
value: /tmp/unix-socket
volumeMounts:
- name: m2k-data
mountPath: /move2kube-api
- name: ssh-priv-key
readOnly: true
mountPath: "/root/.ssh/id_rsa"
Expand All @@ -35,8 +37,20 @@ spec:
lifecycle:
postStart:
exec:
command: [ "/bin/sh", "-c", "ssh-agent -a /tmp/unix-socket && ssh-add /root/.ssh/id_rsa && ssh [email protected] -o StrictHostKeyChecking=accept-new || true && ssh [email protected] -o StrictHostKeyChecking=accept-new|| true && ssh [email protected] -o StrictHostKeyChecking=accept-new|| true" ]
command: [ "cp -r /move2kube-api/build /opt && /bin/sh", "-c", "ssh-agent -a /tmp/unix-socket && ssh-add /root/.ssh/id_rsa && ssh [email protected] -o StrictHostKeyChecking=accept-new || true && ssh [email protected] -o StrictHostKeyChecking=accept-new|| true && ssh [email protected] -o StrictHostKeyChecking=accept-new|| true" ]
initContainers:
- name: log-shipper
image: docker.io/alpine:latest
restartPolicy: Always
command: ['sh', '-c', 'cp -r /opt/move2kube-api ; tail -F /move2kube-api/m2kcli.log']
volumeMounts:
- name: m2k-data
mountPath: /move2kube-api


volumes:
- name: m2k-data
emptyDir: {}
- name: ssh-priv-key
secret:
secretName: sshkeys
Expand All @@ -54,4 +68,4 @@ spec:
- port: 8080
protocol: TCP
selector:
app: move2kube-instance
app: move2kube-instance

0 comments on commit 7194abb

Please sign in to comment.