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

Improve logic for default datastore #535

Closed
bsctl opened this issue Aug 11, 2024 · 2 comments · Fixed by #536
Closed

Improve logic for default datastore #535

bsctl opened this issue Aug 11, 2024 · 2 comments · Fixed by #536
Assignees

Comments

@bsctl
Copy link
Member

bsctl commented Aug 11, 2024

The introduction of dependancy for kamaji-etcd chart has the condition:

version: 2.0.0
dependencies:
- name: kamaji-etcd
  repository: https://clastix.github.io/charts
  version: 0.7.0
  condition: kamaji-etcd.deploy

However, the values.yaml file still report:

etcd:
  # -- (bool) Enable the creation of a local etcd instance as a default Datastore using the kamaji-etcd chart by CLASTIX. (default=true)
  deploy: true

# -- (string) If the creation of an etcd instance is disabled, specify the default DataStore name for the Kamaji instance.
datastoreName: kamaji-etcd

and controller.yaml template uses as:

      containers:
      - args:
        - manager
        - --health-probe-bind-address={{ .Values.healthProbeBindAddress }}
        - --leader-elect
        - --metrics-bind-address={{ .Values.metricsBindAddress }}
        - --tmp-directory={{ .Values.temporaryDirectoryPath }}
        {{- if .Values.etcd.deploy }}
        - --datastore={{ (index .Values "kamaji-etcd" "datastore").name }}
        {{- else }}
        - --datastore={{ required ".Values.etcd.datastoreName is required when etcd sub-chart is enabled!" .Values.etcd.datastoreName }}
        {{- end }}

Let's to refactor and simplify as:

In Chart.yaml:

dependencies:
- name: kamaji-etcd
  repository: https://clastix.github.io/charts
  version: "> 0.7"
  condition: kamaji-etcd.deploy

In values.yaml as:

# remove this
# etcd:
#   # -- (bool) Enable the creation of a local etcd instance as a default Datastore using the kamaji-etcd chart by CLASTIX. (default=true)
#   deploy: true

# -- (string) Specify the default DataStore name for the Kamaji instance.
defaultDatastoreName: default

kamaji-etcd:
  deploy: true             # <<<<<<<<<< currently missing >>>>>>>>>>
  fullnameOverride: kamaji-etcd
  datastore:
    enabled: true
    name: default

In controller.yaml as:

      containers:
      - args:
        - manager
        - --health-probe-bind-address={{ .Values.healthProbeBindAddress }}
        - --leader-elect
        - --metrics-bind-address={{ .Values.metricsBindAddress }}
        - --tmp-directory={{ .Values.temporaryDirectoryPath }}
        {{- $datastoreName := .Values.defaultDatastoreName | required ".Values.defaultDatastoreName is required!" }}
        - --datastore={{ $datastoreName }}
        {{- if .Values.telemetry.disabled }}
        - --disable-telemetry
        {{- end }}
@prometherion
Copy link
Member

We already provide a way to set the default Data store, as well as defining the name of it.

@bsctl
Copy link
Member Author

bsctl commented Aug 11, 2024

let's to simplify it as well as corret a missing value

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

Successfully merging a pull request may close this issue.

2 participants