<p>I like the work methology of Kuberenetes, use self-contained image and pass the configuration in a ConfigMap, as a volume.</p>

<p>Now this worked great until I tried to do this thing with Liquibase container, The SQL is very long ~1.5K lines, and Kubernetes rejects it as too long.</p>

<p>Error from Kubernetes:</p>

<blockquote>
  <p>The ConfigMap "liquibase-test-content" is invalid: metadata.annotations: Too long: must have at most 262144 characters</p>
</blockquote>

<p>I thought of passing the <code>.sql</code> files as a <code>hostPath</code>, but as I understand these <code>hostPath</code>'s content is probably not going to be there</p>

<p>Is there any other way to pass configuration from the K8s directory to pods? Thanks.</p>

aclowkay
<p>The error you are seeing is not about the size of the actual ConfigMap contents, but about the size of the <code>last-applied-configuration</code> annotation that <code>kubectl apply</code> automatically <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-to-create-objects" rel="noreferrer">creates</a> on each <code>apply</code>. If you use <code>kubectl create -f foo.yaml</code> instead of <code>kubectl apply -f foo.yaml</code>, it should work. </p>

<p>Please note that in doing this you will lose the ability to use <code>kubectl diff</code> and do incremental updates (without replacing the whole object) with <code>kubectl apply</code>.</p>
