apiVersion: apps/v1
kind: Deployment
metadata:
  name: data-profiling
spec:
  replicas: 1
  selector:
    matchLabels:
      app: data-profiling
  template:
    metadata:
      labels:
        app: data-profiling
    spec:
      volumes:
      - name: html
        emptyDir: {}
      containers:
      - name: web-server
        image: nginx:latest
        ports:
        - containerPort: 80
        volumeMounts:
        - name: html
          mountPath: /usr/share/nginx/html
      initContainers:
      - name: generate-bot
        image: liupengfei99/pandas_data_profiling:main
        imagePullPolicy: Always
        volumeMounts:
        - name: html
          mountPath: /html
        env:
          - name: AWS_S3_ENDPOINT
            value: "minio.lab.sspcloud.fr" # your s3 server endpoint, example: minio.lab.sspcloud.fr
          - name: AWS_ACCESS_KEY_ID # your s3 server access key id
            valueFrom:
              secretKeyRef:
                name: my-s3-creds
                key: accessKey
          - name: AWS_SECRET_ACCESS_KEY # your s3 server secret key
            valueFrom:
              secretKeyRef:
                name: my-s3-creds
                key: secretKey
          # The token is optional based on your s3 creds type, you can leave it empty
          - name: AWS_SESSION_TOKEN
            value: ""    # your s3 server access token, example:
          - name: INPUT_FILE
            value: "s3a://pengfei/diffusion/data_profiling/adult.csv" # the full path of your backup file, example: s3://path/to/sql_backup/adult.snappy.parquet
          - name: FILE_FORMAT
            value: "csv" # example: parquet, json, csv
          - name: SEPARATOR
            value: ","
          - name: NA_VAL
            value: ""
        command: [ sh ]
        args: [ main.sh ]