5 ms·
Honestly, creating my first K8s deployment of a service; typing out at least 150 lines of YAML to define my Deployment, figuring out how my ConfigMaps, Secrets,
by JensRantil 4y ago
Honestly, creating my first K8s deployment of a service; typing out at least 150 lines of YAML to define my Deployment, figuring out how my ConfigMaps, Secrets, and Volumes, Services are defined and connected together. Vanilla K8s YAML is extremely low-level.
- secondcoming 4y agoI'm buried up to my balls in this right now. My favourite part is nested 'spec' objects where I've no clear view into what each spec is.
- moondev 4y agokubectl explain
- Bayart 4y agoTry k9s[1], the xray view (:xray [ressource]) shows you nested resources as a tree. I find it very useful (and k9s in general is a fantastic administration tool). [1]: https://k9scli.io https://k9scli.io
- bavell 4y agoThere's a vscode k8s language plugin that gives you autocomplete and tooltips when hovering over yaml keys, saves me a ton of time in situations like these.
- e12e 4y agoI haven't really used it in anger, but I sort of think kpt might be helpful in managing k8s: https://kpt.dev/ https://kpt.dev/
- speedgoose 4y agoYes it’s a bit much. When I was beginning with kubernetes I was writing Docker compose files first and then converting them to kubernetes using https://kompose.io/ https://kompose.io/
- bovermyer 4y agoI'm a platform engineer and I still think that Kubernetes and its tooling are unnecessarily complex. As an aside, when I think "low-level" with regards to computer programming, I think machine byte code - closer to the hardware - so this statement read a little funny to me.
- OJFord 4y agoYeah, it may be complex and highly configurable, but it's hard to imagine getting much higher level than defining networking, storage, secrets, etc. through YAML.
- e12e 4y agoI feel it's a lot like the Java enterprise world of FactoryFactoryFactory-classes - a col league coined the term "horizontal abstraction" for this type of trend; you never build a pyramid/hierarchy that composes truly higher level/abstract reasoning - you just complect in various constructs - that all keep hold of most of the complexity from the level "below". So you get to write 30-40 lines of yaml for each of your ten slightly different services...
- robertlagrant 4y agoHaving experienced many Word documents full of deployment instructions and screenshots on how to deploy software, a few lines of YAML has been amazing for me :) But no doubt there are other tools that are even better.
- GordonS 4y agoCompare with Docker Compose files, which still use YAML, but a lot less of it, and less verbose too.
- KptMarchewa 4y agoAnd does a lot less too, since it describes single node deployment, without any complexities behind networking and communication of services on different nodes.
- tpetry 4y agoA docker compose file is also used for swarm mich is a multi-server deployment.
- robertlagrant 4y agoBut is that a more complex file than the single node one?
- GordonS 4y agoWhile the file specification is for Docker Compose, Docker Swarm uses the same files, and supports multi-node deployments. There are a few differences in supported features; for example, IIRC, only Docker Swarm supports `secrets`.
- p_l 4y agoThe most freeing moment with k8s for me was integrating that no, you don't need to write all that YAML (or JSON), and going into generating manifests from other formats - in my case, usually Jsonnet with mix of libraries both public and private which quickly embedded knowledge specific to our setup. I think one of the best things I ever heard from another colleague was "I took the example jsonnet and had working version for completely new deployment within hour" :)
- JensRantil 4y agoAgree! That said, it's important to remember that someone needs to maintain those manifests, too. Copy-paste might work initially, but you will need to modify them at some point. Which means you need in-house knowledge of that K8s YAML, anyway. For a smaller shop this might be non-trivial. For a larger shop you likely have something close to a Platform team that can maintain the manifests to make them easy to use.
- Bayart 4y ago> Vanilla K8s YAML is extremely low-level. I find trying to untangle something deployed with Kubespray/Helm/anything automatized far more headache inducing than flat YAML files.
- JensRantil 4y agoYeah, been there and it makes things one notch even worse. :)
- dhagz 4y agoI've found that creating the k8s resources manually in a local KinD/microk8s cluster and then spewing the resulting YAML to be much easier than typing the YAML directly.