Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Add support for env vars properly #39

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/v1beta1/parseabletenant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ type StorageConfig struct {
}

type ParseableConfigSpec struct {
Name string `json:"name"`
EnvVars string `json:"env"`
CliArgs []string `json:"cliArgs"`
Name string `json:"name"`
EnvVars map[string]string `json:"env"`
CliArgs []string `json:"cliArgs"`
}

type NodeSpec struct {
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/crd/bases/parseable.io_parseabletenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,9 @@ spec:
type: string
type: array
env:
type: string
additionalProperties:
type: string
type: object
name:
type: string
required:
Expand Down
55 changes: 13 additions & 42 deletions config/samples/parseable-multi-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ spec:
k8sConfig: parseable-ingestion-2
parseableConfig: parseable-server-config

- name: parseable-ingestion-3
type: server
kind: Deployment
replicas: 1
k8sConfig: parseable-ingestion-3
parseableConfig: parseable-server-config

deploymentOrder:
- server

k8sConfig:
- name: parseable-ingestion-1
image: parseable/parseable:edge
image: parseable/parseable:edge-debug
service:
type: ClusterIP
ports:
Expand All @@ -59,33 +52,7 @@ spec:
memory: 128Mi

- name: parseable-ingestion-2
image: parseable/parseable:edge
service:
type: ClusterIP
ports:
- protocol: TCP
port: 80
targetPort: 8000
volumes:
- emptyDir: {}
name: stage-volume
- emptyDir: {}
name: data-volume
volumeMount:
- mountPath: /parseable/data
name: data-volume
- mountPath: /parseable/staging
name: stage-volume
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 100m
memory: 128Mi

- name: parseable-ingestion-3
image: parseable/parseable:edge
image: parseable/parseable:edge-debug
service:
type: ClusterIP
ports:
Expand Down Expand Up @@ -113,10 +80,14 @@ spec:
parseableConfig:
- name: parseable-server-config
cliArgs:
- local-store
env: |-
P_ADDR=0.0.0.0:8000
P_STAGING_DIR=/parseable/staging
P_FS_DIR=./data
P_USERNAME=admin
P_PASSWORD=admin
- s3-store
env:
P_ADDR: "0.0.0.0:8000"
P_USERNAME: "admin"
P_PASSWORD: "admin"
P_STAGING_DIR: "/parseable/staging"
P_S3_URL: "http://minio.minio.svc.cluster.local:9000"
P_S3_ACCESS_KEY: "minioadmin"
P_S3_SECRET_KEY: "minioadmin"
P_S3_BUCKET: "parseable"
P_S3_REGION: "us-east-1"
4 changes: 3 additions & 1 deletion helm/operator/crds/parseable.io_parseabletenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,9 @@ spec:
type: string
type: array
env:
type: string
additionalProperties:
type: string
type: object
name:
type: string
required:
Expand Down
4 changes: 1 addition & 3 deletions internal/tenant_controller/internal_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ func (ib *internalBuilder) makeParseableConfigMap(
CrObject: ib.parseableTenant,
OwnerRef: *ib.ownerRef,
},
Data: map[string]string{
"data": fmt.Sprintf("%s", parseableConfig.EnvVars),
},
Data: parseableConfig.EnvVars,
}

return configMap
Expand Down