Skip to content

Commit

Permalink
feat(OSS komoplane): feat(helm-chart): add annotations and labels to …
Browse files Browse the repository at this point in the history
…resources (#51)

* feat: add default labels to ClusterRole and ClusterRoleBinding

* feat: add ability to specify annotations for service

* feat: add ability to specify labels for Ingress, Service & ServiceAccount

* fix: add missing serviceAccount.annotations to values.yaml
  • Loading branch information
komodor-bot committed Jan 14, 2024
1 parent 2c173ef commit 5b924fd
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 17 deletions.
4 changes: 2 additions & 2 deletions charts/komoplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: komoplane
description: Komodor tool to visualize Crossplane
icon: https://raw.githubusercontent.com/komodorio/komoplane/main/pkg/frontend/src/assets/logo.svg

version: 0.1.4
appVersion: "0.1.4"
version: 0.1.5
appVersion: "0.1.5"

# docker build . -t komodorio/komoplane:unstable && kind load docker-image komodorio/komoplane:unstable && helm upgrade --install komoplane charts/komoplane --set image.tag=unstable
4 changes: 4 additions & 0 deletions charts/komoplane/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ spec:
env:
- name: DEBUG
value: {{- ternary " '1'" "" .Values.komoplane.debug }}
- name: KP_MR_CACHE_TTL
value: {{ .Values.komoplane.mrCacheTTL | default "1m" }}
- name: KP_MRD_CACHE_TTL
value: {{ .Values.komoplane.mrdCacheTTL | default "5m" }}
ports:
- name: http
containerPort: 8090
Expand Down
3 changes: 3 additions & 0 deletions charts/komoplane/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ metadata:
name: {{ $fullName }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- with .Values.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/komoplane/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ metadata:
name: {{ include "app.fullname" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- with .Values.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
7 changes: 7 additions & 0 deletions charts/komoplane/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ metadata:
name: {{ include "app.serviceAccountName" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -15,6 +18,8 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "app.serviceAccountName" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
rules:
- apiGroups: ["*"]
resources: ["*"]
Expand All @@ -24,6 +29,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "app.serviceAccountName" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
36 changes: 21 additions & 15 deletions charts/komoplane/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
komoplane:
# Flag for setting environment to debug mode
debug: false
mrCacheTTL: 1m # cache list of MRs for this time
mrdCacheTTL: 5m # cache list of MRDs for this time

replicaCount: 1

image:
Expand All @@ -6,7 +12,7 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
imagePullSecrets: [ ]
nameOverride: ""
fullnameOverride: ""

Expand All @@ -16,6 +22,8 @@ serviceAccount:
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
annotations: { }
labels: { }

resources:
requests:
Expand All @@ -25,11 +33,6 @@ resources:
cpu: 1
memory: 1Gi

komoplane:
# Flag for setting environment to debug mode
debug: false



## @param.updateStrategy.type Set up update strategy for installation.
## Set to Recreate if you use persistent volume that cannot be mounted by more than one pods to make sure the pods is destroyed first.
Expand All @@ -45,10 +48,10 @@ updateStrategy:
type: RollingUpdate


podLabels: {}
podAnnotations: {}
podLabels: { }
podAnnotations: { }

podSecurityContext:
podSecurityContext:
fsGroup: 2000

securityContext:
Expand All @@ -57,35 +60,38 @@ securityContext:
runAsUser: 1000
capabilities:
drop:
- ALL
- ALL

service:
type: ClusterIP
port: 8090
annotations: { }
labels: { }

ingress:
enabled: false
className: ""
annotations: {}
annotations: { }
labels: { }
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
tls: [ ]

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80

nodeSelector: {}
nodeSelector: { }

extraArgs:
- --bind=0.0.0.0

tolerations: []
tolerations: [ ]

affinity: {}
affinity: { }

0 comments on commit 5b924fd

Please sign in to comment.