Skip to content

Commit

Permalink
fix: Single chart
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Dec 13, 2022
1 parent 35b1ec0 commit 1f86eaf
Show file tree
Hide file tree
Showing 22 changed files with 113 additions and 234 deletions.
23 changes: 0 additions & 23 deletions charts/ledger-agent/.helmignore

This file was deleted.

15 changes: 0 additions & 15 deletions charts/ledger-agent/Chart.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions charts/ledger-agent/templates/_helpers.tpl

This file was deleted.

14 changes: 0 additions & 14 deletions charts/ledger-agent/templates/role.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions charts/ledger-agent/templates/rolebinding.yaml

This file was deleted.

73 changes: 0 additions & 73 deletions charts/ledger-agent/values.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
{{- if .Values.ledgerAgent.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ledger-agent.fullname" . }}
name: {{ include "ledger.fullname" . }}-agent
labels:
{{- include "ledger-agent.labels" . | nindent 4 }}
{{- include "ledger.labels" . | nindent 4 }}
component: agent
spec:
replicas: 1
selector:
matchLabels:
{{- include "ledger-agent.selectorLabels" . | nindent 6 }}
{{- include "ledger.selectorLabels" . | nindent 6 }}
component: agent
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
checksum/secret: {{ include (print $.Template.BasePath "/agent_secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "ledger-agent.selectorLabels" . | nindent 8 }}
{{- include "ledger.selectorLabels" . | nindent 8 }}
component: agent
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ledger-agent.serviceAccountName" . }}
serviceAccountName: {{ include "ledger.serviceAccountName" . }}-agent
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -39,12 +44,14 @@ spec:
valueFrom:
secretKeyRef:
key: endpoint
name: {{ include "ledger-agent.fullname" . }}
name: {{ include "ledger.fullname" . }}-agent
- name: TOKEN
valueFrom:
secretKeyRef:
key: token
name: {{ include "ledger-agent.fullname" . }}
name: {{ include "ledger.fullname" . }}-agent
- name: LEDGER_NAMESPACE
value: {{ .Values.ledgerAgent.namespaced ? .Release.Namespace : "" }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -57,3 +64,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/ledger/templates/agent_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.ledgerAgent.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "ledger.fullname" . }}-agent
labels:
{{- include "ledger.labels" . | nindent 4 }}
component: agent
rules:
- apiGroups:
- "apps"
resources:
- deployments
- statefulsets
verbs:
- watch
{{- end }}
17 changes: 17 additions & 0 deletions charts/ledger/templates/agent_rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.ledgerAgent.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "ledger.fullname" . }}
labels:
{{- include "ledger.labels" . | nindent 4 }}
component: agent
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "ledger.fullname" . }}-agent
subjects:
- kind: ServiceAccount
name: {{ include "ledger.serviceAccountName" . }}-agent
namespace: {{ .Release.Namespace }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{{- if .Values.ledgerAgent.enabled -}}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ include "ledger-agent.fullname" . }}
name: {{ include "ledger.fullname" . }}-agent
labels:
{{- include "ledger-agent.labels" . | nindent 4 }}
{{- include "ledger.labels" . | nindent 4 }}
component: agent
data:
endpoint: {{ .Values.ledgerAgent.endpoint | b64enc }}
token: {{ .Values.ledgerAgent.token | b64enc }}
log-level: {{ .Values.ledgerAgent.log.level | b64enc }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{- if .Values.ledgerAgent.enabled -}}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "ledger-agent.serviceAccountName" . }}
name: {{ include "ledger.serviceAccountName" . }}-agent
labels:
{{- include "ledger-agent.labels" . | nindent 4 }}
{{- include "ledger.labels" . | nindent 4 }}
component: agent
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
13 changes: 0 additions & 13 deletions charts/ledger/templates/secret.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{{- if .Values.ledgerServer.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ledger.fullname" . }}
labels:
{{- include "ledger.labels" . | nindent 4 }}
component: server
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "ledger.selectorLabels" . | nindent 6 }}
component: server
template:
metadata:
annotations:
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/server_secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "ledger.selectorLabels" . | nindent 8 }}
component: server
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -86,3 +90,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Loading

0 comments on commit 1f86eaf

Please sign in to comment.