Skip to content

Commit

Permalink
chore: remove codezero- prefix from components (#12)
Browse files Browse the repository at this point in the history
* chore: remove codezero- prefix from components

* chore: rename CodeZero to Codezero
  • Loading branch information
viters authored Aug 31, 2023
1 parent b5ae5b8 commit c7e0edf
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 195 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Helm charts for CodeZero
# Helm charts for Codezero
2 changes: 1 addition & 1 deletion charts/codezero/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: codezero
description: CodeZero 2.x system for Kubernetes
description: Codezero 2.x system for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
Expand Down
22 changes: 1 addition & 21 deletions charts/codezero/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "codezero.name" -}}
{{- .Values.nameOverride | default .Chart.Name | trunc 63 | trimSuffix "-" -}}
codezero
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "codezero.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- if contains .Values.nameOverride .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/codezero/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "codezero.fullname" . }}
name: {{ include "codezero.name" . }}
data:
spaceID: ""
46 changes: 2 additions & 44 deletions charts/codezero/templates/lb/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
{{- if ne .Release.Namespace "codezero" }}
{{- fail "The CodeZero LB has to be installed in codezero namespace" }}
{{- fail "The Codezero LB has to be installed in codezero namespace" }}
{{- end }}

{{/*
Expand the name of the chart.
*/}}
{{- define "lb.name" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if hasSuffix .Values.lb.name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $name .Values.lb.name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "lb.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if .Values.fullnameOverride }}
{{- $name = .Values.fullnameOverride }}
{{- else }}
{{- if contains $name .Release.Name }}
{{- $name = .Release.Name }}
{{- else }}
{{- $name = printf "%s-%s" .Release.Name $name }}
{{- end }}
{{- end }}
{{- if hasSuffix .Values.lb.name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $name .Values.lb.name | trunc 63 | trimSuffix "-" }}
{{- end }}
loadbalancer
{{- end }}

{{/*
Expand Down Expand Up @@ -77,14 +46,3 @@ checksum/configmap: {{ include (print .Template.BasePath "/lb/configmap.yaml") .
{{ . | toYaml }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "lb.serviceAccountName" -}}
{{- if .Values.lb.serviceAccount.create }}
{{- default (include "lb.fullname" .) .Values.lb.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.lb.serviceAccount.name }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/codezero/templates/lb/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "lb.fullname" . }}
name: {{ include "lb.name" . }}
labels:
{{- include "lb.labels" . | nindent 4 }}
data:
Expand All @@ -21,11 +21,11 @@ data:
default_backend system
backend system
server system codezero-system:8800 check
server system system.codezero:8800 check
frontend orchestrator
bind :8900 ssl crt /etc/ssl/certs/space/server.pem
default_backend orchestrator
backend orchestrator
server orchestrator codezero-orchestrator:8900 check
server orchestrator orchestrator.codezero:8900 check
12 changes: 6 additions & 6 deletions charts/codezero/templates/lb/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "lb.fullname" . }}
name: {{ include "lb.name" . }}
labels:
{{- include "lb.labels" . | nindent 4 }}
spec:
Expand All @@ -16,7 +16,7 @@ spec:
labels:
{{- include "lb.podLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "lb.serviceAccountName" . }}
serviceAccountName: {{ include "lb.name" . }}
securityContext:
{{- toYaml .Values.lb.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -38,15 +38,15 @@ spec:
mountPath: /usr/local/etc/haproxy/haproxy.cfg
subPath: haproxy.cfg
- mountPath: /etc/ssl/certs/space
name: codezero-cert
name: space-cert
readOnly: true
volumes:
- name: haproxy-config
configMap:
name: {{ include "lb.fullname" . }}
- name: codezero-cert
name: {{ include "lb.name" . }}
- name: space-cert
secret:
secretName: codezero-cert
secretName: space-cert
{{- with .Values.lb.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/codezero/templates/lb/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: codezero
name: {{ include "codezero.name" . }}
labels:
{{- include "lb.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/codezero/templates/lb/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "lb.serviceAccountName" . }}
name: {{ include "lb.name" . }}
labels:
{{- include "lb.labels" . | nindent 4 }}
{{- with .Values.lb.serviceAccount.annotations }}
Expand Down
46 changes: 2 additions & 44 deletions charts/codezero/templates/orchestrator/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
{{- if ne .Release.Namespace "codezero" }}
{{- fail "The CodeZero orchestrator has to be installed in codezero namespace" }}
{{- fail "The Codezero orchestrator has to be installed in codezero namespace" }}
{{- end }}

{{/*
Expand the name of the chart.
*/}}
{{- define "orchestrator.name" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if hasSuffix .Values.orchestrator.name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $name .Values.orchestrator.name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "orchestrator.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if .Values.fullnameOverride }}
{{- $name = .Values.fullnameOverride }}
{{- else }}
{{- if contains $name .Release.Name }}
{{- $name = .Release.Name }}
{{- else }}
{{- $name = printf "%s-%s" .Release.Name $name }}
{{- end }}
{{- end }}
{{- if hasSuffix .Values.orchestrator.name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $name .Values.orchestrator.name | trunc 63 | trimSuffix "-" }}
{{- end }}
orchestrator
{{- end }}

{{/*
Expand Down Expand Up @@ -76,14 +45,3 @@ Pod annotations
{{ . | toYaml }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "orchestrator.serviceAccountName" -}}
{{- if .Values.orchestrator.serviceAccount.create }}
{{- default (include "orchestrator.fullname" .) .Values.orchestrator.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.orchestrator.serviceAccount.name }}
{{- end }}
{{- end }}
12 changes: 6 additions & 6 deletions charts/codezero/templates/orchestrator/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "orchestrator.fullname" . }}
name: {{ include "orchestrator.name" . }}
labels:
{{- include "orchestrator.labels" . | nindent 4 }}
spec:
Expand All @@ -16,7 +16,7 @@ spec:
labels:
{{- include "orchestrator.podLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "orchestrator.serviceAccountName" . }}
serviceAccountName: {{ include "orchestrator.name" . }}
securityContext:
{{- toYaml .Values.orchestrator.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -29,7 +29,7 @@ spec:
- name: CZ_SPACE_ID
valueFrom:
configMapKeyRef:
name: {{ include "codezero.fullname" . }}
name: {{ include "codezero.name" . }}
key: spaceID
optional: true
- name: CZ_SPACE_CA_CERT
Expand All @@ -55,12 +55,12 @@ spec:
{{- toYaml .Values.orchestrator.resources | nindent 12 }}
volumeMounts:
- mountPath: /etc/ssl/certs/space
name: codezero-cert
name: space-cert
readOnly: true
volumes:
- name: codezero-cert
- name: space-cert
secret:
secretName: codezero-cert
secretName: space-cert
{{- with .Values.orchestrator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/codezero/templates/orchestrator/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "orchestrator.fullname" . }}
name: {{ include "orchestrator.name" . }}
labels:
{{- include "orchestrator.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/codezero/templates/orchestrator/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "orchestrator.serviceAccountName" . }}
name: {{ include "orchestrator.name" . }}
labels:
{{- include "orchestrator.labels" . | nindent 4 }}
{{- with .Values.orchestrator.serviceAccount.annotations }}
Expand Down
6 changes: 3 additions & 3 deletions charts/codezero/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Namespace }}-crb
name: {{ include "codezero.name" . }}-binding
subjects:
- kind: ServiceAccount
name: {{ include "orchestrator.serviceAccountName" . }}
name: {{ include "orchestrator.name" . }}
namespace: {{ .Release.Namespace }}
- kind: ServiceAccount
name: {{ include "system.serviceAccountName" . }}
name: {{ include "system.name" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down
2 changes: 1 addition & 1 deletion charts/codezero/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "codezero.fullname" . }}-cert
name: space-cert
data: {}
46 changes: 2 additions & 44 deletions charts/codezero/templates/system/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
{{- if ne .Release.Namespace "codezero" }}
{{- fail "The CodeZero system has to be installed in codezero namespace" }}
{{- fail "The Codezero system has to be installed in codezero namespace" }}
{{- end }}

{{/*
Expand the name of the chart.
*/}}
{{- define "system.name" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if hasSuffix .Values.system.name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $name .Values.system.name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "system.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if .Values.fullnameOverride }}
{{- $name = .Values.fullnameOverride }}
{{- else }}
{{- if contains $name .Release.Name }}
{{- $name = .Release.Name }}
{{- else }}
{{- $name = printf "%s-%s" .Release.Name $name }}
{{- end }}
{{- end }}
{{- if hasSuffix .Values.system.name $name }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" $name .Values.system.name | trunc 63 | trimSuffix "-" }}
{{- end }}
system
{{- end }}

{{/*
Expand Down Expand Up @@ -76,14 +45,3 @@ Pod annotations
{{ . | toYaml }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "system.serviceAccountName" -}}
{{- if .Values.system.serviceAccount.create }}
{{- default (include "system.fullname" .) .Values.system.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.system.serviceAccount.name }}
{{- end }}
{{- end }}
Loading

0 comments on commit c7e0edf

Please sign in to comment.