Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into add_alertmanager_serv…
Browse files Browse the repository at this point in the history
…icemonitor

Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Feb 21, 2024
2 parents 72cf79e + a0619ce commit 18be7a6
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 311 deletions.
3 changes: 3 additions & 0 deletions operators/endpointmetrics/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
- mountPath: /spoke/hub-kubeconfig
name: hub-kubeconfig-secret
readOnly: true
securityContext:
privileged: false
readOnlyRootFilesystem: true
volumes:
- name: hub-kubeconfig-secret
secret:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ func createDeployment(params CollectorParams) *appsv1.Deployment {
})
}

privileged := false
readOnlyRootFilesystem := true

metricsCollectorDep.Spec.Template.Spec.Containers[0].SecurityContext = &corev1.SecurityContext{
Privileged: &privileged,
ReadOnlyRootFilesystem: &readOnlyRootFilesystem,
}

if params.obsAddonSpec.Resources != nil {
metricsCollectorDep.Spec.Template.Spec.Containers[0].Resources = *params.obsAddonSpec.Resources
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ spec:
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
ports:
- containerPort: 9443
name: webhook-server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 70
podAffinityTerm:
topologyKey: topology.kubernetes.io/zone
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-alertmanager
- weight: 30
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-alertmanager
- weight: 70
podAffinityTerm:
topologyKey: topology.kubernetes.io/zone
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-alertmanager
- weight: 30
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-alertmanager
containers:
- args:
- --config.file=/etc/alertmanager/config/alertmanager.yaml
Expand Down Expand Up @@ -84,6 +84,9 @@ spec:
name: config-volume
- mountPath: /alertmanager
name: alertmanager-db
securityContext:
privileged: false
readOnlyRootFilesystem: true
- args:
- -webhook-url=http://localhost:9093/-/reload
- -volume-dir=/etc/alertmanager/config
Expand All @@ -102,6 +105,9 @@ spec:
- mountPath: /etc/tls/private
name: tls-secret
readOnly: true
securityContext:
privileged: false
readOnlyRootFilesystem: true
- args:
- --provider=openshift
- --https-address=:9095
Expand Down Expand Up @@ -146,6 +152,9 @@ spec:
readOnly: true
- mountPath: /etc/proxy/secrets
name: alertmanager-proxy
securityContext:
privileged: false
readOnlyRootFilesystem: true
- image: quay.io/stolostron/kube-rbac-proxy:2.10.0-SNAPSHOT-2024-02-13-14-12-35
name: kube-rbac-proxy
args:
Expand Down Expand Up @@ -175,7 +184,9 @@ spec:
- mountPath: /etc/tls/client
name: metrics-client-ca
readOnly: true

securityContext:
privileged: false
readOnlyRootFilesystem: true
serviceAccount: alertmanager
serviceAccountName: alertmanager
volumes:
Expand All @@ -202,12 +213,12 @@ spec:
configMap:
name: alertmanager-clientca-metric
volumeClaimTemplates:
- metadata:
name: alertmanager-db
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: "gp2"
- metadata:
name: alertmanager-db
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: "gp2"
Original file line number Diff line number Diff line change
Expand Up @@ -21,119 +21,128 @@ spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 70
podAffinityTerm:
topologyKey: topology.kubernetes.io/zone
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-grafana
- weight: 30
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-grafana
- weight: 70
podAffinityTerm:
topologyKey: topology.kubernetes.io/zone
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-grafana
- weight: 30
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-observability-grafana
containers:
- args:
- -config=/etc/grafana/grafana.ini
image: quay.io/stolostron/grafana:2.4.0-SNAPSHOT-2021-09-23-07-02-14
imagePullPolicy: IfNotPresent
name: grafana
ports:
- containerPort: 3001
name: http
protocol: TCP
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 4m
memory: 100Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
- mountPath: /etc/grafana/provisioning/datasources
name: grafana-datasources
- mountPath: /etc/grafana
name: grafana-config
- name: grafana-dashboard-loader
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: quay.io/stolostron/grafana-dashboard-loader:2.3.0-SNAPSHOT-2021-07-26-18-43-26
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 4m
memory: 50Mi
- readinessProbe:
httpGet:
path: /oauth/healthz
port: 9443
scheme: HTTPS
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
name: grafana-proxy
ports:
- name: public
containerPort: 9443
protocol: TCP
imagePullPolicy: IfNotPresent
volumeMounts:
- name: tls-secret
mountPath: /etc/tls/private
- mountPath: /etc/proxy/secrets
name: cookie-secret
image: quay.io/stolostron/origin-oauth-proxy:4.5
args:
- '--provider=openshift'
- '--upstream=http://localhost:3001'
- '--https-address=:9443'
- '--cookie-secret-file=/etc/proxy/secrets/session_secret'
- '--cookie-expire=12h0m0s'
- '--cookie-refresh=8h0m0s'
- '--openshift-delegate-urls={"/": {"resource": "projects", "verb": "list"}}'
- '--tls-cert=/etc/tls/private/tls.crt'
- '--tls-key=/etc/tls/private/tls.key'
- '--openshift-service-account=grafana'
- '--pass-user-bearer-token=true'
- '--pass-access-token=true'
- '--client-id=grafana-proxy-client'
- '--client-secret=grafana-proxy-client'
- '--scope=user:full'
- '--openshift-ca=/etc/pki/tls/cert.pem'
- '--openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
- args:
- -config=/etc/grafana/grafana.ini
image: quay.io/stolostron/grafana:2.4.0-SNAPSHOT-2021-09-23-07-02-14
imagePullPolicy: IfNotPresent
name: grafana
ports:
- containerPort: 3001
name: http
protocol: TCP
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 4m
memory: 100Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
- mountPath: /etc/grafana/provisioning/datasources
name: grafana-datasources
- mountPath: /etc/grafana
name: grafana-config
securityContext:
privileged: false
readOnlyRootFilesystem: true
- name: grafana-dashboard-loader
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: quay.io/stolostron/grafana-dashboard-loader:2.3.0-SNAPSHOT-2021-07-26-18-43-26
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 4m
memory: 50Mi
securityContext:
privileged: false
readOnlyRootFilesystem: true
- readinessProbe:
httpGet:
path: /oauth/healthz
port: 9443
scheme: HTTPS
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
name: grafana-proxy
ports:
- name: public
containerPort: 9443
protocol: TCP
imagePullPolicy: IfNotPresent
volumeMounts:
- name: tls-secret
mountPath: /etc/tls/private
- mountPath: /etc/proxy/secrets
name: cookie-secret
image: quay.io/stolostron/origin-oauth-proxy:4.5
args:
- '--provider=openshift'
- '--upstream=http://localhost:3001'
- '--https-address=:9443'
- '--cookie-secret-file=/etc/proxy/secrets/session_secret'
- '--cookie-expire=12h0m0s'
- '--cookie-refresh=8h0m0s'
- '--openshift-delegate-urls={"/": {"resource": "projects", "verb": "list"}}'
- '--tls-cert=/etc/tls/private/tls.crt'
- '--tls-key=/etc/tls/private/tls.key'
- '--openshift-service-account=grafana'
- '--pass-user-bearer-token=true'
- '--pass-access-token=true'
- '--client-id=grafana-proxy-client'
- '--client-secret=grafana-proxy-client'
- '--scope=user:full'
- '--openshift-ca=/etc/pki/tls/cert.pem'
- '--openshift-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
securityContext:
privileged: false
readOnlyRootFilesystem: true
serviceAccount: grafana
imagePullSecrets:
- name: multiclusterhub-operator-pull-secret
- name: multiclusterhub-operator-pull-secret
serviceAccountName: grafana
volumes:
- emptyDir: {}
name: grafana-storage
- name: grafana-datasources
secret:
defaultMode: 420
secretName: grafana-datasources
- name: grafana-config
secret:
defaultMode: 420
secretName: grafana-config
- name: tls-secret
secret:
defaultMode: 420
secretName: grafana-tls
- name: cookie-secret
secret:
defaultMode: 420
secretName: rbac-proxy-cookie-secret
- emptyDir: {}
name: grafana-storage
- name: grafana-datasources
secret:
defaultMode: 420
secretName: grafana-datasources
- name: grafana-config
secret:
defaultMode: 420
secretName: grafana-config
- name: tls-secret
secret:
defaultMode: 420
secretName: grafana-tls
- name: cookie-secret
secret:
defaultMode: 420
secretName: rbac-proxy-cookie-secret
Loading

0 comments on commit 18be7a6

Please sign in to comment.