You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In certain situations, responding to events may require deploying additional resources that rely not only on the resources that triggered the event but also on existing resources within the management cluster.
Image that for each managed cluster, there is a corresponding ConfigMap on the management cluster storing the server IP address, port, and certificate authority (CA) data. We use an EventSource to detect the creation of Secrets (type: kubernetes.io/service-account-token) within each managed cluster. These Secrets contain tokens used for authentication.
Our objective, in response to the creation of such Secret, is to generate Kubeconfig files that incorporate information from both sources:
Server and certificate authority data from the ConfigMaps.
The newly created service account token retrieved from the event (secret created).
Unfortunately, the current event-manager lacks the ability to directly fetch ConfigMap data. This is purposefully done as we don't want the event-manager to start watchers. Yet we want to be able to solve this use case as it is a pretty common one.
Describe the solution you'd like
Let's say EventTrigger, in a new configMapOrSecretGenerator section, reference following ConfigMap.
Because the annotation projectsveltos.io/template: "ok" is present, event-manager is going to instantiate its content using the resource that generated the event. But instead of giving a random name (current case), it generates a ConfigMap with name using cluster name "{{ .Cluster.metadata.name }}-token"
Now because we know the name of the instantiated ConfigMap, we can list the generated ConfigMap in the templateResourceRefs section (so that addon-controller can fetch it and have the token at its disposal):
instantiate the default/calico-sa-token ConfigMap (referenced in the configMapOrSecretGenerator section). This creates a new one in the projectsveltos namespace with name "{{ .Cluster.metadata.name }}-token"
create a ClusterProfile that fetches both the ConfigMap with managed cluster server and cert-auth and the ConfigMap created above that contains the token
ClusterProfile will reference the ConfigMap default/calico-remote-cluster-config and deploy its content
The ConfigMap default/calico-remote-cluster-config is
Is your feature request related to a problem? Please describe.
In certain situations, responding to events may require deploying additional resources that rely not only on the resources that triggered the event but also on existing resources within the management cluster.
Image that for each managed cluster, there is a corresponding ConfigMap on the management cluster storing the server IP address, port, and certificate authority (CA) data. We use an EventSource to detect the creation of Secrets (type: kubernetes.io/service-account-token) within each managed cluster. These Secrets contain tokens used for authentication.
Our objective, in response to the creation of such Secret, is to generate Kubeconfig files that incorporate information from both sources:
Unfortunately, the current event-manager lacks the ability to directly fetch ConfigMap data. This is purposefully done as we don't want the event-manager to start watchers. Yet we want to be able to solve this use case as it is a pretty common one.
Describe the solution you'd like
Let's say EventTrigger, in a new configMapOrSecretGenerator section, reference following ConfigMap.
Because the annotation
projectsveltos.io/template: "ok"
is present, event-manager is going to instantiate its content using the resource that generated the event. But instead of giving a random name (current case), it generates a ConfigMap with name using cluster name"{{ .Cluster.metadata.name }}-token"
Now because we know the name of the instantiated ConfigMap, we can list the generated ConfigMap in the templateResourceRefs section (so that addon-controller can fetch it and have the token at its disposal):
The full EventTrigger becomes
When an event happens, event-manager will:
"{{ .Cluster.metadata.name }}-token"
The ConfigMap default/calico-remote-cluster-config is
The text was updated successfully, but these errors were encountered: