Skip to content

Commit ac6affb

Browse files
Merge pull request #1676 from terricain/trust_manager_target_annotations
Added target metadata examples for trust-manager
2 parents 14c7238 + 8cfb399 commit ac6affb

File tree

4 files changed

+145
-27
lines changed

4 files changed

+145
-27
lines changed

content/docs/trust/trust-manager/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ spec:
104104
# here named "bundle.jks" and "bundle.p12".
105105
configMap:
106106
key: "root-certs.pem"
107+
metadata:
108+
annotations:
109+
argocd.argoproj.io/sync-wave: "1"
110+
labels:
111+
app.kubernetes.io/component: "trust-bundle"
107112
additionalFormats:
108113
jks:
109114
key: "bundle.jks"
@@ -146,6 +151,8 @@ Support for `Secret` targets must be explicitly enabled in the trust-manager con
146151
All `Bundle` targets are written to `ConfigMap`s (and/or `Secret`s) whose name matches that of the
147152
`Bundle`, and every target has a PEM-formatted bundle included.
148153

154+
The annotations and labels for the target `ConfigMap`s (and/or `Secret`s) can be specified using `spec.target.configMap.metadata.annotations` and `spec.target.configMap.metadata.labels` (swapping `secret` for `configMap` where appropriate).
155+
149156
Users can also optionally choose to write JKS/PKCS#12 formatted binary trust store(s) to targets.
150157
JKS has been supported since v0.5.0, and PKCS#12 since v0.7.0.
151158

content/docs/trust/trust-manager/api-reference.md

Lines changed: 130 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ AdditionalFormats specifies any additional formats to write to the target
516516
JKS requests a JKS-formatted binary trust bundle to be written to the target.
517517
The bundle has "changeit" as the default password.
518518
For more information refer to this link https://cert-manager.io/docs/faq/#keystore-passwords
519+
Deprecated: Writing JKS is subject for removal. Please migrate to PKCS12.
520+
PKCS#12 trust stores created by trust-manager are compatible with Java.
519521
<br/>
520522
</td>
521523
<td>false</td>
@@ -524,7 +526,9 @@ For more information refer to this link https://cert-manager.io/docs/faq/#keysto
524526
<td>object</td>
525527
<td>
526528
PKCS12 requests a PKCS12-formatted binary trust bundle to be written to the target.
529+
527530
The bundle is by default created without a password.
531+
For more information refer to this link https://cert-manager.io/docs/faq/#keystore-passwords
528532
<br/>
529533
</td>
530534
<td>false</td>
@@ -538,6 +542,8 @@ The bundle is by default created without a password.
538542
JKS requests a JKS-formatted binary trust bundle to be written to the target.
539543
The bundle has "changeit" as the default password.
540544
For more information refer to this link https://cert-manager.io/docs/faq/#keystore-passwords
545+
Deprecated: Writing JKS is subject for removal. Please migrate to PKCS12.
546+
PKCS#12 trust stores created by trust-manager are compatible with Java.
541547

542548
<table>
543549
<thead>
@@ -574,7 +580,9 @@ For more information refer to this link https://cert-manager.io/docs/faq/#keysto
574580

575581

576582
PKCS12 requests a PKCS12-formatted binary trust bundle to be written to the target.
583+
577584
The bundle is by default created without a password.
585+
For more information refer to this link https://cert-manager.io/docs/faq/#keystore-passwords
578586

579587
<table>
580588
<thead>
@@ -603,6 +611,24 @@ The bundle is by default created without a password.
603611
<i>Default</i>: <br/>
604612
</td>
605613
<td>false</td>
614+
</tr><tr>
615+
<td><b>profile</b></td>
616+
<td>enum</td>
617+
<td>
618+
Profile specifies the certificate encryption algorithms and the HMAC algorithm
619+
used to create the PKCS12 trust store.
620+
621+
If provided, allowed values are:
622+
`LegacyRC2`: Deprecated. Not supported by default in OpenSSL 3 or Java 20.
623+
`LegacyDES`: Less secure algorithm. Use this option for maximal compatibility.
624+
`Modern2023`: Secure algorithm. Use this option in case you have to always use secure algorithms (e.g. because of company policy).
625+
626+
Default value is `LegacyRC2` for backward compatibility.
627+
<br/>
628+
<br/>
629+
<i>Enum</i>: LegacyRC2, LegacyDES, Modern2023<br/>
630+
</td>
631+
<td>false</td>
606632
</tr></tbody>
607633
</table>
608634

