-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from appuio/fix/missing-es-operator-metrics-t…
…oken Manually generate missing Elasticsearch Operator metrics token
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
local com = import 'lib/commodore.libjsonnet'; | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local po = import 'lib/patch-operator.libsonnet'; | ||
|
||
// The hiera parameters for the component | ||
local inv = kap.inventory(); | ||
local params = inv.parameters.openshift4_logging; | ||
|
||
|
||
// Generate missing metrics SA token for Elasticsearch Operator. | ||
// | ||
// The ServiceMonitor for the Elasticsearch Operator references a SA token secret | ||
// called `elasticsearch-operator-controller-manager-metrics-token` which doesn't exist | ||
// on the cluster after the operator is installed or upgraded to 5.8.6 via | ||
// OLM. | ||
local missing_metrics_token = | ||
kube.Secret('elasticsearch-operator-controller-manager-metrics-token') { | ||
metadata+: { | ||
// Loki operator is deployed in openshift-operators-redhat | ||
namespace: 'openshift-operators-redhat', | ||
annotations+: { | ||
'kubernetes.io/service-account.name': 'elasticsearch-operator-controller-manager-metrics-reader', | ||
// disable argocd prune/delete so removing the workaround should be | ||
// fairly easy in case the Elasticsearch Operator OLM install fixes the issue. | ||
'argocd.argoproj.io/sync-options': 'Prune=false,Delete=false', | ||
}, | ||
}, | ||
data:: {}, | ||
type: 'kubernetes.io/service-account-token', | ||
}; | ||
|
||
{ | ||
missing_metrics_token: [ missing_metrics_token ], | ||
} |
11 changes: 11 additions & 0 deletions
11
...den/elasticsearch/openshift4-logging/openshift4-logging/40_es_operator_metrics_token.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-options: Prune=false,Delete=false | ||
kubernetes.io/service-account.name: elasticsearch-operator-controller-manager-metrics-reader | ||
labels: | ||
name: elasticsearch-operator-controller-manager-metrics-token | ||
name: elasticsearch-operator-controller-manager-metrics-token | ||
namespace: openshift-operators-redhat | ||
type: kubernetes.io/service-account-token |