<p>I am working with spring boot with microservices. I dockerize my all microservices and now I am trying to create resource in kubernates cluster. I get error while create resource in cluster through running <code>kubectl apply</code>.</p>
<p>Here down is my configuration file for kubernates:</p>
<p><strong>eureka-server.yml</strong></p>
<pre><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: eureka-cm
data:
  eureka_service_address: http://eureka-0.eureka:8761/eureka

---

apiVersion: v1
kind: Service
metadata:
  name: eureka
  labels:
    app: eureka
spec:
  ClusterIP: None
  ports: 
  - port: 8761
    name: eureka
  selector:
    app: eureka

---

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: eureka
spec:
  selector:
    matchLabels:
      app: eureka
  serviceName: &quot;eureka&quot;
  replicas: 1
  template:
    metadata:
      labels:
        app: eureka
    spec:
      containers:
      - name: eureka
        image: username/eureka-server:latest
        imagePullPolicy: Always
        ports:
          - containerPort: 8761
        env:
          - name: EUREKA_SERVER_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: eureka-cm
                key: eureka_service_address

---

apiVersion: v1
kind: Service
metadata:
  name: eureka-lb
  labels:
    app: eureka
spec:
  selector:
    app: eureka
  type: NodePort
  ports:
    - port: 80
      targetPort: 8761
</code></pre>
<p>Configuration file in spring boot for eureka server:</p>
<p><strong>application.yml</strong></p>
<pre><code>server:
  port: 8761
eureka:
  instance:
    hostname: &quot;${HOSTNAME}.eureka&quot;
  client:
    registerWithEureka: false
    fetchRegistry: false
    service-url:
      defaultZone: ${EUREKA_SERVER_ADDRESS}
  server:
    waitTimeInMsWhenSyncEmpty: 0
</code></pre>
<p>Here down is my error I got while create resource in kubernates cluster:</p>
<pre><code>error: error validating &quot;./eureka-server.yml&quot;: error validating data: ValidationError(Service.spec): unknown field &quot;ClusterIP&quot; in io.k8s.api.core.v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>

Faheem azaz Bhanej
<p>Well the error message you get is essentially the answer to your question. The field <code>ClusterIP</code> does not exist, but it is actually called <code>clusterIP</code>, which you can easily find out by reading the <a href="https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec" rel="nofollow noreferrer">API reference</a>.</p>
