Skip to content

Commit 1475a1b

Browse files
committed
Releasing jfrog registry operator 2.1.0 - Added multi user support
Signed-off-by: oumk <oumk@jfrog.com>
1 parent 1597fb8 commit 1475a1b

39 files changed

+1154
-236
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install Go
3131
uses: actions/setup-go@v3
3232
with:
33-
go-version: 1.20.x
33+
go-version: 1.24.x
3434

3535
- name: Go Cache
3636
uses: actions/cache@v3
@@ -76,7 +76,7 @@ jobs:
7676
- name: Setup Go
7777
uses: actions/setup-go@v3
7878
with:
79-
go-version: 1.20.x
79+
go-version: 1.24.x
8080

8181
- name: Go Cache
8282
uses: actions/cache@v3

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
3131
#
3232
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
3333
# jfrog.com/operator-bundle:$VERSION and jfrog.com/operator-catalog:$VERSION.
34-
IMAGE_TAG_BASE ?= docker.jfrog.io/jfrog/jfrog-registry-operator:2.0.0
34+
IMAGE_TAG_BASE ?= docker.jfrog.io/jfrog/jfrog-registry-operator:2.1.0
3535

3636
# BUNDLE_IMG defines the image:tag used for the bundle.
3737
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
@@ -204,7 +204,7 @@ catalog-build: opm ## Build a catalog image.
204204
## operator
205205
##@ Build multiarch operator binaries
206206
.PHONY: operator
207-
operator: build-operator-linux-amd64 build-operator-linux-arm64
207+
operator: build-operator-linux-amd64 build-operator-linux-arm64
208208
## clean-build
209209
##@ clean the bin directory
210210
.PHONY: clean-build

README.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,38 @@ helm repo update
3838

3939
# decide on the namespace and kubernetes service account name you will want to create
4040
export SERVICE_ACCOUNT_NAME="<service account name>"
41+
42+
# Support for external service accounts has also been added. Users can now utilize an external service account; for this, follow the multi-user installation details relevant to external service accounts.
43+
# Setting SERVICE_ACCOUNT_NAME and ANNOTATIONS is optional for multi-user installations, available from release version 2.1.x.
4144
export ANNOTATIONS="<Role annotation for service account>" # Example: eks.amazonaws.com/role-arn: arn:aws:iam::000000000000:role/jfrog-operator-role
4245
export NAMESPACE="jfrog-operator"
4346

4447
# install JFrog secret rotator operator
4548
helm upgrade --install secretrotator jfrog/jfrog-registry-operator --set "serviceAccount.name=${SERVICE_ACCOUNT_NAME}" --set serviceAccount.annotations=${ANNOTATIONS} --namespace ${NAMESPACE} --create-namespace
4649
```
4750

48-
Once operator is in running state, configure `artifactoryUrl`, `refreshTime`, `namespaceSelector`, and `secretMetadata` in [secretrotator.yaml](https://github.com/jfrog/jfrog-registry-operator/blob/master/charts/jfrog-registry-operator/examples/secretrotator.yaml)
51+
### For multi-user installations, if multiple service accounts need to be created:
52+
```
53+
# In a multi-user scenario, please create all service accounts using the role ARN as an annotation via the Helm chart. This will also update the ClusterRole to grant the necessary permissions to each specific service account.
54+
55+
# Create a custom-values.yaml file with service account details and then install operator.
56+
exchangedServiceAccounts:
57+
- name: "sample-service-account"
58+
namespace: "<NAMESPACE>"
59+
annotations:
60+
eks.amazonaws.com/role-arn: < role arn >
61+
62+
helm upgrade --install secretrotator jfrog/jfrog-registry-operator --create-namespace -f custom-values.yaml -n ${NAMESPACE}
63+
64+
Important Note: After this, you can use the service account name and namespace in custom resources. You may install multiple custom resources with different service account details.
65+
66+
Example:
67+
serviceAccount:
68+
name: "sample-service-account"
69+
namespace: "<NAMESPACE>"
70+
```
71+
72+
Once operator is in running state, configure `artifactoryUrl`, `refreshTime`, `namespaceSelector`, `serviceAccount`, `generatedSecrets`, and `secretMetadata` in [secretrotator.yaml](https://github.com/jfrog/jfrog-registry-operator/blob/master/charts/jfrog-registry-operator/examples/secretrotator.yaml)
4973

5074
Sample Manifest:
5175

@@ -63,12 +87,20 @@ spec:
6387
matchLabels:
6488
kubernetes.io/metadata.name: jfrog-operator
6589
generatedSecrets:
66-
- secretName: token-imagepull-secret
67-
secretType: docker
68-
- secretName: token-generic-secret
69-
secretType: generic
90+
- secretName: token-imagepull-secret
91+
secretType: docker
92+
# - secretName: token-generic-secret
93+
# secretType: generic
7094
artifactoryUrl: "artifactory.example.com"
71-
refreshTime: 1m
95+
refreshTime: 30m
96+
# serviceAccount: # The default name and namespace will be the operator’s service account name and namespace
97+
# name: ""
98+
# namespace: ""
99+
secretMetadata:
100+
annotations:
101+
annotationKey: annotationValue
102+
labels:
103+
labelName: labelValue
72104
security:
73105
enabled: false
74106
secretNamespace:
@@ -97,6 +129,19 @@ kubectl delete -f secretrotator.yaml -n ${NAMESPACE}
97129
kubectl delete crd secretrotators.apps.jfrog.com
98130
```
99131

