How to get a kubernetes pod to access an oracle database?

8/29/2018

I've been trying to get a kuberentes pod to access an external oracle databased. When the pod spins up, the PID associated to accessing the external oracle database hangs and does not timeout.

Here is my yaml:

apiVersion: batch/v1
kind: Job
metadata:
  name: neuron-oracle-producer-clinrpt
  namespace: pubsub
spec:
  template:
    metadata:
      labels:
        app: neuron-oracle-producer-clinrpt
    spec:
      restartPolicy: Never
      hostNetwork: true
      containers:
      - name: neuron-oracle-producer-clinrpt
        image: ndtregistry.azurecr.io/neuron-oracle-producer-clinrpt:latest
        imagePullPolicy: Always
        command: ["neuron-oracle-producer-clinrpt"]
        ports:
          - containerPort: 1521
            hostPort: 1521
        env:
        - name: ORA_USERNAME
          valueFrom:
            secretKeyRef:
              name: clinrpt
              key: username
        - name: ORA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: clinrpt
              key: password
        - name: QUEUE_HOST
          value: "broker.kafka.svc.cluster.local"
        - name: QUEUE_PORT
          value: "9092"
        - name: QUEUE_CATEGORIES
          value: "json"
        - name: LOG_FILE
          value: "/var/log/neuron-oracle-producer-clinrpt.txt"
        - name: MESSAGE_SOURCE
          value: "ClinRpt"
        - name: MESSAGE_FORMAT
          value: "json"
        - name: DEBUG
          value: "TRUE"
        resources:
          requests:
            cpu: 500m
            memory: 1Gi
          limits:
            cpu: 500m
            memory: 1Gi
        volumeMounts:
        - name: logs
          mountPath: /var/log/producer
      imagePullSecrets:
      - name: azureregistry
      volumes:
      - name: logs
        emptyDir: {}

How do I get my pod to access an external oracle database?

-- Bryan Nice
external
kubernetes
kubernetes-networkpolicy
oracle

0 Answers