diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8f83d91..5187313 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,12 +1,8 @@ name: Release Charts - -concurrency: release-helm - on: push: branches: - main - jobs: release: permissions: @@ -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 "$GITHUB_ACTOR@users.noreply.github.com" - - - 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/chart-releaser-action@v1.7.0 + with: + charts_dir: 'charts' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Makefile b/Makefile index 9e6dbab..3cde86d 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/charts/marklogic-operator/.helmignore b/charts/marklogic-operator-kubernetes/.helmignore similarity index 100% rename from charts/marklogic-operator/.helmignore rename to charts/marklogic-operator-kubernetes/.helmignore diff --git a/charts/marklogic-operator/Chart.yaml b/charts/marklogic-operator-kubernetes/Chart.yaml similarity index 89% rename from charts/marklogic-operator/Chart.yaml rename to charts/marklogic-operator-kubernetes/Chart.yaml index 8f701f9..6f308e7 100644 --- a/charts/marklogic-operator/Chart.yaml +++ b/charts/marklogic-operator-kubernetes/Chart.yaml @@ -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 @@ -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" diff --git a/charts/marklogic-operator/templates/_helpers.tpl b/charts/marklogic-operator-kubernetes/templates/_helpers.tpl similarity index 67% rename from charts/marklogic-operator/templates/_helpers.tpl rename to charts/marklogic-operator-kubernetes/templates/_helpers.tpl index 7b68e66..cb68149 100644 --- a/charts/marklogic-operator/templates/_helpers.tpl +++ b/charts/marklogic-operator-kubernetes/templates/_helpers.tpl @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/charts/marklogic-operator/templates/deployment.yaml b/charts/marklogic-operator-kubernetes/templates/deployment.yaml similarity index 91% rename from charts/marklogic-operator/templates/deployment.yaml rename to charts/marklogic-operator-kubernetes/templates/deployment.yaml index d295989..6413727 100644 --- a/charts/marklogic-operator/templates/deployment.yaml +++ b/charts/marklogic-operator-kubernetes/templates/deployment.yaml @@ -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: diff --git a/charts/marklogic-operator/templates/leader-election-rbac.yaml b/charts/marklogic-operator-kubernetes/templates/leader-election-rbac.yaml similarity index 89% rename from charts/marklogic-operator/templates/leader-election-rbac.yaml rename to charts/marklogic-operator-kubernetes/templates/leader-election-rbac.yaml index d989b90..1eebac4 100644 --- a/charts/marklogic-operator/templates/leader-election-rbac.yaml +++ b/charts/marklogic-operator-kubernetes/templates/leader-election-rbac.yaml @@ -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: - "" @@ -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 diff --git a/charts/marklogic-operator/templates/manager-rbac.yaml b/charts/marklogic-operator-kubernetes/templates/manager-rbac.yaml similarity index 91% rename from charts/marklogic-operator/templates/manager-rbac.yaml rename to charts/marklogic-operator-kubernetes/templates/manager-rbac.yaml index 24a721d..ca28795 100644 --- a/charts/marklogic-operator/templates/manager-rbac.yaml +++ b/charts/marklogic-operator-kubernetes/templates/manager-rbac.yaml @@ -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: - "" @@ -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 diff --git a/charts/marklogic-operator/templates/marklogiccluster-crd.yaml b/charts/marklogic-operator-kubernetes/templates/marklogiccluster-crd.yaml similarity index 99% rename from charts/marklogic-operator/templates/marklogiccluster-crd.yaml rename to charts/marklogic-operator-kubernetes/templates/marklogiccluster-crd.yaml index 8207131..7758129 100644 --- a/charts/marklogic-operator/templates/marklogiccluster-crd.yaml +++ b/charts/marklogic-operator-kubernetes/templates/marklogiccluster-crd.yaml @@ -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: diff --git a/charts/marklogic-operator/templates/marklogicgroup-crd.yaml b/charts/marklogic-operator-kubernetes/templates/marklogicgroup-crd.yaml similarity index 99% rename from charts/marklogic-operator/templates/marklogicgroup-crd.yaml rename to charts/marklogic-operator-kubernetes/templates/marklogicgroup-crd.yaml index 2fe70b4..d40234e 100644 --- a/charts/marklogic-operator/templates/marklogicgroup-crd.yaml +++ b/charts/marklogic-operator-kubernetes/templates/marklogicgroup-crd.yaml @@ -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: diff --git a/charts/marklogic-operator/templates/metrics-reader-rbac.yaml b/charts/marklogic-operator-kubernetes/templates/metrics-reader-rbac.yaml similarity index 83% rename from charts/marklogic-operator/templates/metrics-reader-rbac.yaml rename to charts/marklogic-operator-kubernetes/templates/metrics-reader-rbac.yaml index cbe4ea0..982f6cf 100644 --- a/charts/marklogic-operator/templates/metrics-reader-rbac.yaml +++ b/charts/marklogic-operator-kubernetes/templates/metrics-reader-rbac.yaml @@ -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 diff --git a/charts/marklogic-operator/templates/metrics-service.yaml b/charts/marklogic-operator-kubernetes/templates/metrics-service.yaml similarity index 76% rename from charts/marklogic-operator/templates/metrics-service.yaml rename to charts/marklogic-operator-kubernetes/templates/metrics-service.yaml index 8f615f4..cd5c42f 100644 --- a/charts/marklogic-operator/templates/metrics-service.yaml +++ b/charts/marklogic-operator-kubernetes/templates/metrics-service.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/marklogic-operator/templates/proxy-rbac.yaml b/charts/marklogic-operator-kubernetes/templates/proxy-rbac.yaml similarity index 87% rename from charts/marklogic-operator/templates/proxy-rbac.yaml rename to charts/marklogic-operator-kubernetes/templates/proxy-rbac.yaml index 38e1aab..0e40e33 100644 --- a/charts/marklogic-operator/templates/proxy-rbac.yaml +++ b/charts/marklogic-operator-kubernetes/templates/proxy-rbac.yaml @@ -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 @@ -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 diff --git a/charts/marklogic-operator/templates/serviceaccount.yaml b/charts/marklogic-operator-kubernetes/templates/serviceaccount.yaml similarity index 83% rename from charts/marklogic-operator/templates/serviceaccount.yaml rename to charts/marklogic-operator-kubernetes/templates/serviceaccount.yaml index 5c76d35..80a559b 100644 --- a/charts/marklogic-operator/templates/serviceaccount.yaml +++ b/charts/marklogic-operator-kubernetes/templates/serviceaccount.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/marklogic-operator/values.yaml b/charts/marklogic-operator-kubernetes/values.yaml similarity index 100% rename from charts/marklogic-operator/values.yaml rename to charts/marklogic-operator-kubernetes/values.yaml