-
Notifications
You must be signed in to change notification settings - Fork 41
Conversation
@containscafeine WIP? |
examples/jobs/httpd.yaml
Outdated
ports: | ||
- port: 8080 | ||
jobs: | ||
- containers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is so confusing :(
So essentially we have services
using containers
as a root key, but jobs has containers
within it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, the containers above is for your application, and the one in jobs is for your jobs.
How do you suggest we do this? I think this correlates with the ongoing discussions in #110.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@containscafeine I'm opening an issue now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracked at #119
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any problems with jobs having containers? @cdrage Why do you think its confusing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we have two different formats. Containers as a subkey and containers as a root key. Depending on whether it's a service or any other kind of kind
such as jobs, daemonset, statefulset, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't see it :-(
One is containers for the application (Deployment) the second one if for jobs.
Jobs has also containers, its completely different set of containers from the top level containers.
@cdrage yep, yet to add a couple of tests, docs, etc. |
pkg/encoding/fix.go
Outdated
for index, job := range app.Jobs { | ||
// populate job name if not present | ||
if job.Name == "" { | ||
app.Jobs[index].Name = "job-" + strconv.Itoa(index+1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add 1 to index, even Kubernetes starts the indexing from 0, e.g. in case of StatefulSets (TIL) :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
pkg/spec/spec.go
Outdated
@@ -70,6 +72,12 @@ type ConfigMapMod struct { | |||
Data map[string]string `json:"data,omitempty"` | |||
} | |||
|
|||
type JobSpecMod struct { | |||
Name string `json:"name,omitempty"` | |||
api.PodSpec `json:",inline"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is podspec here? Is it already in jobspec?
pkg/spec/spec.go
Outdated
|
||
// overwrite containers from PodSpec | ||
Containers []Container `json:"containers,omitempty"` | ||
|
||
api_v1.PodSpec `json:",inline"` | ||
ext_v1beta1.DeploymentSpec `json:",inline"` | ||
batch.JobSpec `json:",inline"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is shouldn't be here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
If its not working If I want to put use containers in JobSpec. name: httpd
containers:
- image: centos/httpd
services:
- name: httpd
type: NodePort
ports:
- port: 8080
jobs:
- name: myJob
parallelism: 3
activeDeadlineSeconds: 2
template:
metadata:
name: pi
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
activeDeadlineSeconds: 1 Generated Job is completly missing containers section and nothing from template.spec is propaged . apiVersion: batch/v1
kind: Job
metadata:
creationTimestamp: null
labels:
app: httpd
name: myJob
spec:
parallelism: 3
template:
metadata:
creationTimestamp: null
name: pi
spec:
containers: null
serviceAccountName: ""
volumes: null
status: {} |
Is this WIP or review-needed PR? Because I don't think we have finalized on the way the jobs should be defined? |
@surajssd this is still WIP, I am waiting on the discussion at #116 (comment) before moving on. |
041bf80
to
1c87350
Compare
Refactored the existing code due to the client-go version bump, will now refactor the spec part. |
4d1785b
to
d63b913
Compare
Now starting to move interface methods related bits to package spec in a separate PR |
Deprecating in favor of #253 |
No description provided.