Skip to content

Commit 3c47ee4

Browse files
authored
Merge pull request #5310 from dtaylor113/master
Documentation for "Configuring Quota Notification Messages"
2 parents d9c3296 + 1710249 commit 3c47ee4

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

install_config/web_console_customization.adoc

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,51 @@ ifdef::openshift-enterprise[]
687687
endif::[]
688688
----
689689

690+
endif::[]
691+
[[configuring-quota-notification-messages]]
692+
== Configuring Quota Notification Messages
693+
694+
Whenever a user reaches a quota, a quota notification is put into the notification drawer.
695+
A custom quota notification message, per
696+
xref:../dev_guide/compute_resources.adoc#dev-managed-by-quota[quota resource type], can be added to the notification. For example:
697+
"Your project is over quota. It is using 200% of 2 cores CPU (Limit). Upgrade to <a href='http://www.openshift.com'>
698+
OpenShift Pro</a> if you need additional resources.". The "Upgrade to..." part of the notification is the custom
699+
message and may contain HTML such as links to additional resources.
700+
701+
. Create the following configuration scripts within a file (for example,
702+
*_quota-messages.js_*):
703+
+
704+
[source, javascript]
705+
----
706+
// Set custom notification messages per quota type/key
707+
window.OPENSHIFT_CONSTANTS.QUOTA_NOTIFICATION_MESSAGE = {
708+
"pods": 'Upgrade to <a href="http://www.openshift.com">OpenShift Pro</a> if you need additional resources.',
709+
"limits.memory": 'Upgrade to <a href="http://www.openshift.com">OpenShift Online Pro</a> if you need additional resources.'
710+
}
711+
----
712+
713+
. Save the file and add it to the master configuration at
714+
*_/etc/origin/master/master-config.yaml_*:
715+
+
716+
[source, yaml]
717+
----
718+
assetConfig:
719+
...
720+
extensionScripts:
721+
- /path/to/quota-messages.js
722+
----
723+
724+
. Restart the master host:
725+
+
726+
----
727+
ifdef::openshift-origin[]
728+
# systemctl restart origin-master
729+
endif::[]
730+
ifdef::openshift-enterprise[]
731+
# systemctl restart atomic-openshift-master
732+
endif::[]
733+
----
734+
690735
endif::[]
691736

692737
[[configuring-the-create-from-url-namespace-whitelist]]
@@ -1013,4 +1058,4 @@ xref:../install_config/install/advanced_install.adoc#advanced-install-configurin
10131058
# Configure loggingPublicURL in the master config for aggregate logging. Ansible is also able to install logging for you.
10141059
# See: https://docs.openshift.com/enterprise/latest/install_config/aggregate_logging.html
10151060
#openshift_master_logging_public_url=https://kibana.example.com
1016-
----
1061+
----

0 commit comments

Comments
 (0)