Skip to content

Commit

Permalink
helm: rename charts folder as charts/simple-cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsalvador committed Nov 1, 2023
1 parent ddb37eb commit b766d4f
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ $(MISSPELL): $(LOCALBIN)

.PHONY: helm
helm: manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY) -crd-dir charts
$(KUSTOMIZE) build config/default | $(HELMIFY) -crd-dir charts/simple-cicd
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "charts.name" -}}
{{- define "simple-cicd.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- 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 "charts.fullname" -}}
{{- define "simple-cicd.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -23,39 +15,27 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "charts.chart" -}}
{{- define "simple-cicd.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "charts.labels" -}}
helm.sh/chart: {{ include "charts.chart" . }}
{{ include "charts.selectorLabels" . }}
{{- define "simple-cicd.labels" -}}
helm.sh/chart: {{ include "simple-cicd.chart" . }}
{{ include "simple-cicd.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "charts.selectorLabels" -}}
app.kubernetes.io/name: {{ include "charts.name" . }}
{{- define "simple-cicd.selectorLabels" -}}
app.kubernetes.io/name: {{ include "simple-cicd.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "charts.serviceAccountName" -}}
{{- define "simple-cicd.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "charts.fullname" .) .Values.serviceAccount.name }}
{{- default (include "simple-cicd.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "charts.fullname" . }}-controller-manager
name: {{ include "simple-cicd.fullname" . }}-controller-manager
labels:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
control-plane: controller-manager
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
spec:
type: {{ .Values.controllerManager.type }}
selector:
control-plane: controller-manager
{{- include "charts.selectorLabels" . | nindent 4 }}
{{- include "simple-cicd.selectorLabels" . | nindent 4 }}
ports:
{{- .Values.controllerManager.ports | toYaml | nindent 2 -}}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "charts.fullname" . }}-controller-manager
name: {{ include "simple-cicd.fullname" . }}-controller-manager
labels:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
control-plane: controller-manager
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.controllerManager.replicas }}
selector:
matchLabels:
control-plane: controller-manager
{{- include "charts.selectorLabels" . | nindent 6 }}
{{- include "simple-cicd.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
control-plane: controller-manager
{{- include "charts.selectorLabels" . | nindent 8 }}
{{- include "simple-cicd.selectorLabels" . | nindent 8 }}
annotations:
kubectl.kubernetes.io/default-container: manager
spec:
Expand Down Expand Up @@ -87,5 +87,5 @@ spec:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
serviceAccountName: {{ include "charts.fullname" . }}-controller-manager
serviceAccountName: {{ include "simple-cicd.fullname" . }}-controller-manager
terminationGracePeriodSeconds: 10
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "charts.fullname" . }}-leader-election-role
name: {{ include "simple-cicd.fullname" . }}-leader-election-role
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -43,17 +43,17 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "charts.fullname" . }}-leader-election-rolebinding
name: {{ include "simple-cicd.fullname" . }}-leader-election-rolebinding
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: '{{ include "charts.fullname" . }}-leader-election-role'
name: '{{ include "simple-cicd.fullname" . }}-leader-election-role'
subjects:
- kind: ServiceAccount
name: '{{ include "charts.fullname" . }}-controller-manager'
name: '{{ include "simple-cicd.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "charts.fullname" . }}-manager-role
name: {{ include "simple-cicd.fullname" . }}-manager-role
labels:
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
rules:
- apiGroups:
- batch
Expand Down Expand Up @@ -77,17 +77,17 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "charts.fullname" . }}-manager-rolebinding
name: {{ include "simple-cicd.fullname" . }}-manager-rolebinding
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "charts.fullname" . }}-manager-role'
name: '{{ include "simple-cicd.fullname" . }}-manager-role'
subjects:
- kind: ServiceAccount
name: '{{ include "charts.fullname" . }}-controller-manager'
name: '{{ include "simple-cicd.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "charts.fullname" . }}-metrics-reader
name: {{ include "simple-cicd.fullname" . }}-metrics-reader
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
rules:
- nonResourceURLs:
- /metrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "charts.fullname" . }}-controller-manager-metrics-service
name: {{ include "simple-cicd.fullname" . }}-controller-manager-metrics-service
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
control-plane: controller-manager
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
spec:
type: {{ .Values.metricsService.type }}
selector:
control-plane: controller-manager
{{- include "charts.selectorLabels" . | nindent 4 }}
{{- include "simple-cicd.selectorLabels" . | nindent 4 }}
ports:
{{- .Values.metricsService.ports | toYaml | nindent 2 -}}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "charts.fullname" . }}-proxy-role
name: {{ include "simple-cicd.fullname" . }}-proxy-role
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
rules:
- apiGroups:
- authentication.k8s.io
Expand All @@ -24,17 +24,17 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "charts.fullname" . }}-proxy-rolebinding
name: {{ include "simple-cicd.fullname" . }}-proxy-rolebinding
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "charts.fullname" . }}-proxy-role'
name: '{{ include "simple-cicd.fullname" . }}-proxy-role'
subjects:
- kind: ServiceAccount
name: '{{ include "charts.fullname" . }}-controller-manager'
name: '{{ include "simple-cicd.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "charts.fullname" . }}-controller-manager
name: {{ include "simple-cicd.fullname" . }}-controller-manager
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: simple-cicd
app.kubernetes.io/part-of: simple-cicd
{{- include "charts.labels" . | nindent 4 }}
{{- include "simple-cicd.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }}
File renamed without changes.

0 comments on commit b766d4f

Please sign in to comment.