-
Notifications
You must be signed in to change notification settings - Fork 85
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
ft: Helm chart for backbeat lifecycle #103
Conversation
@rahulreddy do we name the charts backbeat-lifecycle or lifecycle ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the files in charts/backbeat/templates/lifecycle/* ?
See #105
metadata: | ||
name: {{ template "backbeat.fullname" . }}-conductor-lifecycle | ||
labels: | ||
app: {{ template "backbeat.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the app
label should be {{ template "backbeat.name" . }}-lifecycle
?
template: | ||
metadata: | ||
labels: | ||
app: {{ template "backbeat.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
metadata: | ||
name: {{ template "backbeat.fullname" . }}-consumer-lifecycle | ||
labels: | ||
app: {{ template "backbeat.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
template: | ||
metadata: | ||
labels: | ||
app: {{ template "backbeat.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
release: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be best if the container name matches the pod instead of just backbeat
. Like this {{ template "backbeat.fullname" . }}-conductor-lifecycle
release: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this container name.
release: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this container name.
metadata: | ||
name: {{ template "backbeat.fullname" . }}-producer-lifecycle | ||
labels: | ||
app: {{ template "backbeat.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same change here for the app
label.
template: | ||
metadata: | ||
labels: | ||
app: {{ template "backbeat.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be rebased from the master branch. It includes some updates that will make this PR much smaller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the changes in the values file missing?
- name: ZOOKEEPER_AUTO_CREATE_NAMESPACE | ||
value: "1" | ||
- name: ZOOKEEPER_CONNECTION_STRING | ||
value: "{{- printf "%s-zenko-zookeeper:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be zenko-quorum
instead of zenko-zookeeper
.
- name: ZOOKEEPER_CONNECTION_STRING | ||
value: "{{- printf "%s-zenko-zookeeper:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" | ||
- name: KAFKA_HOSTS | ||
value: "{{- printf "%s-kafka-0.%s-kafka:9092" .Release.Name .Release.Name | trunc 63 | trimSuffix "-" -}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zenko-quorum
instead of kafka
.
- name: ZOOKEEPER_AUTO_CREATE_NAMESPACE | ||
value: "1" | ||
- name: ZOOKEEPER_CONNECTION_STRING | ||
value: "{{- printf "%s-zenko-zookeeper:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
- name: ZOOKEEPER_CONNECTION_STRING | ||
value: "{{- printf "%s-zenko-zookeeper:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" | ||
- name: KAFKA_HOSTS | ||
value: "{{- printf "%s-kafka-0.%s-kafka:9092" .Release.Name .Release.Name | trunc 63 | trimSuffix "-" -}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
replicas: {{ .Values.lifecycle.conductor.replicaCount }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since having more than one replica for the conductor will not behave correctly, I would rather hard-code "1" as the value and remove it from values.yml.
value: "{{- printf "%s-zenko-quorum:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" | ||
- name: KAFKA_HOSTS | ||
value: "{{- printf "%s-kafka-0.%s-kafka:9092" .Release.Name .Release.Name | trunc 63 | trimSuffix "-" -}}" | ||
- name: MONGODB_HOSTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lifecycle components do not need access to mongodb so we should get rid of this env var for all.
charts/backbeat/values.yaml
Outdated
interval: 60 | ||
|
||
kafka: | ||
bucket_task_topic: backbeat-lifecycle-bucket-tasks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could make sense to group them into a topics
subsection, and for consistency maybe rename to bucket_tasks_topic
, same for object_tasks_topic
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I think about it, I think it's better not to have the topic names in values.yaml
as those are only for internal use and should not be modified by the admin in normal circumstances (so having them declared with their actual topic name in each chart would be better).
- name: ZOOKEEPER_CONNECTION_STRING | ||
value: "{{- printf "%s-zenko-quorum:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" | ||
- name: KAFKA_HOSTS | ||
value: "{{- printf "%s-kafka-0.%s-kafka:9092" .Release.Name .Release.Name | trunc 63 | trimSuffix "-" -}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to use just the service name now as in "%s-zenko-queue:9092"
release: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: {{ template "backbeat.fullname" . }}-lifecycle-conductor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use long names for containers. Use a descriptive name instead.
value: service-lifecycle | ||
- name: EXTENSIONS_LIFECYCLE_ZOOKEEPER_PATH | ||
value: "{{ .Values.lifecycle.zookeeper.path }}" | ||
- name: EXTENSIONS_LIFECYCLE_BACKLOG_METRICS_ZKPATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the relation between metrics and Zookeeper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is taken from the backbeat config file
"extensions": {
"lifecycle": {
...
"backlogMetrics": {
"zkPath": "/lifecycle/run/backlog-metrics",
....
},
},
}
value: "{{ .Values.lifecycle.kafka.bucket_task_topic }}" | ||
- name: EXTENSIONS_LIFECYCLE_OBJECT_TASK_TOPIC | ||
value: "{{ .Values.lifecycle.kafka.object_task_topic }}" | ||
- name: EXTENSIONS_LIFECYCLE_CONDUCTOR_CRONRULE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are doing cron'y things in our solution, wouldn't it make sense to use Kubernetes' CronJob
objects? @jonathan-gramain @rahulreddy @vrancurel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no particular knowledge of cron jobs in kub but why not since it might be easier to control and visualize, though I think it's better to do this in a next step (more code changes to conductor process than just deployment settings).
tolerations: [] | ||
affinity: {} | ||
|
||
zookeeper: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On one hand, some want to use 'functional' names for objects etc. instead of service names. On the other hand, we use service names in configuration. This is... confusing. And also, hard to change later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to keep them the same as the env vars inside the container. Less specific knowledge would be required to grok it at first glance.
113a615
to
79e954f
Compare
- name: ZOOKEEPER_CONNECTION_STRING | ||
value: "{{- printf "%s-zenko-quorum:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" | ||
- name: KAFKA_HOSTS | ||
value: "{{- printf "%s-zenko-0.%s-queue:9092" .Release.Name .Release.Name | trunc 63 | trimSuffix "-" -}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo. It should look like thisvalue: "{{- printf "%s-zenko-queue:9092" .Release.Name | trunc 63 | trimSuffix "-" -}}"
charts/backbeat/values.yaml
Outdated
@@ -31,6 +31,45 @@ api: | |||
tolerations: [] | |||
affinity: {} | |||
|
|||
lifecycle: | |||
conductor: | |||
replicaCount: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to rebase from master, to not show the changes in charts/value-dev.yml. But the rest looks good. I'll proceed to test it.
- name: EXTENSIONS_LIFECYCLE_BACKLOG_METRICS_INTERVALS | ||
value: "{{ .Values.lifecycle.zookeeper.backlog_metrics.interval }}" | ||
- name: EXTENSIONS_LIFECYCLE_BUCKET_TASK_TOPIC | ||
value: bucket_tasks_topic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual topic name we use is backbeat-lifecycle-bucket-tasks
, should be set here and for other lifecycle components.
- name: EXTENSIONS_LIFECYCLE_BUCKET_TASK_TOPIC | ||
value: bucket_tasks_topic | ||
- name: EXTENSIONS_LIFECYCLE_OBJECT_TASK_TOPIC | ||
value: object_tasks_topic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Topic name is backbeat-lifecycle-object-tasks
Where do we stand on this PR? |
0ae9dbb
to
83c0bb8
Compare
@@ -0,0 +1,74 @@ | |||
apiVersion: extensions/v1beta1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like 3x almost-the-same file. Consider abstracting out the template, parametrize it and run it 3 times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely agree with Nicolas but lets leave that for another PR. I wanted to separate the burden of the refactor and the addition of this feature. We have a ticket ZENKO-388 specifically to do exactly what Nicolas is speaking of. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are 3 silent fixes, but I still approve at this stage of the dev (and knowing there is a refacto after)
@@ -30,6 +30,8 @@ spec: | |||
value: "{{- printf "%s-zenko-quorum:2181" .Release.Name | trunc 63 | trimSuffix "-" -}}" | |||
- name: KAFKA_HOSTS | |||
value: "{{- printf "%s-zenko-queue:9092" .Release.Name | trunc 63 | trimSuffix "-" -}}" | |||
- name: LOG_LEVEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shall be in another PR. we want to avoid silent fixes
@@ -35,6 +35,8 @@ spec: | |||
value: "{{- printf "%s-%s" .Release.Name "redis-ha-master-svc" | trunc 63 | trimSuffix "-" -}}" | |||
- name: REDIS_PORT | |||
value: "6379" | |||
- name: LOG_LEVEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, silent fix => another PR
@@ -44,6 +44,8 @@ spec: | |||
value: "{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}" | |||
- name: REDIS_PORT | |||
value: "6379" | |||
- name: LOG_LEVEL | |||
value: {{ .Values.logging.level }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
silent fix
We are waiting on scality/backbeat#299 before merging. |
c344ede
to
4a1f0cb
Compare
tested manually, bumped into ZENKO-481 |
It looks like bumping to the new cloudserver causes the the CI tests to fail. Is it a regression possibly? |
+ add log level setting support
f6d77aa
to
45cdf5d
Compare
No description provided.