Documentation for k8s podspec with examples

Bug #1889519 reported by Benjamin Allot
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
High
Unassigned

Bug Description

Hello,

Starting with a new k8s charm with the operator framework, I was a bit confused by the lack of documentation regarding the podspec "spec" itself.

Here is what I found so far:
* There is currently 3 version of this podspec. v3 is the current one (30th July 2020)
* This post is a description of the v1 : https://discourse.juju.is/t/writing-a-kubernetes-charm/159
* This post seems to summarize the change brought to the v2 : https://discourse.juju.is/t/updated-podspec-yaml-new-features/2124
* This post is about v3 podspec : https://discourse.juju.is/t/k8s-spec-v3-changes/2698

What I found hard is that there is not a central place for all the spec version.
Even more so that the first post is not found when looking for "podspec spec" in discourse but by the reply in the second post.

The mariadb-k8s charm example seems to provide a podspec v1 : https://github.com/wallyworld/caas/blob/master/charms/mariadb/reactive/spec_template.yaml

From there, you need to basically compile yourself the various new capabilities and concept fo the v2 and v3 (including the switch from "config" to "envConfig" and "files" to "volumeConfig").

Would it be possible to have a single dummy podspec YAML example per version with comments somewhere and also some practical example on how to couple them with the "kubernetesResources" part to, for example, configure an ingress resource.

A practical example is the Mattermost charm : https://git.launchpad.net/charm-k8s-mattermost/tree/src/charm.py#n277

Thanks !

Tags: docs
Revision history for this message
Ian Booth (wallyworld) wrote :

The sample mariadb charm is very minimal and only needs features for v1 - there's been no need to update it to use v2 or v3 features.

It's definitely a known issue and there's ongoing work to consolidate all of the k8s material off discourse into more cohesive Juu-k8s documentation, including a more fully featured sample charm etc. Tim is doing the heavy lifting so far so I'll assign the bug to him.

Changed in juju:
assignee: nobody → Tim McNamara (tim-clicks)
Revision history for this message
Benjamin Allot (ballot) wrote :

A little bump (and unassigning Tim). I had to look for the new "service" support in the pod_spec (https://github.com/juju/juju/pull/11847/).

It would be great to have a pinned post on discourse or wherever you want with a yaml with comments in one place.

Thanks !

Changed in juju:
assignee: Tim McNamara (tim-clicks) → nobody
Revision history for this message
Ian Booth (wallyworld) wrote :

The doc is spread across a few discourse posts and with Tim gone, we've lost the person who was pulling it all together into a single, cohesive piece of doc. It's on the todo list fot sure.

https://discourse.juju.is/t/k8s-spec-reference/3495
https://discourse.juju.is/t/k8s-spec-v3-changes/2698
https://discourse.juju.is/t/updated-podspec-yaml-new-features/2124

Revision history for this message
Ian Booth (wallyworld) wrote :

Ah sorry, I didn't see you had already found the individual posts

Revision history for this message
Pen Gale (pengale) wrote :

Triaging this as high and dropping into the milestone for the next cycle.

I think that this will be fixed when the relevant docs are better organized, and more discoverable.

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.0.0
tags: added: docs
Changed in juju:
milestone: 3.0.0 → 3.0.1
Changed in juju:
milestone: 3.0.1 → 3.0.2
Changed in juju:
milestone: 3.0.2 → 3.0.3
Revision history for this message
Juan M. Tirado (tiradojm) wrote :

Documentation has been fully refactored. Please look.

Changed in juju:
status: Triaged → Incomplete
Changed in juju:
milestone: 3.0.3 → 3.0.4
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Canonical Juju because there has been no activity for 60 days.]

Changed in juju:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.