Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds resource for KRP #772

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions magefiles/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,41 @@ func operatorResources(namespace string, m TemplateMaps) []runtime.Object {
},
},
},

// Deployment
operatorDeployment(namespace, m),
operatorServingCertConfigMap(namespace),
}
}

func operatorServingCertConfigMap(namespace string) *corev1.ConfigMap {
return &corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
Kind: "ConfigMap",
},
ObjectMeta: metav1.ObjectMeta{
Name: "thanos-operator-serving-cert",
Namespace: namespace,
Labels: map[string]string{
"app.kubernetes.io/component": "manager",
"app.kubernetes.io/created-by": "thanos-operator",
"app.kubernetes.io/instance": "controller-manager",
"app.kubernetes.io/managed-by": "rhobs",
"app.kubernetes.io/name": "configmap",
"app.kubernetes.io/part-of": "thanos-operator",
},
Annotations: map[string]string{
"service.beta.openshift.io/inject-cabundle": "true",
},
},
Data: map[string]string{
"config.yaml": `"authorization":
"static":
- "path": "/metrics"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-customer-monitoring:prometheus-k8s"
"verb": "get"`,
},
}
}

Expand Down Expand Up @@ -860,13 +892,20 @@ func operatorDeployment(namespace string, m TemplateMaps) *appsv1.Deployment {
"--v=4",
"--tls-cert-file=/etc/tls/private/tls.crt",
"--tls-private-key-file=/etc/tls/private/tls.key",
"--client-ca-file=/etc/service-ca/service-ca.crt",
"--config-file=/etc/service-ca/config.yaml",
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "tls",
MountPath: "/etc/tls/private",
ReadOnly: true,
},
{
Name: "service-ca",
MountPath: "/etc/service-ca",
ReadOnly: true,
},
},
Ports: []corev1.ContainerPort{
{
Expand Down Expand Up @@ -943,6 +982,18 @@ func operatorDeployment(namespace string, m TemplateMaps) *appsv1.Deployment {
},
},
},
{
Name: "service-ca",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "openshift-service-ca.crt",
},
DefaultMode: ptr.To(int32(420)),
Optional: ptr.To(false),
},
},
},
},
ServiceAccountName: "thanos-operator-controller-manager",
TerminationGracePeriodSeconds: ptr.To(int64(10)),
Expand Down
34 changes: 34 additions & 0 deletions resources/services/bundle/staging/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ objects:
- --v=4
- --tls-cert-file=/etc/tls/private/tls.crt
- --tls-private-key-file=/etc/tls/private/tls.key
- --client-ca-file=/etc/service-ca/service-ca.crt
- --config-file=/etc/service-ca/config.yaml
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:98455d503b797b6b02edcfd37045c8fab0796b95ee5cf4cfe73b221a07e805f0
imagePullPolicy: IfNotPresent
name: kube-rbac-proxy
Expand All @@ -93,6 +95,9 @@ objects:
- mountPath: /etc/tls/private
name: tls
readOnly: true
- mountPath: /etc/service-ca
name: service-ca
readOnly: true
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
Expand Down Expand Up @@ -146,6 +151,11 @@ objects:
defaultMode: 420
optional: false
secretName: kube-rbac-proxy-tls
- configMap:
defaultMode: 420
name: openshift-service-ca.crt
optional: false
name: service-ca
status: {}
- apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -429,6 +439,30 @@ objects:
- kind: ServiceAccount
name: thanos-operator-controller-manager
namespace: rhobs-stage
- apiVersion: v1
data:
config.yaml: |-
"authorization":
"static":
- "path": "/metrics"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-customer-monitoring:prometheus-k8s"
"verb": "get"
kind: ConfigMap
metadata:
annotations:
service.beta.openshift.io/inject-cabundle: "true"
creationTimestamp: null
labels:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: thanos-operator
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/managed-by: rhobs
app.kubernetes.io/name: configmap
app.kubernetes.io/part-of: thanos-operator
name: thanos-operator-serving-cert
namespace: rhobs-stage
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down