Quantcast
Channel: access logs in cron jobs kubernetes - Stack Overflow
Viewing all articles
Browse latest Browse all 3

access logs in cron jobs kubernetes

$
0
0

im running cron job in kubernetes, jobs completes successfully and i log output to log file inside(path: storage/logs) but i cannot access that file due to container is in completed here is my job yaml.

apiVersion: v1
items:
- apiVersion: batch/v1beta1
  kind: CronJob
  metadata:
    labels:
      chart: cronjobs-0.1.0
    name: cron-cronjob1
    namespace: default
  spec:
    concurrencyPolicy: Forbid
    failedJobsHistoryLimit: 1
    jobTemplate:      
      spec:
        template:
          metadata:          
            labels:
              app: cron
              cron: cronjob1
          spec:
            containers:
            - args:
              - /usr/local/bin/php
              - -c
              - /var/www/html/artisan bulk:import
              env:
              - name: DB_CONNECTION
                value: postgres
              - name: DB_HOST
                value: postgres
              - name: DB_PORT
                value: "5432"
              - name: DB_DATABASE
                value: xxx
              - name: DB_USERNAME
                value: xxx
              - name: DB_PASSWORD
                value: xxxx
              - name: APP_KEY
                value: xxxxx
              image: registry.xxxxx.com/xxxx:2ecb785-e927977
              imagePullPolicy: IfNotPresent
              name: cronjob1
              ports:
              - containerPort: 80
                name: http
                protocol: TCP              
            imagePullSecrets:
            - name: xxxxx
            restartPolicy: OnFailure          
            terminationGracePeriodSeconds: 30
    schedule: '* * * * *'
    successfulJobsHistoryLimit: 3

is there anyway i can get my log file content display on kubectl log command or other alternatives?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images