--- apiVersion: template.openshift.io/v1 kind: Template labels: template: backup-networkpolicy-template objects: - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: "allow-backup-postgres-to-${NAME}-${INSTANCE}-cluster" spec: # Allow Backup containers to talk to Patroni cluster ingress: - from: - podSelector: matchLabels: cronjob: backup-postgres template: backup-postgres-job ports: - port: 5432 protocol: TCP podSelector: matchLabels: app.kubernetes.io/instance: "${INSTANCE}" app.kubernetes.io/name: "${NAME}" cluster-name: "${INSTANCE}" role: master parameters: - name: NAME description: The name of the application for labelling all artifacts. displayName: Application Name required: true value: patroni - name: INSTANCE description: The name of this instance of the application displayName: Application Instance Name required: true