Skip to content

Commit

Permalink
feat: custom certs for api-server
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Görn <[email protected]>
  • Loading branch information
goern committed Apr 29, 2024
1 parent f86520d commit 800e547
Show file tree
Hide file tree
Showing 17 changed files with 164 additions and 33 deletions.
3 changes: 3 additions & 0 deletions manifests/environments/nostromo/custom-certificates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# References

- [upstream we follow](https://epam.github.io/edp-install/operator-guide/ssl-automation-okd/#modify-openshift-router-and-api-server-custom-resources)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: api-server-certificate
namespace: openshift-config
spec:
subject:
organizations:
- "#B4mad"
issuerRef:
kind: ClusterIssuer
name: letsencrypt
secretName: api-server-certificate
secretTemplate:
annotations:
app.kubernetes.io/part-of: op1st-emea-b4mad-nostromo
privateKey:
algorithm: RSA
encoding: PKCS1
size: 4096
rotationPolicy: Always
usages:
- server auth
- client auth
dnsNames:
- "*.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud"
- "*.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud"
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand All @@ -25,5 +18,10 @@ spec:
algorithm: RSA
encoding: PKCS1
size: 4096
rotationPolicy: Always
usages:
- server auth
- client auth
dnsNames:
- "*.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud"
- "*.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud"
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- stubs/cluster-openshift-config.yaml
- stubs/default-openshift-ingress-operator.yaml

- api-server/api-server-certificate.yaml
- default-ingress/default-ingress-certificate.yaml

patches:
- patch: |-
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
spec:
defaultCertificate:
name: default-ingress-certificate
- patch: |-
apiVersion: config.openshift.io/v1
kind: APIServer
metadata:
name: cluster
namespace: openshift-config
spec:
servingCerts:
namedCertificates:
- names:
- api.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud
servingCertificate:
name: api-server-certificate
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: config.openshift.io/v1
kind: APIServer
metadata:
name: cluster
namespace: openshift-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
16 changes: 0 additions & 16 deletions manifests/environments/nostromo/default-ingress/kustomization.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions manifests/environments/nostromo/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ labels:
resources:
- ../../organizational-unit-scope/

- stubs/cluster-version.yaml
- stubs/openshift-storage.yaml

- admin-acks/
Expand All @@ -19,9 +20,8 @@ resources:
- alertmanager-receivers/
- cert-manager/
- cluster-monitoring-config.yaml
- cluster-version.yaml
- crunchy-postgres/
- default-ingress/
- custom-certificates/
- grafana-operator/
- idp/github-com.yaml
- local-storage/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# References

- [upstream we follow](https://epam.github.io/edp-install/operator-guide/ssl-automation-okd/#modify-openshift-router-and-api-server-custom-resources)
3 changes: 3 additions & 0 deletions manifests/environments/phobos/custom-certificates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# References

- [upstream we follow](https://epam.github.io/edp-install/operator-guide/ssl-automation-okd/#modify-openshift-router-and-api-server-custom-resources)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: api-server-certificate
namespace: openshift-config
spec:
subject:
organizations:
- "#B4mad"
issuerRef:
kind: ClusterIssuer
name: letsencrypt
secretName: api-server-certificate
secretTemplate:
annotations:
app.kubernetes.io/part-of: op1st-emea-b4mad-phobos
privateKey:
algorithm: RSA
encoding: PKCS1
size: 4096
rotationPolicy: Always
usages:
- server auth
- client auth
dnsNames:
- "*.phobos.b4mad.emea.operate-first.cloud"
- "*.apps.phobos.b4mad.emea.operate-first.cloud"
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand All @@ -25,5 +18,10 @@ spec:
algorithm: RSA
encoding: PKCS1
size: 4096
rotationPolicy: Always
usages:
- server auth
- client auth
dnsNames:
- "*.phobos.b4mad.emea.operate-first.cloud"
- "*.apps.phobos.b4mad.emea.operate-first.cloud"
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- stubs/cluster-openshift-config.yaml
- stubs/default-openshift-ingress-operator.yaml

- api-server/api-server-certificate.yaml
- default-ingress/default-ingress-certificate.yaml

patches:
- patch: |-
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
spec:
defaultCertificate:
name: default-ingress-certificate
- patch: |-
apiVersion: config.openshift.io/v1
kind: APIServer
metadata:
name: cluster
namespace: openshift-config
spec:
servingCerts:
namedCertificates:
- names:
- api.phobos.b4mad.emea.operate-first.cloud
servingCertificate:
name: api-server-certificate
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: config.openshift.io/v1
kind: APIServer
metadata:
name: cluster
namespace: openshift-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
2 changes: 1 addition & 1 deletion manifests/environments/phobos/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
- cert-manager-operator/
- cluster-monitoring-config.yaml
- crunchy-postgres/
- default-ingress-certificate.yaml
- custom-certificates/
- grafana-operator/
- local-storage/
- lvm-storage/
Expand Down

0 comments on commit 800e547

Please sign in to comment.