Skip to content

kev-458 Render probe info from extensions#459

Merged
mangas merged 2 commits intomasterfrom
kev-458-render-extensions-probes
Apr 15, 2021
Merged

kev-458 Render probe info from extensions#459
mangas merged 2 commits intomasterfrom
kev-458-render-extensions-probes

Conversation

@mangas
Copy link
Contributor

@mangas mangas commented Apr 14, 2021

Part 1 of x-k8s extensions - probe rendering

Closes #458

Copy link
Contributor

@ezodude ezodude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay. Love the simplicity and how all the value conversion / checks have been removed.

Left a couple of comments.

}

// @step add PVCs to objects
if pvcs != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed to allow removing this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nil is the zero value for slices so for range works on them it just doesn't iterate. No need to protect with a nil check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

// @step add ConfigMaps to objects
if cms != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed to allow removing this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as the one before

Copy link
Contributor

@ezodude ezodude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving!

@mangas mangas merged commit 7cfd284 into master Apr 15, 2021
@mangas mangas deleted the kev-458-render-extensions-probes branch April 15, 2021 09:44
Copy link
Member

@marcinc marcinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few additional comments..

"github.com/appvia/kev/pkg/kev/config"
)

func LivenessProbeToV1Probe(lp config.LivenessProbe) (*v1.Probe, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small note for future PR perhaps, the k8s api version will eventually change so I'd avoid embedding V1 in the function name here and below.

TimeoutSeconds: 10,
PeriodSeconds: 10,
InitialDelaySeconds: 10,
PeriodSeconds: 60,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why the values for period and initial delay have changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because they are not being read from the compose side yet, so these are the default for now, they will break once compose is read into extensions rather than using defaults

Expect(err).To(MatchError("Health check misconfigured"))
_, err := projectService.LivenessProbe()
Expect(err).NotTo(HaveOccurred())
// Expect(err).To(MatchError("Health check misconfigured"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented out bits can go I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be brought back when #460 is completed. Right now the validation is not completed so this doesn't fail but it should.

"Health check misconfigured",
map[string]string{},
)
// assertLog(logrus.ErrorLevel,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the commented out bits still?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, same as previous comments

})

Describe("livenessProbeCommand", func() {
When("defined via labels", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bunch of probe related tests being removed in this PR that set the specific contexts around various probe parameters being supplied via configuration (previously labels and now by extensions) and cases for when custom configuration isn't explicitly specified. Do we have the coverage of those things still?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we now start with defaults and merge in the set configuration. There are some bits missing in terms of validation (#460) for example 0 values and such but absent values are no longer a problem (and is tested in the config package), same as wrong types

})
})

Context("and no port label", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a label anymore so let's change the wording here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll review all of this once we have values being read and labels completely removed

})
})
})
// Describe("livenessProbeCommand", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these commented out specs something we want to keep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we still want to implement them later again but right now there is no point changing them just to change it back later IMO

marcinc added a commit that referenced this pull request Apr 19, 2021
marcinc added a commit that referenced this pull request Apr 20, 2021
* Revert "kev-458 Render probe info from extensions (#459)"

This reverts commit 7cfd284.

* Revert "kev-449 overlay validation (#451)"

This reverts commit c6c4ec0.

* Revert "add extensions to init (#439)"

This reverts commit 539480d.

* Revert "add extension support (#432)"

This reverts commit d694204.

Co-authored-by: marcinc <marcin.ciszak@appvia.io>
ezodude added a commit that referenced this pull request Jun 4, 2021
* add extension support (#432)

* add extension support

* add extensions to init (#439)

* kev-449 overlay validation (#451)

* kev-458 Render probe info from extensions (#459)

* Latest from master.

* kev-458 remove label validation (#482)

* kev-458 remove label validation

* Kev 458 cleanup moved extensions (#483)

* kev-458 cleanup moved extensions

* remove unused code

* kev-458 move imagepull labels (#498)

* kev-458 move resource (#499)

* kev-458 move cpu (#500)

* Bug fix - can now use correct workload type during init and render. (#504)

* Extract volume settings into a volumes K8s extension (#502)

* Enable volumes reconciliation for extensions. (#506)

* Render volumes using extension settings (#508)

* Remove volume labels use (#509)

* Moved the autoscale labels to extensions. (#514)

* Move the pod-security labels to extensions. (#516)

* Move the rolling update max surge and service account name to extensions. (#519)

* Move the service labels to extensions (#521)

* Remove services labels use. (#525)

* Turn Restart Policy string value sets into enums (#533)

* Turn Workload Type and Service Type value sets into enums (#534)

* Minify Extensions (#536)

* Set correct livenessProbe success threshold (#548)

* Update the documentation to use extensions instead of labels. (#547)

* Handle ingress with kubernetes cluster defaults (#552)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rendering manifests from extension values [probes]

3 participants