apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-node5
  labels:
    app: multi-node-test5
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test-node5
  template:
    metadata:
      labels:
        app: test-node5
    spec:
      containers:
      - image: docker.io/andreatp/multi-node-k8s@sha256:e40aa6e73dade152231bc2c0ddbd0bba2136dfd02c991739a236ea41b3f91c18
        lifecycle:
          postStart:
            exec:
              command:
                - /bin/sh
                - -c
                - mkdir /root/.ssh && cp /multinode/ssh/keys/* /root/.ssh
        imagePullPolicy: Always
        name: multi-node-test5
        volumeMounts:
        - mountPath: /multinode/ssh/keys
          subPath: keys
          name: keys
        ports:
        - name: web
          containerPort: 80
          protocol: TCP
        - name: ssh
          containerPort: 22
          protocol: TCP
        - name: multi-node
          containerPort: 5005
          protocol: TCP
        - name: server-multi
          containerPort: 4711
          protocol: TCP
      volumes:
      - name: keys
        secret:
          secretName: ssh-keys
          defaultMode: 384
          items:
          - key: id_rsa
            path: keys/id_rsa
            mode: 256
          - key: id_rsa.pub
            path: keys/id_rsa.pub
            mode: 256
          - key: authorized_keys
            path: keys/authorized_keys
            mode: 256
