Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't understand how increase pvc in nificluster #474

Closed
grandeon opened this issue May 30, 2023 · 10 comments
Closed

I can't understand how increase pvc in nificluster #474

grandeon opened this issue May 30, 2023 · 10 comments

Comments

@grandeon
Copy link

Hi everybody,

I'm trying to increase the deafult pvc for a nifi cluster but I can't got it.
This is the configuration I'm using:

apiVersion: nifi.stackable.tech/v1alpha1
kind: NifiCluster
metadata:
  name: apm-nifi
  namespace: nifi-experiments
spec:
  image:
    productVersion: "1.18.0"
    stackableVersion: "23.4.0"
  clusterConfig:
    listenerClass: cluster-internal
    authentication:
      method:
        singleUser:
          adminCredentialsSecret: nifi-admin-credentials-apm
          autoGenerate: false
    sensitiveProperties:
      keySecret: nifi-sensitive-property-key
      autoGenerate: true
    zookeeperConfigMapName: apm-nifi-znode
  nodes: # role-level
    config:
      resources:
        cpu:
          min: "500m"
          max: "4"
        memory:
          limit: "8Gi"
    roleGroups: # role-group-level
      base: # role-group 1
        replicas: 0
      high: # role-group 2
        replicas: 1
        config:
          resources:
            storage:
              flowfile_repo:
                capacity: "12Gi"
              provenance_repo:
                capacity: "12Gi"
              database_repo:
                capacity: "12Gi"
              content_repo:
                capacity: "12Gi"
              state_repo:
                capacity: "12Gi"
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: dedicated
                  operator: In
                  values:
                  - nifi
        configOverrides:
          nifi.properties:
            nifi.web.proxy.host: "nifi.xxxx.xxxx.com:443"

The configOverrides section works fine.
I can increase the cpu and memory resources, but not the storage. Always I get the default pvc size.

What is my misconfiguration?
Can someone help me?

Thank you so much!!

@maltesander
Copy link
Member

Hi @grandeon,

can you please specify the operator version you are using?

We currently do not support increasing existing PVCs (working on that).

So updating the PVC size of a running cluster is currently only possible manually.

In case you want to create a new cluster with bigger PVCs please try (camelCase instead of snake_case for the repo specification):

      high: # role-group 2
        replicas: 1
        config:
          resources:
            storage:
              flowfileRepo:
                capacity: "12Gi"
              provenanceRepo:
                capacity: "12Gi"
              databaseRepo:
                capacity: "12Gi"
              contentRepo:
                capacity: "12Gi"
              stateRepo:
                capacity: "12Gi"

I hope this helps.

Cheers,
Malte

@sbernauer
Copy link
Member

You can increase the size of an already existent pvc using e.g. https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/

@grandeon
Copy link
Author

Hi @grandeon,

can you please specify the operator version you are using?

We currently do not support increasing existing PVCs (working on that).

So updating the PVC size of a running cluster is currently only possible manually.

In case you want to create a new cluster with bigger PVCs please try (camelCase instead of snake_case for the repo specification):

      high: # role-group 2
        replicas: 1
        config:
          resources:
            storage:
              flowfileRepo:
                capacity: "12Gi"
              provenanceRepo:
                capacity: "12Gi"
              databaseRepo:
                capacity: "12Gi"
              contentRepo:
                capacity: "12Gi"
              stateRepo:
                capacity: "12Gi"

I hope this helps.

Cheers, Malte

These are my operator's releases:

helm list -n stackable
NAME              	NAMESPACE	REVISION	UPDATED                                 	STATUS  	CHART                       	APP VERSION
commons-operator  	stackable	1       	2023-05-22 15:44:37.780486365 +0200 CEST	deployed	commons-operator-0.0.0-dev  	0.0.0-dev  
nifi-operator     	stackable	1       	2023-05-22 15:45:31.792361638 +0200 CEST	deployed	nifi-operator-0.0.0-dev     	0.0.0-dev  
secret-operator   	stackable	3       	2023-05-25 16:42:01.018496377 +0200 CEST	deployed	secret-operator-0.0.0-dev   	0.0.0-dev  
zookeeper-operator	stackable	1       	2023-05-22 15:45:17.052818755 +0200 CEST	deployed	zookeeper-operator-0.0.0-dev	0.0.0-dev 

But I tried too with the stable version with the same problem:

helm install --wait commons-operator stackable-stable/commons-operator --version 23.4.0 -n stackable
helm install --wait secret-operator stackable-stable/secret-operator --version 23.4.0 -n stackable
helm install --wait zookeeper-operator stackable-stable/zookeeper-operator --version 23.4.0 -n stackable
helm install --wait nifi-operator stackable-stable/nifi-operator --version 23.4.0 -n stackable

I can't understand this:

In case you want to create a new cluster with bigger PVCs please try (camelCase instead of snake_case for the repo specification):

Thank you very much and sorry for my lack of knowledge

@grandeon
Copy link
Author

grandeon commented May 30, 2023

You can increase the size of an already existent pvc using e.g. https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/

This has worked for me as a workaround and as a possible way to increase volume in the future.

My question was more about the option to request more storage when creating the cluster, but it works for me at least for now.

Thank you so much!

# Before
...
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 2Gi
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2023-05-30T13:37:05Z"
    status: "True"
    type: Resizing
  phase: Bound
# after: 
...
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 12Gi
...

@sbernauer
Copy link
Member

Hi @grandeon,
so basically we support specifying the pvc sizes when creating the cluster.
Watch out, you need to use the example @maltesander provided (there are some typos - e.g. use config.resources.storage.flowfileRepo instead of config.resources.storage.flowfile_repo).
In case you want to change your pvc size afterwards that's a thing we currently don't support out of the box. You can find details in stackabletech/trino-operator#342. To put it short, we are not allowed to change the volume size from the StatefulSet containing NiFi. So (and only) in that case you need to manually resize the pvc, until we have solved the problem.

@grandeon
Copy link
Author

The branches did not let me see the forest!
Now I understand the different between camelCase and snake_case for the repo specification!
Thank you very much and sorry @sbernauer and @maltesander, maybe my question was too basic!

And many thanks to all of you who make Stackable possible!

@sbernauer
Copy link
Member

That's totally fine, we can't know everything! Glad it worked out for you!
Is their any outdated documentation that we should fix/improve to prevent users running into the same issue again?
(e.g. where config.resources.storage.flowfile_repo is written down)

All the best,
Sebastian

@grandeon
Copy link
Author

I followed the NiFi Operator documentation where it still uses snacke_case:

https://docs.stackable.tech/home/stable/nifi/usage_guide/resource-configuration.html

Thank you so much!

@sbernauer
Copy link
Member

Thanks for pointing that out! Will fix it immediately. (Because the docs are version will will only show up in the nightly version and afterwards in 23.7)

@sbernauer
Copy link
Member

Oh it's already fixed in the nightly version. Will be in the stable version once we release 23.7:
https://docs.stackable.tech/home/nightly/nifi/usage_guide/resource-configuration.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants