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

Pass json config for additional clusters through to kubeops. #1767

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

absoludity
Copy link
Contributor

With this change, the config map can be easily edited, as it looks like:

apiVersion: v1
data:
  additional-clusters.conf: |-
    [
      {
        "apiServiceURL": "https://second-cluster:6443",
        "certificateAuthorityData": "LS0tLS1CRUdJ...",
        "name": "second-cluster"
      }
    ]
kind: ConfigMap
metadata:
  annotations:
  ...

Ref #1761

With this change, the config map can be easily edited, as it looks like:
```
apiVersion: v1
data:
  additional-clusters.conf: |-
    [
      {
        "apiServiceURL": "https://second-cluster:6443",
        "certificateAuthorityData": "LS0tLS1CRUdJ...",
        "name": "second-cluster"
      }
    ]
kind: ConfigMap
metadata:
  annotations:
  ...
```
@absoludity absoludity requested a review from andresmgot June 4, 2020 06:00
data:
additional-clusters.conf: |-
{{ .Values.featureFlags.additionalClusters | toPrettyJson | indent 4 }}
{{- end -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

you forgot the blank line at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated editor (recently switched back to give vscode another try, so was missing some defaults).

release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
additional-clusters.conf: |-
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 will need the same info for the dashboard, maybe it's better to set this on its config and mount it for kubeops?

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 dashboard won't need the same config, I'll just be including the additional cluster names there (there's no need for ca data or actual api server urls leaving the cluster to be sent to the dashboard, I don't think?)

Copy link
Contributor

Choose a reason for hiding this comment

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

well, yes, but to make sure that we only have one source of truth, I would use the same config (even if there are fields that are not needed there).

@@ -48,6 +48,12 @@ spec:
args:
- --user-agent-comment=kubeapps/{{ .Chart.AppVersion }}
- --assetsvc-url=http://{{ template "kubeapps.assetsvc.fullname" . }}:{{ .Values.assetsvc.service.port }}
{{- if .Values.featureFlags.additionalClusters }}
- --additional-clusters-config-path=/config/additional-clusters.conf
volumeMounts:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would split the volumeMounts in a different if in case we need to mount something else in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I wondered about that, but thought we can do that when needed. Anyway, updated.

Copy link
Contributor Author

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Thanks

data:
additional-clusters.conf: |-
{{ .Values.featureFlags.additionalClusters | toPrettyJson | indent 4 }}
{{- end -}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated editor (recently switched back to give vscode another try, so was missing some defaults).

release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
additional-clusters.conf: |-
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 dashboard won't need the same config, I'll just be including the additional cluster names there (there's no need for ca data or actual api server urls leaving the cluster to be sent to the dashboard, I don't think?)

@@ -48,6 +48,12 @@ spec:
args:
- --user-agent-comment=kubeapps/{{ .Chart.AppVersion }}
- --assetsvc-url=http://{{ template "kubeapps.assetsvc.fullname" . }}:{{ .Values.assetsvc.service.port }}
{{- if .Values.featureFlags.additionalClusters }}
- --additional-clusters-config-path=/config/additional-clusters.conf
volumeMounts:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I wondered about that, but thought we can do that when needed. Anyway, updated.

@absoludity absoludity merged commit c292524 into master Jun 9, 2020
@absoludity absoludity deleted the 1761-multi-cluster-kubeops2 branch June 9, 2020 02:40
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.

2 participants