dragonflydb / dragonfly-operator

A Kubernetes operator to install and manage Dragonfly instances.
https://www.dragonflydb.io/docs/managing-dragonfly/operator/installation
Apache License 2.0
118 stars 24 forks source link

feat(service): add support for nodePort #205

Closed mueller-ma closed 2 days ago

mueller-ma commented 1 week ago

Closes #204

mueller-ma commented 1 week ago

I tried to follow the steps from CONTRIBUTING.md and deployt this version of the operator, but the CRDs didn't change. When I try to apply the following file, I get the error strict decoding error: unknown field "spec.resources.serviceSpec":

apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
  labels:
    app.kubernetes.io/name: dragonfly
    app.kubernetes.io/instance: dragonfly-sample
    app.kubernetes.io/part-of: dragonfly-operator
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/created-by: dragonfly-operator
  name: dragonfly-sample
spec:
  replicas: 2
  resources:
    requests:
      cpu: 500m
      memory: 500Mi
    limits:
      cpu: 600m
      memory: 750Mi
    serviceSpec:
      type: NodePort
      nodePort: 20001

Did I miss any file that needs to be updated as well? I looked at the PR https://github.com/dragonflydb/dragonfly-operator/pull/187 for this change.

Abhra303 commented 1 week ago

@mueller-ma, you have put serviceSpec under resources. serviceSpec should be at the same level as resources.

mueller-ma commented 6 days ago

Thanks for that hint. With a valid yaml Dragonfly manifest, I was able to deploy a dragonfly instance, that uses a fixed node port.