Tf-operator: shareProcessNamespace not working with TFJob

Created on 20 Dec 2018  路  5Comments  路  Source: kubeflow/tf-operator

Using kubeflow v0.3.4 and kube 1.12

shareProcessNamespace works when used with Pod spec.

apiVersion: v1
kind: Pod
metadata:
name: "dpak-shared"
spec:
shareProcessNamespace: true
containers:
- image: "ubuntu:16.04"
name: ubuntu
imagePullPolicy: IfNotPresent
command: ["sleep", "infinity"]
securityContext:
capabilities:
add:
- SYS_PTRACE
- image: "datascience-tf-cpu:v1"
name: tensorflow
imagePullPolicy: IfNotPresent
command: ["sleep", "infinity"]

shareProcessNamespace doesn't work when used with TFJob spec.

apiVersion: "kubeflow.org/v1alpha2"
kind: TFJob
metadata:
name: "dpak-shared-job"
spec:
cleanPodPolicy: ALL
tfReplicaSpecs:
Master:
replicas: 1
template:
spec:
shareProcessNamespace: true
containers:
- image: "ubuntu:16.04"
name: ubuntu
imagePullPolicy: IfNotPresent
command: ["sleep", "infinity"]
securityContext:
capabilities:
add:
- SYS_PTRACE
- image: "datascience-tf-cpu:v1"
name: tensorflow
imagePullPolicy: IfNotPresent
command: ["sleep", "infinity"]

I tried both on the same Ubuntu 18.04 v4.15 machine.

kinbug kinquestion aretfjob

All 5 comments

I think we need to reproduce it first. We use the template directly to create the pod: https://github.com/kubeflow/tf-operator/blob/master/pkg/controller.v1beta1/tensorflow/pod.go#L178. It should work well with all fields in the template.

@dpaks Can you provide the full pod spec for the actual pods created by TFJob e.g

kubectl get pods -o yaml ${MASTER pod

As @gaocegege says tf-operator should be passing the fields through directly to the pod template spec. If its not then its a bug in tf-operator but if it is then something outside tf-operator is going on.

I am closing the issue since it is stale. But feel free to leave comments if you still have problems.

I have the same issue when using tf-operator v0.3.0.
I looked into the code and found it is because tf-operator is using v1.9 for k8s.io/api and shareProcessNamespace is not yet supported at this release: https://github.com/kubeflow/tf-operator/blob/v0.3.0/vendor/k8s.io/api/core/v1/types.go#L2716

Issue-Label Bot is automatically applying the labels:

| Label | Probability |
| ------------- | ------------- |
| area/tfjob | 0.85 |

Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pingsutw picture pingsutw  路  7Comments

andreyvelich picture andreyvelich  路  9Comments

jlewi picture jlewi  路  10Comments

ScorpioCPH picture ScorpioCPH  路  6Comments

yph152 picture yph152  路  10Comments