Skip to content

kubernetes helm chart: Automatically assign an ordinal index from statefulsets metadata #88

Open
@weideng1

Description

@weideng1

Currently zdm-proxy process expects this env value to be set at start time: ZDM_PROXY_TOPOLOGY_INDEX

I've looked into online discussions, and looks like there is an unresolved issue w.r.t. directly exposing this ordinal index from statefulsets: kubernetes/kubernetes#40651

Before this is fully supported in a future version of k8s, we will have to adopt some ugly workaround by either using initContainers or lifecycle hook like the following:

apiVersion: apps/v1
kind: StatefulSet
spec:
  serviceName: "zdm-proxy"
  replicas: {{ $.Values.proxy.count | int }}
  template:
    spec:
      containers:
      - lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "export STS_INDEX=${HOSTNAME##*-}"]

┆Issue is synchronized with this Jira Task by Unito
┆Components: Proxy
┆Issue Number: ZDM-505

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions