Skip to content

Commit d6b6691

Browse files
authored
Merge 52443ce into 779a221
2 parents 779a221 + 52443ce commit d6b6691

File tree

15 files changed

+861
-87
lines changed

15 files changed

+861
-87
lines changed

.github/workflows/keyfactor-bootstrap-workflow.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313

1414
build:
15-
name: Build and Lint
15+
name: Build and Check CRDs
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 8
1818
steps:
@@ -23,11 +23,17 @@ jobs:
2323
cache: true
2424
- run: go mod download
2525
- run: go build -v ./cmd/main.go
26+
- name: Regenerate CRDs
27+
run: make generate manifests
28+
- name: Check for CRD drift
29+
run: |
30+
git diff --compact-summary --exit-code || \
31+
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate manifests' and commit."; exit 1)
2632
# - name: Run linters
2733
# uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
2834
# with:
2935
# version: latest
30-
36+
3137
test:
3238
name: Go Test
3339
needs: build

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v2.3.3
2+
## Features
3+
- Add a `healthcheck` specification to Issuer / ClusterIssuer resources, allowing flexibility in the health check interval.
4+
15
# v2.3.1
26
## Fixes
37
- Add a manual dispatch of Helm chart release.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
251251
| ownerRoleName | The name of the security role assigned as the certificate owner. The security role must be assigned to the identity context of the issuer. If `ownerRoleId` and `ownerRoleName` are both specified, `ownerRoleId` will take precedence. This field is **required** if the enrollment pattern, certificate template, or system-wide setting requires it. |
252252
| scopes | (Optional) Required if using ambient credentials with Azure AKS. If using ambient credentials, these scopes will be put on the access token generated by the ambient credentials' token provider, if applicable. |
253253
| audience | (Optional) If using ambient credentials, this audience will be put on the access token generated by the ambient credentials' token provider, if applicable. Google's ambient credential token provider generates an OIDC ID Token. If this value is not provided, it will default to `command`. |
254+
| healthCheckIntervalSeconds | (Optional) Defines the health check interval, in seconds, for a healthy issuer. If ommitted, defaults to 60 seconds. If set to 0, it will disable the health check. If there is a failure when running the health check, it will retry in 10 seconds with an exponential backoff strategy. Value must not be negative. |
254255
255256
> If a different combination of hostname/certificate authority/certificate template is required, a new Issuer or ClusterIssuer resource must be created. Each resource instantiation represents a single configuration.
256257
@@ -282,6 +283,7 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
282283
# ownerRoleName: "$OWNER_ROLE_NAME" # Uncomment if required
283284
# scopes: "openid email https://example.com/.default" # Uncomment if required
284285
# audience: "https://your-command-url.com" # Uncomment if desired
286+
# healthCheckIntervalSeconds: 60 # Uncomment if desired. Setting to 0 disables health check.
285287
EOF
286288
287289
kubectl -n default apply -f issuer.yaml
@@ -312,6 +314,7 @@ For example, ClusterIssuer resources can be used to issue certificates for resou
312314
# ownerRoleName: "$OWNER_ROLE_NAME" # Uncomment if required
313315
# scopes: "openid email https://example.com/.default" # Uncomment if required
314316
# audience: "https://your-command-url.com" # Uncomment if desired
317+
# healthCheckIntervalSeconds: 60 # Uncomment if desired. Setting to 0 disables health check.
315318
EOF
316319
317320
kubectl apply -f clusterissuer.yaml

api/v1alpha1/issuer_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ type IssuerSpec struct {
4646
// +kubebuilder:default:=KeyfactorAPI
4747
APIPath string `json:"apiPath,omitempty"`
4848

49+
// The healthcheck configuration for the issuer. This configures the frequency at which the issuer will perform
50+
// a health check to determine issuer's connectivity to Command instance.
51+
// +kubebuilder:validation:Optional
52+
HealthCheck *HealthCheckConfig `json:"healthcheck,omitempty"`
53+
4954
// EnrollmentPatternId is the ID of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
5055
// If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
5156
// If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
@@ -279,6 +284,15 @@ const (
279284
ConditionUnknown ConditionStatus = "Unknown"
280285
)
281286

287+
type HealthCheckConfig struct {
288+
// Determines whether to the health check when the issuer is healthy. Default: true
289+
Enabled bool `json:"enabled"`
290+
291+
// The interval at which to health check the issuer when healthy. Defaults to 1 minute. Must not be less than "30s".
292+
// +kubebuilder:validation:Optional
293+
Interval *metav1.Duration `json:"interval"`
294+
}
295+
282296
func init() {
283297
SchemeBuilder.Register(&Issuer{}, &IssuerList{})
284298
}

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/command-issuer.keyfactor.com_clusterissuers.yaml

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,58 +68,74 @@ spec:
6868
CertificateAuthorityLogicalName is the logical name of the certificate authority to use
6969
E.g. "Keyfactor Root CA" or "Intermediate CA"
7070
type: string
71+
certificateTemplate:
72+
description: |-
73+
Deprecated. CertificateTemplate is the name of the certificate template to use. If using Keyfactor Command 25.1 or later, use EnrollmentPatternName or EnrollmentPatternId instead.
74+
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
75+
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
76+
Refer to the Keyfactor Command documentation for more information.
77+
type: string
78+
commandSecretName:
79+
description: |-
80+
A reference to a K8s kubernetes.io/basic-auth Secret containing basic auth
81+
credentials for the Command instance configured in Hostname. The secret must
82+
be in the same namespace as the referent. If the
83+
referent is a ClusterIssuer, the reference instead refers to the resource
84+
with the given name in the configured 'cluster resource namespace', which
85+
is set as a flag on the controller component (and defaults to the
86+
namespace that the controller runs in).
87+
type: string
7188
enrollmentPatternId:
7289
description: |-
7390
EnrollmentPatternId is the ID of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
7491
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
75-
If both enrollmentPatternId and enrollmentPatternName are specified, enrollmentPatternId will take precedence.
92+
If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
7693
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
7794
Refer to the Keyfactor Command documentation for more information.
78-
type: integer
7995
format: int32
96+
type: integer
8097
enrollmentPatternName:
8198
description: |-
8299
EnrollmentPatternName is the name of the enrollment pattern to use. Supported in Keyfactor Command 25.1 and later.
83100
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
84-
If both enrollmentPatternId and enrollmentPatternName are specified, enrollmentPatternId will take precedence.
101+
If EnrollmentPatternId and EnrollmentPatternName are both specified, EnrollmentPatternId will take precedence.
85102
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
86103
Refer to the Keyfactor Command documentation for more information.
87104
type: string
105+
healthcheck:
106+
description: |-
107+
The healthcheck configuration for the issuer. This configures the frequency at which the issuer will perform
108+
a health check to determine issuer's connectivity to Command instance.
109+
properties:
110+
enabled:
111+
description: 'Determines whether to the health check when the
112+
issuer is healthy. Default: true'
113+
type: boolean
114+
interval:
115+
description: The interval at which to health check the issuer
116+
when healthy. Defaults to 1 minute. Must not be less than "30s".
117+
type: string
118+
required:
119+
- enabled
120+
type: object
121+
hostname:
122+
description: Hostname is the hostname of a Keyfactor Command instance.
123+
type: string
88124
ownerRoleId:
89125
description: |-
90126
OwnerRoleId is the ID of the security role assigned as the certificate owner.
91127
The specified security role must be assigned to the authorized identity context.
92128
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
93129
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
94-
type: integer
95130
format: int32
131+
type: integer
96132
ownerRoleName:
97133
description: |-
98134
OwnerRoleName is the name of the security role assigned as the certificate owner. This name must match the existing name of the security role.
99135
The specified security role must be assigned to the authorized identity context.
100136
If OwnerRoleId and OwnerRoleName are both specified, OwnerRoleId will take precedence.
101137
This field is required if the enrollment pattern, certificate template, or system-wide settings has been configured as Required.
102138
type: string
103-
certificateTemplate:
104-
description: |-
105-
CertificateTemplate is the name of the certificate template to use. Deprecated in favor of EnrollmentPattern as of Keyfactor Command 25.1.
106-
If both enrollment pattern and certificate template are specified, enrollment pattern will take precedence.
107-
Enrollment will fail if the specified template is not compatible with the enrollment pattern.
108-
Refer to the Keyfactor Command documentation for more information.
109-
type: string
110-
commandSecretName:
111-
description: |-
112-
A reference to a K8s kubernetes.io/basic-auth Secret containing basic auth
113-
credentials for the Command instance configured in Hostname. The secret must
114-
be in the same namespace as the referent. If the
115-
referent is a ClusterIssuer, the reference instead refers to the resource
116-
with the given name in the configured 'cluster resource namespace', which
117-
is set as a flag on the controller component (and defaults to the
118-
namespace that the controller runs in).
119-
type: string
120-
hostname:
121-
description: Hostname is the hostname of a Keyfactor Command instance.
122-
type: string
123139
scopes:
124140
description: |-
125141
A list of comma separated scopes used when requesting a Bearer token from an ambient token provider implied

0 commit comments

Comments
 (0)