Skip to content

Commit 29f6acf

Browse files
committed
Stop using service ca from service account token
Inclusion of the service ca in token configmaps is discontinued in 4.5.
1 parent 66179bb commit 29f6acf

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
namespace: openshift-insights
5+
name: service-ca-bundle
6+
annotations:
7+
release.openshift.io/create-only: "true"
8+
service.beta.openshift.io/inject-cabundle: "true"

manifests/06-deployment.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ spec:
4242
configMap:
4343
name: trusted-ca-bundle
4444
optional: true
45+
- name: service-ca-bundle
46+
configMap:
47+
name: service-ca-bundle
48+
optional: true
4549
- name: serving-cert
4650
secret:
4751
secretName: openshift-insights-serving-cert
@@ -56,6 +60,9 @@ spec:
5660
- mountPath: /var/run/configmaps/trusted-ca-bundle
5761
name: trusted-ca-bundle
5862
readOnly: true
63+
- mountPath: /var/run/configmaps/service-ca-bundle
64+
name: service-ca-bundle
65+
readOnly: true
5966
- mountPath: /var/run/secrets/serving-cert
6067
name: serving-cert
6168
ports:

pkg/cmd/start/start.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/openshift/insights-operator/pkg/controller"
1818
)
1919

20-
const serviceCACertPath = "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
20+
const serviceCACertPath = "/var/run/configmaps/service-ca-bundle/service-ca.crt"
2121

2222
func NewOperator() *cobra.Command {
2323
operator := &controller.Support{
@@ -55,6 +55,8 @@ func NewOperator() *cobra.Command {
5555
// if the service CA is rotated, we want to restart
5656
if data, err := ioutil.ReadFile(serviceCACertPath); err == nil {
5757
startingFileContent[serviceCACertPath] = data
58+
} else {
59+
klog.V(4).Info("Unable to read service ca bundle: %v", err)
5860
}
5961
observedFiles = append(observedFiles, serviceCACertPath)
6062

pkg/controller/operator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (s *Support) Run(ctx context.Context, controller *controllercmd.ControllerC
8484
// TODO: the oauth-proxy and delegating authorizer do not support Impersonate-User,
8585
// so we do not impersonate gather
8686
metricsGatherKubeConfig := rest.CopyConfig(controller.KubeConfig)
87-
metricsGatherKubeConfig.CAFile = "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
87+
metricsGatherKubeConfig.CAFile = "/var/run/configmaps/service-ca-bundle/service-ca.crt"
8888
metricsGatherKubeConfig.NegotiatedSerializer = scheme.Codecs
8989
metricsGatherKubeConfig.GroupVersion = &schema.GroupVersion{}
9090
metricsGatherKubeConfig.APIPath = "/"

0 commit comments

Comments
 (0)