kedgeproject / kedge

Kedge : Simple, Concise & Declarative Kubernetes Applications
Apache License 2.0
298 stars 41 forks source link

Update documentation regarding separate controller constructs with PodSpec, ControllerSpec, etc. #457

Closed cdrage closed 6 years ago

cdrage commented 6 years ago

So...

Within our documentation we've said that the "Kedge" file "extends" PodSpec.

Yet for example:

controller: job
name: pival
containers:
- image: perl
  command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
parallelism: 3

We use "Parallelism" which is considered part of the JobSpec, not PodSpec.

Should we indicate in the documentation that depending on what controller is defined, it changes what you can define in the Kedge file?

Instead of saying that the Kedge file is simply an extension of PodSpec..

cdrage commented 6 years ago

ping @pradeepto @kadel

surajssd commented 6 years ago

https://github.com/kedgeproject/kedge/blob/c64b0fd7a69edc4db5ef9aab0c52c97a0c9cf10e/pkg/spec/types.go#L188-L192

so above you can see that we have DeploymentSpec, but PodSpec is already coming from ControllerFields, see below:

https://github.com/kedgeproject/kedge/blob/c64b0fd7a69edc4db5ef9aab0c52c97a0c9cf10e/pkg/spec/types.go#L171-L179

Similarly we have done for all controllers, so is Job controller is implemented:

https://github.com/kedgeproject/kedge/blob/c64b0fd7a69edc4db5ef9aab0c52c97a0c9cf10e/pkg/spec/types.go#L197-L206

Should we indicate in the documentation that depending on what controller is defined, it changes what you can define in the Kedge file?

This is true, PodSpec is always constant, but depending on the controllerTypeSpec things will change.

concaf commented 6 years ago

@surajssd explained pretty well.

Essentially, Kedge spec == ControllerFields (contains PodSpec) + ControllerSpec (job controller contains parallelism field).

cdrage commented 6 years ago

@containscafeine Thanks :) Yeah, that's what I thought. So essentially it's a combination of both PodSpec + ControllerSpec in the "root" of the Kedge file. For example, ContainerSpec is within containers key, ConfigMapSpec within configmaps key, etc.

cdrage commented 6 years ago

Let's keep this issue open so we can track regarding adding extra documentation to clarify all of this :+1:

cdrage commented 6 years ago

PR #492

kadel commented 6 years ago

492 was merged, can we close this?

cdrage commented 6 years ago

Yup :+1: