<p>I'm trying to create a LoadBalancer in my OKE cluster(Oracle Cloud Container Engine for Kubernetes). I'm doing a <code>kubectl apply -f</code> on the file, but it gives me this error.</p>

<blockquote>
  <p>The Service "servicename" is invalid: metadata.labels: Invalid value: "ocid1.vcn.oc1.iad.xx...xx": must be no more than 63 characters.</p>
</blockquote>

<p>Here's the yaml file</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-nginx-svc
  labels:
    app: nginx
  annotations:
    service.beta.kubernetes.io/oci-load-balancer-internal: "true"
    service.beta.kubernetes.io/oci-load-balancer-subnet1: "ocid1.subnet.oc1..aaaaaa...xxxxx"
spec:
  type: LoadBalancer
  ports:
  - port: 8100
  selector:
    app: nginx
</code></pre>

<p>I see the issue is because the value for <code>service.beta.kubernetes.io/oci-load-balancer-subnet1:</code> is more than 63 chars. But I can't change the value of the OCID.
Is there a fix for this?</p>

<p>As far as i know there is no solution for that.
The names of object in Kubernetes (and your annotation will create an object with the given name) should be DNS RFC complaint which is &lt; 63 chars in the hostname part.</p>
<p>sources :</p>
<ul>
<li><a href="https://www.rfc-editor.org/rfc/rfc1123" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc1123</a></li>
<li><a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/overview/working-with-objects/names/</a></li>
</ul>
