Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 7 additions & 37 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: Release Charts

concurrency: release-helm

on:
push:
branches:
- main

jobs:
release:
permissions:
Expand All @@ -16,41 +12,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
path: 'src'
ref: 'main'
fetch-depth: 0

- name: Checkout
uses: actions/checkout@v3
with:
path: 'dest'
ref: 'gh-pages'
fetch-depth: 0

- name: Configure Git
run: |
cd dest
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"

- name: Install Helm
uses: azure/setup-helm@v4

- name: Package Helm Charts
shell: bash
run: |
find src/charts/ -type f -name 'Chart.yaml' | sed -r 's|/[^/]+$||' | sort | uniq | xargs -L 1 helm dep up
for d in src/charts/*/ ; do
echo "$d"
helm package "$d" -u -d dest
done

- name: Push New Files
shell: bash
working-directory: dest
run: |
helm repo index . --url https://raw.githubusercontent.com/marklogic/marklogic-operator-kubernetes/gh-pages/
git add $(git ls-files -o --exclude-standard)
git add index.yaml
git commit -m "Updated from ref: $GITHUB_SHA"
git push
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: 'charts'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ $(HELMIFY): $(LOCALBIN)
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@latest

helm: manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY) -image-pull-secrets -original-name charts/marklogic-operator
$(KUSTOMIZE) build config/default | $(HELMIFY) -image-pull-secrets -original-name charts/marklogic-operator-kubernetes

.PHONY: image-scan
image-scan: docker-build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: marklogic-operator
description: A Helm chart for MarkLogic Operator
name: marklogic-operator-kubernetes
description: A Helm chart for MarkLogic Operator for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand All @@ -18,4 +18,4 @@ version: 1.0.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 1.0.0
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "marklogic-operator.name" -}}
{{- define "marklogic-operator-kubernetes.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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 "marklogic-operator.fullname" -}}
{{- define "marklogic-operator-kubernetes.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "marklogic-operator.chart" -}}
{{- define "marklogic-operator-kubernetes.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "marklogic-operator.labels" -}}
helm.sh/chart: {{ include "marklogic-operator.chart" . }}
{{ include "marklogic-operator.selectorLabels" . }}
{{- define "marklogic-operator-kubernetes.labels" -}}
helm.sh/chart: {{ include "marklogic-operator-kubernetes.chart" . }}
{{ include "marklogic-operator-kubernetes.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "marklogic-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "marklogic-operator.name" . }}
{{- define "marklogic-operator-kubernetes.selectorLabels" -}}
app.kubernetes.io/name: {{ include "marklogic-operator-kubernetes.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "marklogic-operator.serviceAccountName" -}}
{{- define "marklogic-operator-kubernetes.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "marklogic-operator.fullname" .) .Values.serviceAccount.name }}
{{- default (include "marklogic-operator-kubernetes.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ metadata:
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
control-plane: controller-manager
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.controllerManager.replicas }}
selector:
matchLabels:
control-plane: controller-manager
{{- include "marklogic-operator.selectorLabels" . | nindent 6 }}
{{- include "marklogic-operator-kubernetes.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
control-plane: controller-manager
{{- include "marklogic-operator.selectorLabels" . | nindent 8 }}
{{- include "marklogic-operator-kubernetes.selectorLabels" . | nindent 8 }}
annotations:
kubectl.kubernetes.io/default-container: manager
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -48,7 +48,7 @@ metadata:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRole
metadata:
name: marklogic-operator-manager-role
labels:
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -85,7 +85,7 @@ metadata:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.1
labels:
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
spec:
group: database.marklogic.com
names:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.1
labels:
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
spec:
group: database.marklogic.com
names:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
rules:
- nonResourceURLs:
- /metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ metadata:
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
control-plane: controller-manager
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
spec:
type: {{ .Values.metricsService.type }}
selector:
control-plane: controller-manager
{{- include "marklogic-operator.selectorLabels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.selectorLabels" . | nindent 4 }}
ports:
{{- .Values.metricsService.ports | toYaml | nindent 2 }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
rules:
- apiGroups:
- authentication.k8s.io
Expand All @@ -29,7 +29,7 @@ metadata:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: marklogic-operator-kubernetes
app.kubernetes.io/part-of: marklogic-operator-kubernetes
{{- include "marklogic-operator.labels" . | nindent 4 }}
{{- include "marklogic-operator-kubernetes.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }}