Are there any configuration libraries like <#C018G...
# serialization
d
Are there any configuration libraries like #hoplite based on KotlinX Serialization? They all seem to use reflection... and using KotlinX Serialization by itself won't parse environment variables or system properties, nor will it merge configurations from a few sources...
c
You can just merge via the hocon lib. We used a 3 line config loader that merged multiple configs and just used Kotlinx and the hocon lib
I don’t have the source because I no longer work on that project
Typesafe config + kotlinx ser
z
Ktoml might be what you're looking for. It's toml only but uses kotlinx serialization
c
Just to be clear, I mean https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-serialization-hocon together with typesafe config. It’s really only 3 lines to get merging, and end vars also work
d
ktoml just seems to be another format supported... hocon too. I guess I'll either have to settle for #hoplite or implement merging myself. I thought someone might have already done this... thanks anyways!
c
What config file format do you want to Use?
d
yaml + env vars to override its values in certain cases (I'm using docker images in kubernetes -- and sometimes config values need to be overridden by env vars to avoid recompiling everything and redeploying a new image for settings changes. Also, I have common settings that need to be merged with local/dev/production setting.
c
oh ok i was somehow assuming that you want .conf files. with .conf files it would work perfectly. If i was going to build something new I would probably use cue files.
d
I use cue for kubernetes manifests, but how would that help in overriding already compiled settings that are in the deployed docker image?
c
how do you use cue for kubernetes manifests? sorry i was just talking hypothetically that I currently use conf files but what i really want to use for everthing is cue. but that config lib does not exist yet, there also seems to be no cue support for kotlinx-ser-
d
There's a tutorial of k8s somewhere in the cue project's github
It makes thing VERY concise
c
I always use gitops with flux and I think there is no gitops operator yet that can do cue.
but I have spent hours tracking down errors caused by yaml whitespace errors.
d
ArgoCD can be adapted to cue
Which is what I'm doibng
And intellij has a half-decent cue plugin
Copy code
- name: cue
  generate:
    command: ["sh", "-c"]
    args: ["cue cmd dump ."]
in
configManagementPlugins
in the configMap
Adds a plugin for cue
The
dump
is from cue's k8s tutorial
c
oh nice. I wanted to try argocd anyway. (but flux seems to be much lighweighter and the people on my last project were already using it)
anyway it would be cool to use just one config file format.
s
Out of interest why do you not want to use hoplite here @dave08. Is there some issue with it ?