kubernetesdrone.io

Drone CI - Invalid port configuration


Im trying to install Drone CI server in my kubernetes cluster using an argocd app, everything it's up and running but the Drone CI server deployment

deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: drone-server
  namespace: droneci
  labels:
    app: drone-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: drone-server
  template:
    metadata:
      labels:
        app: drone-server
    spec:
      containers:
      - name: drone-server
        image: drone/drone:2.20.0
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            memory: "800Mi"
            cpu: "500m"
        ports:
        - name: http
          containerPort: 80
          protocol: TCP
        envFrom:
        - secretRef:
            name: droneci-secret

service.yaml

apiVersion: v1
kind: Service
metadata:
  name: drone-server
  namespace: droneci
  labels:
    app: drone-server
spec:
  type: NodePort
  selector:
    app: drone-server
  ports:
    - protocol: TCP
      name: http
      port: 80
      targetPort: 80

This is the only log I get from the droneci-server pod (giving Back-off error):

level=fatal msg="main: invalid configuration" error="Invalid port configuration. See https://community.harness.io/t/drone-server-changing-ports-protocol/11400"

I can't understand what is the problem exactly, I believe that the port configuration it's just fine. Can anyone help me?


Solution

  • I don't know why, but if I apply the deployment first, and then the service, it works