<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Flux – Notification Controller</title><link>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/</link><description>Recent content in Notification Controller on Flux</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/index.xml" rel="self" type="application/rss+xml"/><item><title>Flux: Controller Options</title><link>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/options/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/options/</guid><description>
&lt;p>To customise the controller options at install time,
please see the
&lt;a href="https://deploy-preview-2713--fluxcd.netlify.app/flux/installation/configuration/bootstrap-customization/">bootstrap customization guide&lt;/a>.&lt;/p>
&lt;h2 id="flags">Flags&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Name&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>--authorized-notifier-spiffe-id&lt;/code>&lt;/td>
&lt;td>strings&lt;/td>
&lt;td>SPIFFE ID of a notifier authorized to send events to the event server. Can be repeated. When set, the event server uses SPIFFE mTLS.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--authorized-receiver-spiffe-id&lt;/code>&lt;/td>
&lt;td>strings&lt;/td>
&lt;td>SPIFFE ID of a receiver authorized to send requests to the receiver server. Can be repeated. When set, the receiver server uses SPIFFE mTLS.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--concurrent&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The number of concurrent notification reconciles. (default 4)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--default-service-account&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Default service account to use for workload identity when not specified in resources.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--enable-leader-election&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--events-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address of the events receiver.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--health-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the health endpoint binds to. (default &amp;ldquo;:9440&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-lease-duration&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Interval at which non-leader candidates will wait to force acquire leadership (duration string). (default 35s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-release-on-cancel&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Defines if the leader should step down voluntarily on controller manager shutdown. (default true)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-renew-deadline&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Duration that the leading controller manager will retry refreshing leadership before giving up (duration string). (default 30s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-retry-period&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Duration the LeaderElector clients should wait between tries of actions (duration string). (default 5s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--log-encoding&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Log encoding format. Can be &amp;lsquo;json&amp;rsquo; or &amp;lsquo;console&amp;rsquo;. (default &amp;ldquo;json&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--log-level&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Log verbosity level. Can be one of &amp;rsquo;trace&amp;rsquo;, &amp;lsquo;debug&amp;rsquo;, &amp;lsquo;info&amp;rsquo;, &amp;rsquo;error&amp;rsquo;. (default &amp;ldquo;info&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--metrics-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the metric endpoint binds to. (default &amp;ldquo;:8080&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--no-cross-namespace-refs&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>When set to true, references between custom resources are allowed only if the reference and the referee are in the same namespace.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--rate-limit-interval&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Interval in which rate limit has effect. (default 5m0s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--receiverAddr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the webhook receiver endpoint binds to. (default &amp;ldquo;:9292&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--token-cache-max-size&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The maximum amount of entries in the LRU cache used for tokens. (default 100, enabled)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--spiffe-broker-endpoint&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The gRPC URL of the SPIFFE Broker endpoint.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--spiffe-broker-id&lt;/code>&lt;/td>
&lt;td>strings&lt;/td>
&lt;td>SPIFFE ID of the SPIFFE Broker endpoint. Can be repeated.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--token-cache-max-duration&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>The maximum duration for which a token would be considered unexpired. This is capped at 1h. (default 1h)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--watch-all-namespaces&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--feature-gates&lt;/code>&lt;/td>
&lt;td>mapStringBool&lt;/td>
&lt;td>A comma separated list of key=value pairs defining the state of experimental features.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="spiffe-mtls">SPIFFE mTLS&lt;/h3>
&lt;p>When at least one of the repeatable flags &lt;code>--authorized-notifier-spiffe-id&lt;/code> or
&lt;code>--authorized-receiver-spiffe-id&lt;/code> is set, notification-controller acquires an
X.509-SVID from the SPIFFE Workload API. The &lt;code>SPIFFE_ENDPOINT_SOCKET&lt;/code> environment
variable must point to the Workload API socket.&lt;/p>
&lt;ul>
&lt;li>&lt;code>--authorized-notifier-spiffe-id&lt;/code> authorizes the given SPIFFE IDs of
notifiers to send events to the event server. When set, the event server uses
mTLS.&lt;/li>
&lt;li>&lt;code>--authorized-receiver-spiffe-id&lt;/code> authorizes the given SPIFFE IDs of
receivers to send requests to the receiver server. When set, the receiver
server uses mTLS.&lt;/li>
&lt;/ul>
&lt;p>Each traffic type is protected independently.&lt;/p>
&lt;p>Each flag value is interpreted as follows:&lt;/p>
&lt;ul>
&lt;li>&lt;code>spiffe://&amp;lt;trust domain&amp;gt;/&amp;lt;path&amp;gt;&lt;/code> authorizes exactly that SPIFFE ID.&lt;/li>
&lt;li>&lt;code>spiffe://&amp;lt;trust domain&amp;gt;/&amp;lt;path&amp;gt;/&lt;/code> (with a trailing slash) authorizes any
SPIFFE ID with that path prefix.&lt;/li>
&lt;li>&lt;code>spiffe://&amp;lt;trust domain&amp;gt;&lt;/code> (without a path) authorizes any SPIFFE ID in that
trust domain.&lt;/li>
&lt;/ul>
&lt;p>Whenever &lt;code>&amp;lt;trust domain&amp;gt;&lt;/code> equals the special value &lt;code>self&lt;/code>,
notification-controller understands it as the trust domain of the controller&amp;rsquo;s
own X509-SVID.&lt;/p>
&lt;p>Invalid values cause notification-controller to fail at startup.&lt;/p>
&lt;h3 id="spiffe-broker-api">SPIFFE Broker API&lt;/h3>
&lt;p>When &lt;code>--spiffe-broker-endpoint&lt;/code> and at least one &lt;code>--spiffe-broker-id&lt;/code> are set,
notification-controller acquires an X.509-SVID from the SPIFFE Workload API and uses it to
authenticate to the SPIFFE Broker API. The &lt;code>SPIFFE_ENDPOINT_SOCKET&lt;/code> environment
variable must point to the Workload API socket.&lt;/p>
&lt;p>The Broker is used to acquire JWT-SVIDs for object identity when a
ServiceAccount sets &lt;code>credential.auth.fluxcd.io/provider&lt;/code> to &lt;code>spiffe&lt;/code>. The
Broker endpoint is a TCP gRPC target, e.g.
&lt;code>dns:///spire-server.spire.svc.cluster.local:8443&lt;/code>.&lt;/p>
&lt;p>Each &lt;code>--spiffe-broker-id&lt;/code> value is interpreted like the SPIFFE IDs used by the
mTLS flags. Invalid values cause notification-controller to fail at startup.&lt;/p>
&lt;h3 id="feature-gates">Feature Gates&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Name&lt;/th>
&lt;th>Default Value&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>CacheSecretsAndConfigMaps&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Configures the caching of Secrets and ConfigMaps by the controller-runtime client. When enabled, it will cache both object types, resulting in increased memory usage.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>DisableConfigWatchers&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Disables the watchers for ConfigMaps and Secrets.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table></description></item><item><title>Flux: Events</title><link>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/events/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/events/</guid><description>
&lt;p>The &lt;code>Event&lt;/code> API defines the structure of the events issued by Flux controllers.&lt;/p>
&lt;p>Flux controllers use the
&lt;a href="https://github.com/fluxcd/pkg/tree/main/runtime/events" target="_blank">fluxcd/pkg/runtime/events&lt;/a>
package to push events to the notification-controller API.&lt;/p>
&lt;h2 id="example">Example&lt;/h2>
&lt;p>The following is an example of an event sent by kustomize-controller to report a reconciliation error.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;involvedObject&amp;#34;&lt;/span>: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;apiVersion&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;kustomize.toolkit.fluxcd.io/v1beta2&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;kind&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;Kustomization&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;name&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;webapp&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;namespace&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;apps&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;uid&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;7d0cdc51-ddcf-4743-b223-83ca5c699632&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;metadata&amp;#34;&lt;/span>: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;kustomize.toolkit.fluxcd.io/revision&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;main/731f7eaddfb6af01cb2173e18f0f75b0ba780ef1&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;severity&amp;#34;&lt;/span>:&lt;span style="color:#4070a0">&amp;#34;error&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;reason&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;ValidationFailed&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;message&amp;#34;&lt;/span>:&lt;span style="color:#4070a0">&amp;#34;service/apps/webapp validation error: spec.type: Unsupported value: Ingress&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;reportingController&amp;#34;&lt;/span>:&lt;span style="color:#4070a0">&amp;#34;kustomize-controller&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;timestamp&amp;#34;&lt;/span>:&lt;span style="color:#4070a0">&amp;#34;2022-10-28T07:26:19Z&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the above example:&lt;/p>
&lt;ul>
&lt;li>An event is issued by kustomize-controller for a specific object, indicated in the
&lt;code>involvedObject&lt;/code> field.&lt;/li>
&lt;li>The notification-controller receives the event and finds the
&lt;a href="alerts.md">alerts&lt;/a>
that match the &lt;code>involvedObject&lt;/code> and &lt;code>severity&lt;/code> values.&lt;/li>
&lt;li>For all matching alerts, the controller posts the &lt;code>message&lt;/code> and the source revision
extracted from &lt;code>metadata&lt;/code> to the alert provider API.&lt;/li>
&lt;/ul>
&lt;h2 id="event-structure">Event structure&lt;/h2>
&lt;p>The Go type that defines the event structure can be found in the
&lt;a href="https://github.com/fluxcd/pkg/blob/main/apis/event/v1beta1/event.go" target="_blank">fluxcd/pkg/apis/event/v1beta1&lt;/a>
package.&lt;/p>
&lt;h2 id="rate-limiting">Rate limiting&lt;/h2>
&lt;p>Events received by notification-controller are subject to rate limiting to reduce the
amount of duplicate alerts sent to external systems like Slack, Sentry, etc.&lt;/p>
&lt;p>Events are rate limited based on &lt;code>involvedObject.name&lt;/code>, &lt;code>involvedObject.namespace&lt;/code>,
&lt;code>involvedObject.kind&lt;/code>, &lt;code>message&lt;/code>, and &lt;code>metadata&lt;/code>.
The interval of the rate limit is set by default to &lt;code>5m&lt;/code> but can be configured
with the &lt;code>--rate-limit-interval&lt;/code> controller flag.&lt;/p>
&lt;p>The event server exposes HTTP request metrics to track the amount of rate limited events.
The following promql will get the rate at which requests are rate limited:&lt;/p>
&lt;pre tabindex="0">&lt;code>rate(gotk_event_http_request_duration_seconds_count{code=&amp;#34;429&amp;#34;}[30s])
&lt;/code>&lt;/pre></description></item><item><title>Flux: API Reference</title><link>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2713--fluxcd.netlify.app/flux/components/notification/api/</guid><description/></item></channel></rss>