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

Does not handle spec updates other than size #74

Closed
renier opened this issue Jul 18, 2020 · 0 comments · Fixed by #77
Closed

Does not handle spec updates other than size #74

renier opened this issue Jul 18, 2020 · 0 comments · Fixed by #77

Comments

@renier
Copy link
Contributor

renier commented Jul 18, 2020

The operator doesn't handle any updates to the NatsStreamingCluster spec other than the size setting. So if you update the server version, that won't get passed down to the managed pods. Same with annotations.

The operator does seem to pass down these properties when creating new pods, but if the pods are already running, updates don't take effect. This is a serious lack since it prevents you from managing the streaming server version being run, but it is also important if you are providing the configuration file via a configmap like below, where you want to make sure that the pods are restarted if there are configmap changes upon deploy as recommended here:

---
apiVersion: "streaming.nats.io/v1alpha1"
kind: "NatsStreamingCluster"
metadata:
  name: "stan-cluster"
  namespace: {{ .Values.namespace }}
spec:
  natsSvc: {{ .Values.cluster.name }}
  version: "{{ .Values.stan_version }}"

  size: 3
  configFile: "/etc/stan/config/stan.conf"
  config:
    storeDir: "/pv/stan"
    ftGroup: "stan"

  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "{{ .Values.metrics_port }}"
        checksum/config: {{ include (print $.Template.BasePath "/configs.yaml") . | sha256sum }}

    spec:
      volumes:
      - name: {{ .Values.config_name }}
        configMap:
          name: {{ .Values.config_name }}
      - name: stan-store-dir
        persistentVolumeClaim:
          claimName: {{ .Values.pvc_name }}
      containers:
      - name: nats-streaming
        volumeMounts:
        - mountPath: /etc/stan/config
          name: {{ .Values.config_name }}
          readOnly: true
        - mountPath: /pv
          name: stan-store-dir

      - name: metrics
        image: synadia/prometheus-nats-exporter:0.2.0
        args: ["-connz", "-routez", "-subz", "-varz", "-channelz", "-serverz", "-DV", "http://localhost:8222/"]
        ports:
        - name: metrics
          containerPort: {{ .Values.metrics_port }}
          protocol: TCP

In the case of the version, not even deleting the pods will get them restarted with the updated streaming server version. This works however with the nats operator.

renier added a commit to renier/nats-streaming-operator that referenced this issue Jul 24, 2020
renier added a commit to renier/nats-streaming-operator that referenced this issue Jul 25, 2020
renier added a commit to renier/nats-streaming-operator that referenced this issue Aug 9, 2020
renier added a commit to renier/nats-streaming-operator that referenced this issue Aug 9, 2020
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 a pull request may close this issue.

1 participant