Skip to content

Commit

Permalink
narrow down chronicle values to subset, update http vs. https logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMapley committed Nov 21, 2023
1 parent 7263d17 commit 319a5ac
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 66 deletions.
5 changes: 5 additions & 0 deletions charts/posit-chronicle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ lint:

template:
helm template -f ci/complex-values.yaml . --debug

template-all:
helm template -f ci/empty-values.yaml .
helm template -f ci/simple-values.yaml .
helm template -f ci/complex-values.yaml .
10 changes: 5 additions & 5 deletions charts/posit-chronicle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ config:
| pod.rest.port | int | `5252` | |
| pod.tolerations | list | `[]` | An array used verbatim as the pod's "tolerations" definition |
| replicas | int | `1` | The number of replica pods to maintain for this service |
| service.rest.annotations | object | `{}` | Additional annotations to add to the chronicle-server service |
| service.rest.labels | object | `{}` | Additional labels to add to the chronicle-server service |
| service.rest.port | int | `80` | The port to use for the REST service |
| service.rest.targetPort | int | `5252` | The port to forward REST requests to on the pod. Also see pod.port |
| service..annotations | object | `{}` | Additional annotations to add to the chronicle-server service |
| service..labels | object | `{}` | Additional labels to add to the chronicle-server service |
| service..port | int | `80` | The port to use for the REST service |
| service..targetPort | int | `5252` | The port to forward REST requests to on the pod. Also see pod.port |
| serviceaccount.annotations | object | `{}` | Additional annotations to add to the chronicle-server serviceaccount |
| serviceaccount.enabled | bool | `false` | |
| serviceaccount.create | bool | `false` | |
| serviceaccount.labels | object | `{}` | Additional labels to add to the chronicle-server serviceaccount |
| storage.persistentVolumeSize | string | `"1Gi"` | |

Expand Down
13 changes: 2 additions & 11 deletions charts/posit-chronicle/ci/complex-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ serviceaccount:
eks.amazonaws.com/role-arn: arn:aws:iam::123123123123123:role/chronicle-serviceaccount-role

service:
rest:
# -- The port to use for the REST service
port: 12345
# -- The port to forward REST requests to on the pod. Also see pod.port
targetPort: 12346
# -- The port to use for the REST service
port: 12345
annotations:
test-annotation: test-service-annotation
labels:
Expand All @@ -26,8 +23,6 @@ pod:
replicas: 4
command: "/bash"
args: ["echo", "hello word"]
rest:
port: 12345
# -- Optional environment variables
env:
- name: "TEST_ENV_VAR"
Expand All @@ -49,7 +44,6 @@ config:
# If https.enabled=true, we will ignore any http
# values and enable https in our config instead
enabled: true
listen: ":443"
key: ""
certificate: ""
localStorage:
Expand All @@ -68,9 +62,6 @@ config:
profiling:
enabled: true
listen: :3030
tracing:
enabled: true
address: ""
logging:
serviceLog: "STDOUT"
serviceLogLevel: "DEBUG"
Expand Down
1 change: 0 additions & 1 deletion charts/posit-chronicle/ci/simple-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ serviceaccount:
eks.amazonaws.com/role-arn: arn:aws:iam::123123123123123:role/chronicle-serviceaccount-role
}


storage:
persistentVolumeSize: 10Gi

Expand Down
2 changes: 1 addition & 1 deletion charts/posit-chronicle/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Generate annotations for various resources
{{ end }}
{{- if .Values.config.metrics.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.pod.rest.port }}"
prometheus.io/port: "{{ .Values.service.targetPort }}"
{{- end }}
{{- end -}}

Expand Down
32 changes: 14 additions & 18 deletions charts/posit-chronicle/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@ data:
# switch between http and https
{{- if .Values.config.https.enabled }}
[HTTPS]
Listen = {{ .Values.config.https.listen }}
Listen = 443
Key = {{ .Values.config.https.key }}
Certificate = {{ .Values.config.https.certificate }}
{{- else}}
[HTTP]
Listen = {{ .Values.config.http.listen }}
Listen = 5252
{{- end }}
[Logging]
ServiceLog = {{ .Values.config.logging.serviceLog }}
ServiceLogLevel = {{ .Values.config.logging.serviceLogLevel }}
ServiceLogFormat = {{ .Values.config.logging.serviceLogFormat }}
[Metrics]
Enabled = {{ .Values.config.metrics.enabled }}
[Profiling]
Enabled = {{ .Values.config.profiling.enabled }}
Listen = 3030
[LocalStorage]
Enabled = {{ .Values.config.localStorage.enabled }}
Location = {{ .Values.config.localStorage.location }}
Expand All @@ -29,21 +41,5 @@ data:
Profile = {{ .Values.config.s3Storage.profile }}
Region = {{ .Values.config.s3Storage.region }}
CompactionEnabled = {{ .Values.config.s3Storage.compactionEnabled }}
[Metrics]
Enabled = {{ .Values.config.metrics.enabled }}
[Profiling]
Enabled = {{ .Values.config.profiling.enabled }}
Listen = {{ .Values.config.profiling.listen }}
[Tracing]
Enabled = {{ .Values.config.tracing.enabled }}
Address = {{ .Values.config.tracing.address }}
[Logging]
ServiceLog = {{ .Values.config.logging.serviceLog }}
ServiceLogLevel = {{ .Values.config.logging.serviceLogLevel }}
ServiceLogFormat = {{ .Values.config.logging.serviceLogFormat }}
---

2 changes: 1 addition & 1 deletion charts/posit-chronicle/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
{{- if .Values.serviceaccount.enabled -}}
{{- if .Values.serviceaccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
17 changes: 11 additions & 6 deletions charts/posit-chronicle/templates/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ spec:
template:
metadata:
labels:
{{- include "posit-chronicle.service.labels" . | trim | nindent 8 }}
{{- include "posit-chronicle.service.selectorLabels" . | trim | nindent 8 }}
{{- include "posit-chronicle.pod.labels" . | trim | nindent 8 }}
{{- include "posit-chronicle.pod.selectorLabels" . | trim | nindent 8 }}
annotations:
{{- include "posit-chronicle.service.annotations" . | trim | nindent 8 }}
{{- include "posit-chronicle.pod.annotations" . | trim | nindent 8 }}
spec:
{{- with .Values.pod.affinity }}
affinity:
Expand All @@ -30,7 +30,7 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceaccount.enabled }}
{{- if .Values.serviceaccount.create }}
serviceAccountName: chronicle-sa
{{- end }}
containers:
Expand All @@ -44,8 +44,13 @@ spec:
{{- toYaml .Values.pod.args | nindent 8 }}
{{- end }}
ports:
- containerPort: {{ .Values.pod.rest.port }}
name: tcp
{{- if .Values.config.https.enabled }}
- containerPort: 443
name: https
{{- else}}
- containerPort: 5252
name: http
{{- end }}
volumeMounts:
- name: data
mountPath: {{ .Values.config.localStorage.location }}
Expand Down
12 changes: 9 additions & 3 deletions charts/posit-chronicle/templates/svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ spec:
selector:
{{- include "posit-chronicle.service.selectorLabels" . | trim | nindent 4 }}
ports:
- port: {{ .Values.service.rest.port }}
targetPort: {{ .Values.service.rest.targetPort }}
name: tcp
{{- if .Values.config.https.enabled }}
- port: {{ .Values.service.port }}
targetPort: 443
name: https
{{- else}}
- port: {{ .Values.service.port }}
targetPort: 5252
name: http
{{- end }}
---
33 changes: 13 additions & 20 deletions charts/posit-chronicle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ image:
imagePullPolicy: "Always"

serviceaccount:
enabled: false
create: false
# -- Additional annotations to add to the chronicle-server serviceaccount
annotations: {
# EKS role arn example
Expand All @@ -14,30 +14,30 @@ serviceaccount:
labels: {}

service:
rest:
# -- The port to use for the REST service
port: 80
# -- The port to forward REST requests to on the pod. Also see pod.port
targetPort: 5252
# -- Additional annotations to add to the chronicle-server service
annotations: {}
# -- Additional labels to add to the chronicle-server service
labels: {}
# -- The port to use for the REST service
port: 80
# -- Additional annotations to add to the chronicle-server service
annotations: {}
# -- Additional labels to add to the chronicle-server service
labels: {}
# -- Additional selector labels to add to the chronicle-server service
selectorLabels: {}

# -- The number of replica pods to maintain for this service
replicas: 1

pod:
# -- The command and args to run in the chronicle-server container
command: "/chronicle"
args: ["start", "-c", "/opt/chronicle/config.gcfg"]
rest:
port: 5252
# -- Optional environment variables
env: []
# -- Additional annotations to add to the chronicle-server pods
annotations: {}
# -- Additional labels to add to the chronicle-server pods
labels: {}
# -- Additional selector labels to add to the chronicle-server pods
selectorLabels: {}
# -- A map used verbatim as the pod's "affinity" definition
affinity: {}
# -- A map used verbatim as the pod's "nodeSelector" definition
Expand All @@ -51,13 +51,10 @@ storage:
persistentVolumeSize: 1Gi

config:
http:
listen: ":5252"
https:
# If https.enabled=true, we will ignore any http
# values and enable https in our config instead
enabled: false
listen: ":443"
key: ""
certificate: ""
localStorage:
Expand All @@ -69,16 +66,12 @@ config:
bucket: "posit-chronicle"
prefix: ""
profile: ""
region: "us-east-2"
region: ""
compactionEnabled: false
metrics:
enabled: true
profiling:
enabled: false
listen: :3030
tracing:
enabled: false
address: ""
logging:
serviceLog: "STDOUT"
serviceLogLevel: "INFO"
Expand Down

0 comments on commit 319a5ac

Please sign in to comment.