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

[Bug] Additional server configuration does not set environment variables #26

Open
rilyw opened this issue Jan 9, 2025 · 4 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@rilyw
Copy link

rilyw commented Jan 9, 2025

The new feature from #22 does not work for us. We create a ConfigMap and use the name of it in additionalServerConfiguration as described in the sample, but the defined variables are not set for the deployed pods.

apiVersion: v1
kind: ConfigMap
metadata:
  name: ts-server-config
data:
  TYPESENSE_ENABLE_SEARCH_ANALYTICS: "true"
  TYPESENSE_ENABLE_CORS: "true"
  TYPESENSE_ANALYTICS_DIR: "/data/analytics-data"
  TYPESENSE_ANALYTICS_FLUSH_INTERVAL: "60"
---
apiVersion: ts.opentelekomcloud.com/v1alpha1
kind: TypesenseCluster
metadata:
  labels:
    app.kubernetes.io/name: typesense-operator
    app.kubernetes.io/managed-by: kustomize
  name: {{ include "typesense-server.fullname" . }}
  namespace: {{ .Values.namespace }}
spec:
  image: "{{ .Values.image.repository}}:{{ .Values.image.tag}}"
  replicas: {{ .Values.replicas }}
  storage:
    size: {{ .Values.persistence.size }}
    storageClassName: {{ .Values.persistence.storageClassName }}
  additionalServerConfiguration:
    name: ts-server-config

I cannot see anything wrong with our configuration, it is basically the same as in the samples.

apiVersion: v1
kind: ConfigMap
metadata:
  name: c-kind-2-config
data:
  TYPESENSE_ENABLE_SEARCH_ANALYTICS: "true"
  TYPESENSE_ENABLE_CORS: "true"
---
apiVersion: ts.opentelekomcloud.com/v1alpha1
kind: TypesenseCluster
metadata:
  labels:
    app.kubernetes.io/name: typesense-operator
    app.kubernetes.io/managed-by: kustomize
  name: c-kind-2
spec:
  image: typesense/typesense:26.0
  replicas: 1
  additionalServerConfiguration:
    name: c-kind-2-config
.
.
.

I also tried adding the ConfigMap to the same namespace or deploying it in default, but to no avail. TYPESENSE_ENABLE_CORS stays false and the other defined variables are not set at all in the pods/statefulset.

Environment:
      TYPESENSE_API_KEY:               <set to the key 'typesense-api-key' in secret 'typesense-common-bootstrap-key'>  Optional: false
      TYPESENSE_NODES:                 /usr/share/typesense/nodes
      TYPESENSE_DATA_DIR:              /usr/share/typesense/data
      TYPESENSE_API_PORT:              8108
      TYPESENSE_PEERING_PORT:          8107
      TYPESENSE_PEERING_ADDRESS:        (v1:status.podIP)
      TYPESENSE_ENABLE_CORS:           false
      TYPESENSE_CORS_DOMAINS:          
      TYPESENSE_RESET_PEERS_ON_ERROR:  true
Mounts:
      /usr/share/typesense from nodeslist (rw)
      /usr/share/typesense/data from data (rw)

We use the the version 0.2.7 of the operator.

Containers:
  manager:
    Container ID:  containerd://2d6085364c62744e5b9fffd5d3e63b5f1ed5ee499279ab121b15b2049a9b7cc0
    Image:         akyriako78/typesense-operator:0.2.7
    Image ID:      docker.io/akyriako78/typesense-operator@sha256:02dc69839be9b5ba873ff18c200a8e41e136aff4642d2efdc822f4622d082965

Is there something wrong with how we do it or should it work like that?

@akyriako
Copy link
Owner

akyriako commented Jan 9, 2025

image

@rilyw
Copy link
Author

rilyw commented Jan 9, 2025

I also tried adding the ConfigMap to the same namespace or deploying it in default, but to no avail.

The cluster and the ConfigMap are deployed in the same namespace.

When looking at the env in the pod it is the same as the one I can see with describe.

I have no name!@ts-server-sts-0:/$ env | grep TYPESENSE_
TYPESENSE_API_KEY=nk8BtnTQ/Kh00bk6qYYm47kcmA5mWt4ZE4dRqy2Xuoo9+fXTAKSy7hAK3f+A9ljCkfBPaRtBNtHqt7gL9yXAWawoIyZGTktVfRIoUTUyOD1lGyeQpzkaASDTuwdeRr9q9T0jxCI6X3Na7Woo+idr8oextOzv9zaivi8MldKQ1OyITXR+128mYuKn6qlzn0lVC0oI/1ojrx8/2Y3hubpmiNRP0u3CYEccDlA+GLFMZpI+UmEKXvKGrwqzKe3WuIfifvq1/TBn6edp69II4xef4klw14ZTJ906DTk2mtFXMIDE1VAMmpfhi9nsYzZxq5xBRfF4T+OngGtJiwNCVAsMCg==
TYPESENSE_RESET_PEERS_ON_ERROR=true
TYPESENSE_NODES=/usr/share/typesense/nodes
TYPESENSE_CORS_DOMAINS=
TYPESENSE_PEERING_PORT=8107
TYPESENSE_API_PORT=8108
TYPESENSE_PEERING_ADDRESS=100.105.100.93
TYPESENSE_ENABLE_CORS=false
TYPESENSE_DATA_DIR=/usr/share/typesense/data

@rilyw
Copy link
Author

rilyw commented Jan 9, 2025

We found the source of the problem and it is just a simple fix. The crd in the helm chart was not updated in #22. When I build the crd locally and apply it the pods have the correct variables set.

@akyriako
Copy link
Owner

akyriako commented Jan 9, 2025

Thanks for figuring this out, I'll build a new chart soon 🙈

@akyriako akyriako added the bug Something isn't working label Jan 9, 2025
@akyriako akyriako self-assigned this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants