apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
  name: vgg16job-tf-pserver
spec:
  replicas: 10
  template:
    metadata:
      labels:
        tf-job-pserver: vgg16job-tf
    spec:
      hostNetwork: true
      imagePullSecrets:
      - name: job-registry-secret
      containers:
      - name: pserver
        image: "registry.baidu.com/paddlepaddle/fluid_benchmark_tf:vgg16"
        imagePullPolicy: Always
        command: ["tf_k8s", "start_tf"]
        ports:
        - name: jobport-30236
          containerPort: 30236
        env:
        - name: PORT
          value: "32036"
        - name: ENTRY
          value: "python vgg16_tf.py"
        - name: JOB_NAME
          value: vgg16job-tf
        - name: PSERVERS_NUM
          value: "10"
        - name: TF_JOB_NAME 
          value: "ps"
        - name: TRAINERS_NUM
          value: "20"
        - name: BATCH_SIZE
          value: "128"
        - name: TRAINER_PACKAGE
          value: "/workspace"
        - name: NUM_PASSES
          value: "1"
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: "status.podIP"
        resources:
          requests:
            memory: 10Gi
            cpu: 4
          limits:
            memory: 10Gi
            cpu: 4