@@ -630,6 +656,48 @@ data will be synced to.
630656
<br/>
631657
</td>
632658
<td>true</td>
659+
</tr><tr>
660+
<td><b><a href="#bundlespectargetconfigmapmetadata">metadata</a></b></td>
661+
<td>object</td>
662+
<td>
663+
Metadata is an optional set of labels and annotations to be copied to the target.
664+
<br/>
665+
</td>
666+
<td>false</td>
667+
</tr></tbody>
668+
</table>
669+
670+
671+
### `Bundle.spec.target.configMap.metadata`
672+
673+
674+
Metadata is an optional set of labels and annotations to be copied to the target.
675+
676+
<table>
677+
<thead>
678+
<tr>
679+
<th>Name</th>
680+
<th>Type</th>
681+
<th>Description</th>
682+
<th>Required</th>
683+
</tr>
684+
</thead>
685+
<tbody><tr>
686+
<td><b>annotations</b></td>
687+
<td>map[string]string</td>
688+
<td>
689+
Annotations is a key value map to be copied to the target.
690+
<br/>
691+
</td>
692+
<td>false</td>
693+
</tr><tr>
694+
<td><b>labels</b></td>
695+
<td>map[string]string</td>
696+
<td>
697+
Labels is a key value map to be copied to the target.
698+
<br/>
699+
</td>
700+
<td>false</td>
633701
</tr></tbody>
634702
</table>
635703

@@ -742,6 +810,48 @@ By default, trust-manager has no permissions for writing to secrets and can only
742810
<br/>
743811
</td>
744812
<td>true</td>
813+
</tr><tr>
814+
<td><b><a href="#bundlespectargetsecretmetadata">metadata</a></b></td>
815+
<td>object</td>
816+
<td>
817+
Metadata is an optional set of labels and annotations to be copied to the target.
818+
<br/>
819+
</td>
820+
<td>false</td>
821+
</tr></tbody>
822+
</table>
823+
824+
825+
### `Bundle.spec.target.secret.metadata`
826+
827+
828+
Metadata is an optional set of labels and annotations to be copied to the target.
829+
830+
<table>
831+
<thead>
832+
<tr>
833+
<th>Name</th>
834+
<th>Type</th>
835+
<th>Description</th>
836+
<th>Required</th>
837+
</tr>
838+
</thead>
839+
<tbody><tr>
840+
<td><b>annotations</b></td>
841+
<td>map[string]string</td>
842+
<td>
843+
Annotations is a key value map to be copied to the target.
844+
<br/>
845+
</td>
846+
<td>false</td>
847+
</tr><tr>
848+
<td><b>labels</b></td>
849+
<td>map[string]string</td>
850+
<td>
851+
Labels is a key value map to be copied to the target.
852+
<br/>
853+
</td>
854+
<td>false</td>
745855
</tr></tbody>
746856
</table>
747857

@@ -787,7 +897,7 @@ and will be the same for the same version of a bundle with identical certificate
787897
### `Bundle.status.conditions[index]`
788898

789899

790-
BundleCondition contains condition information for a Bundle.
900+
Condition contains details for one aspect of the current state of this API Resource.
791901

