-
Notifications
You must be signed in to change notification settings - Fork 1
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
[scalar-manager] Create the Helm chart for Scalar Manager #254
Changes from 8 commits
7ef77d4
f853e93
3182519
d9991a4
1e1f690
aeb8ee4
819baf3
590d911
5502ca0
b497bb1
b870b5a
b8864eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,17 @@ type: application | |
version: 2.0.0-SNAPSHOT | ||
appVersion: 2.0.0-SNAPSHOT | ||
deprecated: false | ||
icon: https://scalar-labs.com/wp-content/themes/scalar/assets/img/logo_scalar.svg | ||
keywords: | ||
- scalardb | ||
- scalardl | ||
- scalar-manager | ||
- scalar-manager | ||
- scalardb-cluster | ||
- scalardl-ledger | ||
- scalardl-auditor | ||
- scalar-admin-for-kubernetes | ||
home: https://scalar-labs.com/ | ||
sources: | ||
- https://github.com/scalar-labs/scalar-manager | ||
- https://github.com/scalar-labs/scalar-manager-api | ||
- https://github.com/scalar-labs/scalar-manager-web | ||
maintainers: | ||
- name: Takanori Yokoyama | ||
email: [email protected] | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a question. What is the reason why we use In other words, does Scalar Manager access the following resources that need the
|
||
metadata: | ||
name: {{ include "scalar-manager.fullname" . }} | ||
labels: | ||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods", "services", "namespaces", "configmaps", "secrets", "serviceaccounts"] | ||
verbs: ["get", "list", "create", "patch", "delete", "update"] | ||
- apiGroups: ["batch"] | ||
resources: ["cronjobs", "jobs"] | ||
verbs: ["get", "list", "create", "delete"] | ||
- apiGroups: ["apps"] | ||
resources: ["deployments"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["rbac.authorization.k8s.io"] | ||
resources: ["roles", "rolebindings"] | ||
verbs: ["get", "list", "create", "delete"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "scalar-manager.fullname" . }} | ||
labels: | ||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "scalar-manager.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
apiGroup: "" | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ include "scalar-manager.fullname" . }} | ||
apiGroup: rbac.authorization.k8s.io |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a question. I think this ConfigMap is used for storing cluster and pause information. And, it seems that this chart adds Do we need to create this I want to confirm whether Scalar Manager API can create (If Scalar Manager can create There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed, we will update Scalar Manager API to create There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed, we noticed that this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We address this issue on the Scalar Manager API side. |
||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "scalar-manager.fullname" . }}-api-application-properties | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||
data: | ||
scalar-manager-api-application.properties: | ||
{{- toYaml .Values.api.applicationProperties | nindent 4 }} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,74 @@ | ||||||
apiVersion: apps/v1 | ||||||
kind: Deployment | ||||||
metadata: | ||||||
name: {{ include "scalar-manager.fullname" . }} | ||||||
namespace: {{ .Release.Namespace }} | ||||||
labels: | ||||||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||||||
spec: | ||||||
replicas: {{ .Values.replicaCount }} | ||||||
selector: | ||||||
matchLabels: | ||||||
{{- include "scalar-manager.selectorLabels" . | nindent 6 }} | ||||||
template: | ||||||
metadata: | ||||||
annotations: | ||||||
checksum/config: {{ include (print $.Template.BasePath "/scalar-manager/configmap.yaml") . | sha256sum }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this If the above understanding is correct, this So, I think we can remove this annotation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed, we will remove this annotation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed in another comment, we decided to use |
||||||
{{- if .Values.podAnnotations }} | ||||||
{{- toYaml .Values.podAnnotations | nindent 8 }} | ||||||
{{- end }} | ||||||
labels: | ||||||
{{- include "scalar-manager.selectorLabels" . | nindent 8 }} | ||||||
{{- if .Values.podLabels }} | ||||||
{{- toYaml .Values.podLabels | nindent 8 }} | ||||||
{{- end }} | ||||||
spec: | ||||||
restartPolicy: Always | ||||||
serviceAccountName: {{ include "scalar-manager.serviceAccountName" . }} | ||||||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} | ||||||
containers: | ||||||
- name: {{ .Chart.Name }}-api | ||||||
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}" | ||||||
resources: | ||||||
{{- toYaml .Values.api.resources | nindent 12 }} | ||||||
ports: | ||||||
- containerPort: 8080 | ||||||
imagePullPolicy: {{ .Values.api.image.pullPolicy }} | ||||||
securityContext: | ||||||
{{- toYaml .Values.securityContext | nindent 12 }} | ||||||
volumeMounts: | ||||||
- name: api-application-properties-volume | ||||||
mountPath: /app/application.properties | ||||||
subPath: scalar-manager-api-application.properties | ||||||
- name: {{ .Chart.Name }}-web | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If my remembering is correct, Scalar Manager works as follows. +-[Kubernetes Cluster A]---+ +-[Kubernetes Cluster B]---+ +-[Kubernetes Cluster C]---+
| | | | | |
| +--------------------+ | | +--------------------+ | | +--------------------+ |
| | Scalar products | | | | Scalar products | | | | Scalar products | |
| +--------------------+ | | +--------------------+ | | +--------------------+ |
| | | | | |
| +--------------------+ | | +--------------------+ | | +--------------------+ |
| | Scalar Manager API | | | | Scalar Manager API | | | | Scalar Manager API | |
| +--------------------+ | | +--------------------+ | | +--------------------+ |
| | | | | | | | |
+------------+-------------+ +------------+-------------+ +------------+-------------+
| | |
| | |
| | |
+-----------------------------+-----------------------------+
|
|
|
+---------+----------+
| Scalar Manager Web |
+--------------------+ So, we don't need to deploy Vice versa, it would be better to deploy Is my understanding correct? (Sorry, I might miss some Scalar Manager specifications...) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed, at this time, we must deploy |
||||||
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag | default .Chart.AppVersion }}" | ||||||
resources: | ||||||
{{- toYaml .Values.web.resources | nindent 12 }} | ||||||
ports: | ||||||
- containerPort: 3000 | ||||||
imagePullPolicy: {{ .Values.web.image.pullPolicy }} | ||||||
securityContext: | ||||||
runAsUser: 1000 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question 1
Suggested change
It seems that we use Is this UID Question 2It seems that we specify the In this case, I think the Do we really need to specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kota2and3kan 1000 was a typo. It should be Regarding the question 2. I did this because I encountered an issue from creating the container with the
I am not sure if it's because of the USER command in the Dockerfile here https://github.com/scalar-labs/scalar-manager-web/blob/main/Dockerfile#L54 It specifies the user name but not the user ID. I tried to change it locally with
like we did for the API However, my internet is too slow here to finish building the image so I couldn't really test it. Anyway, since it's not a good practice to use I will create a PR in the web repository to specify the user by user ID instead of the user name and try to test it later with better Internet conditions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR using the numeric user ID instead of the user name is submitted in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess the CI failed because of the removal of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @supl As I mentioned on the Scalar Manager Web side, according to the code comment of Kubernetes, it seems that we MUST use |
||||||
{{- toYaml .Values.securityContext | nindent 12 }} | ||||||
volumes: | ||||||
- name: api-application-properties-volume | ||||||
configMap: | ||||||
name: {{ include "scalar-manager.fullname" . }}-api-application-properties | ||||||
securityContext: | ||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||||||
{{- with .Values.imagePullSecrets }} | ||||||
imagePullSecrets: | ||||||
{{- toYaml . | nindent 8 }} | ||||||
{{- end }} | ||||||
{{- with .Values.nodeSelector }} | ||||||
nodeSelector: | ||||||
{{- toYaml . | nindent 8 }} | ||||||
{{- end }} | ||||||
{{- with .Values.affinity }} | ||||||
affinity: | ||||||
{{- toYaml . | nindent 8 }} | ||||||
{{- end }} | ||||||
{{- with .Values.tolerations }} | ||||||
tolerations: | ||||||
{{- toYaml . | nindent 8 }} | ||||||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ include "scalar-manager.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: {{ .Values.scalarManager.port }} | ||
protocol: TCP | ||
name: http | ||
- protocol: TCP | ||
name: web | ||
port: {{ .Values.service.port }} | ||
targetPort: 3000 | ||
selector: | ||
{{- include "scalar-manager.selectorLabels" . | nindent 4 }} |
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 we only have 1.0.0-SNAPSHOT images.
I use 2.0.0-SNAPSHOT here because we will bump the SNAPSHOT images version to 2.0.0 after officially release Scalar Manager.