132+
### Upgrading JFrog Secret Rotator operator
133+
134+
```shell
135+
# update the helm repo
136+
helm repo update
137+
138+
# To upgrade the Custom Resource Definition (CRD), run the following command:
139+
kubectl apply -f https://raw.githubusercontent.com/jfrog/jfrog-registry-operator/refs/heads/master/config/crd/bases/apps.jfrog.com_secretrotators.yaml
140+
141+
# Uninstall the secretrotator using the following command
142+
helm upgrade --install secretrotator jfrog/jfrog-registry-operator --set "serviceAccount.name=${SERVICE_ACCOUNT_NAME}" --set serviceAccount.annotations=${ANNOTATIONS} --namespace ${NAMESPACE} --create-namespace
143+
```
144+
100145
### Check Resources in your cluster
101146

102147
```shell

api/v1alpha1/secretrotator_types.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,18 @@ type SecretRotatorSpec struct {
6363
// ArtifactoryUrl, URL of Artifactory
6464
ArtifactoryUrl string `json:"artifactoryUrl,omitempty"`
6565

66-
// RefreshInterval The time in which the controller should reconcile its objects and recheck namespaces for labels.
66+
// Each target user's ServiceAccount, restricting access to only the specified service accounts and ensuring the role is limited to the jfrog operator service account.
67+
ServiceAccount ServiceAccountDetails `json:"serviceAccount,omitempty"`
68+
69+
// RefreshInterval The time in which the controller should reconcile it's objects and recheck namespaces for labels.
6770
RefreshInterval *metav1.Duration `json:"refreshTime,omitempty"`
6871

6972
// Security holding tls/ssl certificates details
7073
Security SecurityDetails `json:"security,omitempty"`
74+
75+
// AwsRegion holding aws region name
76+
// +optional
77+
AwsRegion string `json:"awsRegion,omitempty"`
7178
}
7279

7380
// GeneratedSecret defines an individual secret to be created
@@ -94,6 +101,14 @@ type SecurityDetails struct {
94101
InsecureSkipVerify bool `default:"false" json:"insecureSkipVerify,omitempty"`
95102
}
96103

104+
// ServiceAccountDetails defines name and namespace of the service account.
105+
type ServiceAccountDetails struct {
106+
// Name of the service account
107+
Name string `default:"false" json:"name,omitempty"`
108+
// Namespace of the service account
109+
Namespace string `json:"namespace,omitempty"`
110+
}
111+
97112
// SecretMetadata defines metadata fields for the ExternalSecret generated by the SecretOperator.
98113
type SecretMetadata struct {
99114
// +optional

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/jfrog-registry-operator/CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# JFrog Secret Rotator Operator Chart Changelog
22
All changes to this chart will be documented in this file.
33

4-
## [2.0.0] - May 19, 2025
4+
## [2.1.0] - May 27, 2025
5+
* Added support for `exchangedServiceAccounts`. Using this, multiple service accounts can be created, which can later be used in `serviceAccount.name` and `serviceAccount.namespace` in the custom resource
6+
* Added permissions for `serviceaccounts` and `serviceaccounts/token` for the target service accounts.
7+
* Removed support for operator-specific service account annotations support. Users can now create custom service accounts or use `exchangedServiceAccounts`.
8+
* The operator's service account requires an optional ARN annotation. If the user does not configure any service account, they will need to update the annotation using `serviceAccount.annotations`
9+
* Removed default labels from the deployment. Customers can now pass the required labels to avoid any duplication with Kustomize. [GH-32](https://github.com/jfrog/jfrog-registry-operator/issues/32)
10+
11+
## [2.0.0] - May 15, 2025
512
*** Important Changes ***
613
* In the custom resource, the introduced `spec.generatedSecrets` configuration typically involves specifying: `secretName` – the name of the Secret to be generated, and `secretType` – the type of Secret to generate (e.g., Docker, Generic)
7-
* Scope : Scope can be anything (Optional)
14+
* Scope: Scope can be anything (Optional)
815
* Note: Currently spec.secretName is supported but going forward this will be deprecated soon.
916

1017
## [1.4.2] - Mar 26, 2025

charts/jfrog-registry-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kubeVersion: ">= 1.19.0-0"
33
type: application
44
name: jfrog-registry-operator
55
home: https://jfrog.com/platform/
6-
version: 2.0.0
6+
version: 2.1.0
77
appVersion: 2.x-SNAPSHOT
88
dependencies:
99
- name: jfrog-common

charts/jfrog-registry-operator/crds/apps.jfrog.com_secretrotators.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ spec:
5151
artifactoryUrl:
5252
description: ArtifactoryUrl, URL of Artifactory
5353
type: string
54+
awsRegion:
55+
description: AwsRegion holding aws region name
56+
type: string
5457
generatedSecrets:
5558
description: GeneratedSecrets defines the secrets to be created
5659
items:
@@ -118,7 +121,7 @@ spec:
118121
x-kubernetes-map-type: atomic
119122
refreshTime:
120123
description: RefreshInterval The time in which the controller should
121-
reconcile its objects and recheck namespaces for labels.
124+
reconcile it's objects and recheck namespaces for labels.
122125
type: string
123126
secretMetadata:
124127
description: |-
@@ -156,6 +159,18 @@ spec:
156159
secretNamespace:
157160
type: string
158161
type: object
162+
serviceAccount:
163+
description: Each target user's ServiceAccount, restricting access
164+
to only the specified service accounts and ensuring the role is
165+
limited to the jfrog operator service account.
166+
properties:
167+
name:
168+
description: Name of the service account
169+
type: string
170+
namespace:
171+
description: Namespace of the service account
172+
type: string
173+
type: object
159174
required:
160175
- namespaceSelector
161176
type: object

charts/jfrog-registry-operator/examples/secretrotator.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ spec:
1010
namespaceSelector:
1111
matchLabels:
1212
kubernetes.io/metadata.name: jfrog-operator
13-
secretName: token-secret
13+
# secretName: token-secret
1414
generatedSecrets:
1515
- secretName: token-imagepull-secret
1616
secretType: docker
17-
- secretName: token-generic-secret
18-
secretType: generic
17+
# - secretName: token-generic-secret
18+
# secretType: generic
1919
artifactoryUrl: ""
2020
refreshTime: 30m
2121
secretMetadata:
@@ -30,4 +30,6 @@ spec:
3030
## NOTE: You can provide either a pair of cert.pem and key.pem, or ca.pem, or all three: cert.pem, key.pem, and ca.pem. But make sure that key needs to same as cert.pem, key.pem, and ca.pem in secret
3131
certificateSecretName:
3232
insecureSkipVerify: false
33-
33+
# serviceAccount: # The default name and namespace will be the operator’s service account name and namespace
34+
# name: ""
35+
# namespace: ""

charts/jfrog-registry-operator/full-values.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ global:
88
image:
99
registry: releases-docker.jfrog.io
1010
repository: jfrog/jfrog-registry-operator
11-
tag: 2.0.0
11+
tag: 2.1.0
1212

1313
pullPolicy: IfNotPresent
1414
# pullSecrets:
@@ -130,13 +130,7 @@ podAnnotations: {}
130130
## @param deploymentLabels jfrog-registry-operator deployment labels. Evaluated as a template
131131
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
132132
##
133-
deploymentLabels:
134-
AutomationCleanupIgnore: "true"
135-
control-plane: controller-manager
136-
app.kubernetes.io/name: namespace
137-
app.kubernetes.io/instance: system
138-
app.kubernetes.io/created-by: artifactory-secrets-rotator
139-
app.kubernetes.io/part-of: artifactory-secrets-rotator
133+
deploymentLabels: {}
140134

141135
## @param priorityClassName Name of the priority class to be used by jfrog-registry-operator pods, priority class needs to be created beforehand
142136
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/

0 commit comments

Comments
 (0)