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

ft: Helm chart for backbeat lifecycle #103

Merged
merged 3 commits into from
Jun 15, 2018
Merged

ft: Helm chart for backbeat lifecycle #103

merged 3 commits into from
Jun 15, 2018

Conversation

tmacro
Copy link
Contributor

@tmacro tmacro commented May 17, 2018

No description provided.

@vrancurel
Copy link
Contributor

@rahulreddy do we name the charts backbeat-lifecycle or lifecycle ?

Copy link
Contributor

@vrancurel vrancurel left a 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" . }}
Copy link
Contributor

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" . }}
Copy link
Contributor

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" . }}
Copy link
Contributor

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" . }}
Copy link
Contributor

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 }}
Copy link
Contributor

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 }}
Copy link
Contributor

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 }}
Copy link
Contributor

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" . }}
Copy link
Contributor

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" . }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

@giacomoguiulfo giacomoguiulfo left a 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.

Copy link
Contributor

@giacomoguiulfo giacomoguiulfo left a 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 "-" -}}"
Copy link
Contributor

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 "-" -}}"
Copy link
Contributor

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 "-" -}}"
Copy link
Contributor

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 "-" -}}"
Copy link
Contributor

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 }}
Copy link
Contributor

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
Copy link
Contributor

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.

interval: 60

kafka:
bucket_task_topic: backbeat-lifecycle-bucket-tasks
Copy link
Contributor

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.

Copy link
Contributor

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 "-" -}}"
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

@NicolasT NicolasT May 21, 2018

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

Copy link
Contributor

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:
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@tmacro tmacro force-pushed the ft/ZENKO-300 branch 2 times, most recently from 113a615 to 79e954f Compare May 22, 2018 17:49
- 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 "-" -}}"
Copy link
Contributor

@giacomoguiulfo giacomoguiulfo May 22, 2018

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 "-" -}}"

@@ -31,6 +31,45 @@ api:
tolerations: []
affinity: {}

lifecycle:
conductor:
replicaCount: 1
Copy link
Contributor

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.

Copy link
Contributor

@giacomoguiulfo giacomoguiulfo left a 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
Copy link
Contributor

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
Copy link
Contributor

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

@rahulreddy
Copy link
Collaborator

Where do we stand on this PR?

@jonathan-gramain jonathan-gramain force-pushed the ft/ZENKO-300 branch 3 times, most recently from 0ae9dbb to 83c0bb8 Compare May 24, 2018 20:59
@@ -0,0 +1,74 @@
apiVersion: extensions/v1beta1
Copy link
Contributor

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?

Copy link
Contributor

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. 😄

Copy link
Contributor

@vrancurel vrancurel left a 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
Copy link
Contributor

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
Copy link
Contributor

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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

silent fix

@ssalaues
Copy link
Contributor

We are waiting on scality/backbeat#299 before merging.

@vrancurel
Copy link
Contributor

tested manually, bumped into ZENKO-481

@ssalaues
Copy link
Contributor

It looks like bumping to the new cloudserver causes the the CI tests to fail. Is it a regression possibly?

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 this pull request may close these issues.

7 participants