@@ -38,7 +38,14 @@ func ServerCertificateReconciler(shard *operatorv1alpha1.Shard, rootShard *opera
3838 return name , func (cert * certmanagerv1.Certificate ) (* certmanagerv1.Certificate , error ) {
3939 cert .SetLabels (resources .GetShardResourceLabels (shard ))
4040 cert .Spec = certmanagerv1.CertificateSpec {
41- SecretName : name ,
41+ SecretName : name ,
42+ SecretTemplate : & certmanagerv1.CertificateSecretTemplate {
43+ Labels : map [string ]string {
44+ resources .RootShardLabel : rootShard .Name ,
45+ resources .ShardLabel : shard .Name ,
46+ },
47+ },
48+
4249 Duration : & operatorv1alpha1 .DefaultCertificateDuration ,
4350 RenewBefore : & operatorv1alpha1 .DefaultCertificateRenewal ,
4451
@@ -49,6 +56,8 @@ func ServerCertificateReconciler(shard *operatorv1alpha1.Shard, rootShard *opera
4956
5057 Usages : []certmanagerv1.KeyUsage {
5158 certmanagerv1 .UsageServerAuth ,
59+ certmanagerv1 .UsageKeyEncipherment ,
60+ certmanagerv1 .UsageDigitalSignature ,
5261 },
5362
5463 DNSNames : []string {
@@ -78,7 +87,14 @@ func VirtualWorkspacesCertificateReconciler(shard *operatorv1alpha1.Shard, rootS
7887 return name , func (cert * certmanagerv1.Certificate ) (* certmanagerv1.Certificate , error ) {
7988 cert .SetLabels (resources .GetShardResourceLabels (shard ))
8089 cert .Spec = certmanagerv1.CertificateSpec {
81- SecretName : name ,
90+ SecretName : name ,
91+ SecretTemplate : & certmanagerv1.CertificateSecretTemplate {
92+ Labels : map [string ]string {
93+ resources .RootShardLabel : rootShard .Name ,
94+ resources .ShardLabel : shard .Name ,
95+ },
96+ },
97+
8298 Duration : & operatorv1alpha1 .DefaultCertificateDuration ,
8399 RenewBefore : & operatorv1alpha1 .DefaultCertificateRenewal ,
84100
@@ -117,11 +133,23 @@ func ServiceAccountCertificateReconciler(shard *operatorv1alpha1.Shard, rootShar
117133 return name , func (cert * certmanagerv1.Certificate ) (* certmanagerv1.Certificate , error ) {
118134 cert .SetLabels (resources .GetShardResourceLabels (shard ))
119135 cert .Spec = certmanagerv1.CertificateSpec {
136+ SecretName : name ,
137+ SecretTemplate : & certmanagerv1.CertificateSecretTemplate {
138+ Labels : map [string ]string {
139+ resources .RootShardLabel : rootShard .Name ,
140+ resources .ShardLabel : shard .Name ,
141+ },
142+ },
143+
120144 CommonName : name ,
121- SecretName : name ,
122145 Duration : & operatorv1alpha1 .DefaultCertificateDuration ,
123146 RenewBefore : & operatorv1alpha1 .DefaultCertificateRenewal ,
124147
148+ Usages : []certmanagerv1.KeyUsage {
149+ certmanagerv1 .UsageDigitalSignature ,
150+ certmanagerv1 .UsageKeyEncipherment ,
151+ },
152+
125153 PrivateKey : & certmanagerv1.CertificatePrivateKey {
126154 Algorithm : certmanagerv1 .RSAKeyAlgorithm ,
127155 Size : 4096 ,
@@ -149,8 +177,15 @@ func RootShardClientCertificateReconciler(shard *operatorv1alpha1.Shard, rootSha
149177 return name , func (cert * certmanagerv1.Certificate ) (* certmanagerv1.Certificate , error ) {
150178 cert .SetLabels (resources .GetShardResourceLabels (shard ))
151179 cert .Spec = certmanagerv1.CertificateSpec {
180+ SecretName : name ,
181+ SecretTemplate : & certmanagerv1.CertificateSecretTemplate {
182+ Labels : map [string ]string {
183+ resources .RootShardLabel : rootShard .Name ,
184+ resources .ShardLabel : shard .Name ,
185+ },
186+ },
187+
152188 CommonName : fmt .Sprintf ("shard-%s" , shard .Name ),
153- SecretName : name ,
154189 Duration : & operatorv1alpha1 .DefaultCertificateDuration ,
155190 RenewBefore : & operatorv1alpha1 .DefaultCertificateRenewal ,
156191
@@ -189,8 +224,15 @@ func LogicalClusterAdminCertificateReconciler(shard *operatorv1alpha1.Shard, roo
189224 return name , func (cert * certmanagerv1.Certificate ) (* certmanagerv1.Certificate , error ) {
190225 cert .SetLabels (resources .GetShardResourceLabels (shard ))
191226 cert .Spec = certmanagerv1.CertificateSpec {
227+ SecretName : name ,
228+ SecretTemplate : & certmanagerv1.CertificateSecretTemplate {
229+ Labels : map [string ]string {
230+ resources .RootShardLabel : rootShard .Name ,
231+ resources .ShardLabel : shard .Name ,
232+ },
233+ },
234+
192235 CommonName : fmt .Sprintf ("logical-cluster-admin-shard-%s" , shard .Name ),
193- SecretName : name ,
194236 Duration : & operatorv1alpha1 .DefaultCertificateDuration ,
195237 RenewBefore : & operatorv1alpha1 .DefaultCertificateRenewal ,
196238
@@ -229,8 +271,15 @@ func ExternalLogicalClusterAdminCertificateReconciler(shard *operatorv1alpha1.Sh
229271 return name , func (cert * certmanagerv1.Certificate ) (* certmanagerv1.Certificate , error ) {
230272 cert .SetLabels (resources .GetShardResourceLabels (shard ))
231273 cert .Spec = certmanagerv1.CertificateSpec {
274+ SecretName : name ,
275+ SecretTemplate : & certmanagerv1.CertificateSecretTemplate {
276+ Labels : map [string ]string {
277+ resources .RootShardLabel : rootShard .Name ,
278+ resources .ShardLabel : shard .Name ,
279+ },
280+ },
281+
232282 CommonName : fmt .Sprintf ("external-logical-cluster-admin-shard-%s" , shard .Name ),
233- SecretName : name ,
234283 Duration : & operatorv1alpha1 .DefaultCertificateDuration ,
235284 RenewBefore : & operatorv1alpha1 .DefaultCertificateRenewal ,
236285
0 commit comments