792902
<table>
793903
<thead>
@@ -802,19 +912,29 @@ BundleCondition contains condition information for a Bundle.
802912
<td><b>lastTransitionTime</b></td>
803913
<td>string</td>
804914
<td>
805-
LastTransitionTime is the timestamp corresponding to the last status
806-
change of this condition.
915+
lastTransitionTime is the last time the condition transitioned from one status to another.
916+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
807917
<br/>
808918
<br/>
809919
<i>Format</i>: date-time<br/>
810920
</td>
811921
<td>true</td>
922+
</tr><tr>
923+
<td><b>message</b></td>
924+
<td>string</td>
925+
<td>
926+
message is a human readable message indicating details about the transition.
927+
This may be an empty string.
928+
<br/>
929+
</td>
930+
<td>true</td>
812931
</tr><tr>
813932
<td><b>reason</b></td>
814933
<td>string</td>
815934
<td>
816-
Reason is a brief machine-readable explanation for the condition's last
817-
transition.
935+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
936+
Producers of specific condition types may define expected values and meanings for this field,
937+
and whether the values are considered a guaranteed API.
818938
The value should be a CamelCase string.
819939
This field may not be empty.
820940
<br/>
@@ -824,7 +944,7 @@ This field may not be empty.
824944
<td><b>status</b></td>
825945
<td>enum</td>
826946
<td>
827-
Status of the condition, one of True, False, Unknown.
947+
status of the condition, one of True, False, Unknown.
828948
<br/>
829949
<br/>
830950
<i>Enum</i>: True, False, Unknown<br/>
@@ -834,28 +954,17 @@ This field may not be empty.
834954
<td><b>type</b></td>
835955
<td>string</td>
836956
<td>
837-
Type of the condition, known values are (`Synced`).
957+
type of condition in CamelCase or in foo.example.com/CamelCase.
838958
<br/>
839959
</td>
840960
<td>true</td>
841-
</tr><tr>
842-
<td><b>message</b></td>
843-
<td>string</td>
844-
<td>
845-
Message is a human-readable description of the details of the last
846-
transition, complementing reason.
847-
<br/>
848-
</td>
849-
<td>false</td>
850961
</tr><tr>
851962
<td><b>observedGeneration</b></td>
852963
<td>integer</td>
853964
<td>
854-
If set, this represents the .metadata.generation that the condition was
855-
set based upon.
856-
For instance, if .metadata.generation is currently 12, but the
857-
.status.condition[x].observedGeneration is 9, the condition is out of date
858-
with respect to the current state of the Bundle.
965+
observedGeneration represents the .metadata.generation that the condition was set based upon.
966+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
967+
with respect to the current state of the instance.
859968
<br/>
860969
<br/>
861970
<i>Format</i>: int64<br/>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"check": "concurrently --group --timings npm:check:* # Run all the npm check:* scripts in parallel",
2424
"check:next-lint": "next lint",
2525
"check:links": "find content/docs -type f -name '*.md' | xargs markdown-link-check --quiet --config markdown-link-check.json 2>&1 | awk -v RS=FILE: '/ERROR/{f=1; print RS $0} END{exit f}' # Split into records based on the word FILE and print only records containing word ERROR",
26-
"check:spelling": "FORCE_COLOR=1 mdspell --report --en-us --ignore-numbers --ignore-acronyms 'content/**/*.md' 'content/**/*.html' '_layouts/*.html' '_includes/*.html' '*.html' '!**/api-docs.md' '!content/*docs/policy/approval/approver-policy/api-reference.md' # Force color output in mdspell. # See https://github.com/lukeapage/node-markdown-spellcheck/issues/36#issuecomment-482649408 ",
26+
"check:spelling": "FORCE_COLOR=1 mdspell --report --en-us --ignore-numbers --ignore-acronyms 'content/**/*.md' 'content/**/*.html' '_layouts/*.html' '_includes/*.html' '*.html' '!**/api-docs.md' '!content/*docs/policy/approval/approver-policy/api-reference.md' '!content/*docs/trust/trust-manager/api-reference.md' # Force color output in mdspell. # See https://github.com/lukeapage/node-markdown-spellcheck/issues/36#issuecomment-482649408 ",
2727
"check:markdown": "remark --rc-path .remarkrc --frail --quiet content/"
2828
},
2929
"lint-staged": {

scripts/gendocs/generate-trust-manager

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ set -o pipefail
2020

2121
REPO_ROOT="${REPO_ROOT:-$(cd "$(dirname "$0")/../.." && pwd)}"
2222

23-
CRDOC=${REPO_ROOT}/scripts/bin/crdoc
23+
CRDOC="${REPO_ROOT}/scripts/bin/crdoc"
24+
25+
TRUST_MANAGER_REF="${1:-"v0.15.0"}"
2426

2527
tmpdir="$(mktemp -d)"
2628

@@ -46,12 +48,12 @@ gendocs() {
4648

4749
echo "+++ Generating trust-manager reference docs..."
4850

49-
(cd $tmpdir && make generate-crds)
51+
(cd "$tmpdir" && make generate-crds)
5052

5153
$CRDOC \
5254
--resources "$tmpdir/_bin/scratch/crds/trust.cert-manager.io_bundles.yaml" \
53-
--template $REPO_ROOT/scripts/gendocs/templates-trust-manager/markdown.tmpl \
54-
--output $outputdir
55+
--template "$REPO_ROOT/scripts/gendocs/templates-trust-manager/markdown.tmpl" \
56+
--output "$outputdir"
5557
}
5658

5759
# Note that this script only supports generating a single version of trust-manager API docs,
@@ -61,6 +63,6 @@ gendocs() {
6163
echo "+++ Cloning trust-manager repository..."
6264
git clone "https://github.com/cert-manager/trust-manager.git" "$tmpdir"
6365

64-
checkout "v0.15.0"
66+
checkout "$TRUST_MANAGER_REF"
6567

6668
gendocs "$REPO_ROOT/content/docs/trust/trust-manager/api-reference.md"

0 commit comments

Comments
 (0)