github.com/stakater/IngressMonitorController@v1.0.103/docs/Deploying-to-Openshift.md (about)

     1  # Deploying to Openshift
     2  
     3  Ingress Monitor Controller can be used to watch routes in a specific namespace, or all namespaces. By default the
     4   controller watches in all namespaces. To use Ingress Monitor Controller for a specific namespace, the relevant
     5   instructions where indicated should be followed.  
     6  
     7  ### Supported Openshift versions
     8  
     9  Ingress Monitor Controller has been tested with Openshift version 3.7.x and 3.9.x, and should work with higher versions.
    10  
    11  ### Enabling
    12  
    13  By default, the controller ignores the routes without a specific annotation on it. You will need to add the following annotation on your routes so that the controller is able to recognize and monitor the routes.
    14  
    15  ```yaml
    16  "monitor.stakater.com/enabled": "true"
    17  ```
    18  
    19  The annotation key is `monitor.stakater.com/enabled` and you can toggle the value of this annotation between `true` and `false` to enable or disable monitoring of that specific route.
    20  
    21  ### Configuration
    22  
    23  Following are the available options that you can use to customize the controller:
    24  
    25  | Key                   |Description                                                                    |
    26  |-----------------------|-------------------------------------------------------------------------------|
    27  | providers             | An array of uptime providers that you want to add to your controller          |
    28  | enableMonitorDeletion | A safeguard flag that is used to enable or disable monitor deletion on route deletion (Useful for prod environments where you don't want to remove monitor on route deletion) |
    29  | resyncPeriod          | Resync period in seconds, allows to re-sync periodically the monitors with the Routes. Defaults to 0 (= disabled) |
    30  | watchNamespace        | Name of the namespace if you want to monitor routes only in that namespace. Defaults to null |
    31  
    32  For the list of providers, there are a number of options that you need to specify. The table below lists them:
    33  
    34  | Key           | Description                                                               |
    35  |---------------|---------------------------------------------------------------------------|
    36  | name          | Name of the provider (From the list of supported uptime checkers)         |
    37  | apiKey        | ApiKey of the provider                                                    |
    38  | apiURL        | Base url of the ApiProvider                                               |
    39  | alertContacts | A `-` separated list of contact id's that you want to add to the monitors |
    40  
    41  #### Uptime Checker specific
    42  ##### UptimeRobot ([https://uptimerobot.com](https://uptimerobot.com))
    43  Follow the [UptimeRobot Configuration guide](uptimerobot-configuration.md) to see how to fetch `alertContacts` from UptimeRobot.
    44  
    45  ##### Pingdom ([https://pingdom.com](https://pingdom.com))
    46  [Pingdom Configuration guide](../docs/pingdom-configuration.md)
    47  
    48  ##### Statuscake ([https://www.statuscake.com](https://www.statuscake.com))
    49  [Statuscake Configuration guide](../docs/statuscake-configuration.md)
    50  
    51  #### Configuring through route annotations
    52  
    53  The following optional annotations allow you to set further configuration:
    54  
    55  | Annotation                            | Description                                                                                                                 |
    56  |---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
    57  | `"monitor.stakater.com/forceHttps"`   | If set to the string `"true"`, the monitor endpoint will use HTTPS, even if the route manifest itself doesn't specify TLS |
    58  | `"monitor.stakater.com/overridePath"` | Set this annotation to define the healthcheck path for this monitor, overriding the controller's default logic              |
    59  | `"monitor.stakater.com/name"`         | Set this annotation to define the Monitor friendly name in Uptime Robot. If unset, defaults to the template in the config   |
    60  
    61  ### Vanilla Manifests
    62  
    63  The Ingress Monitor Controller can be deployed with vanilla manifests or Helm Charts. For Vanilla manifests, download the
    64   [ingressmonitorcontroller.yaml](https://github.com/stakater/IngressMonitorController/blob/master/deployments/kubernetes/ingressmonitorcontroller.yaml) file.
    65  
    66  #### Configuring
    67  
    68  The configuration discussed in the above section needs to be done by modifying `config.yaml` data for the ConfigMap resource in the `ingressmonitorcontroller.yaml` file. 
    69  
    70  ##### Using Secrets
    71  
    72  To pass user credentials/ API keys in secrets:
    73      
    74    1. Open [values.yaml](https://github.com/stakater/IngressMonitorController/blob/master/deployments/kubernetes/chart/ingressmonitorcontroller/values.yaml) file by navigating to `deployments/kubernetes/chart/ingressmonitorcontroller/`
    75    
    76    2. Set `mount` equals to `"secret"` and pass the data in the data section at the bottom.
    77    
    78    3. Run `helm template . > file_to_generate.yaml`
    79    
    80    4. Deploy using the `Deploying` section below.
    81  
    82  To use existing Secrets:
    83  
    84    1. Open [values.yaml](https://github.com/stakater/IngressMonitorController/blob/master/deployments/kubernetes/chart/ingressmonitorcontroller/values.yaml) file by navigating to `deployments/kubernetes/chart/ingressmonitorcontroller/`
    85  
    86    2. Set `mount` equals to `"secret"` and pass the data in the data section at the bottom.
    87  
    88    3. Set `existingSecret` to `EXISTING_SECRET_NAME`
    89  
    90  
    91  ##### Using ConfigMap
    92  
    93  To pass user credentials/ API keys in secrets:
    94       
    95    1. Open [values.yaml](https://github.com/stakater/IngressMonitorController/blob/master/deployments/kubernetes/chart/ingressmonitorcontroller/values.yaml) file by navigating to `deployments/kubernetes/chart/ingressmonitorcontroller/`
    96    
    97    2. Set `mount` equals to `"configMap"` and pass the data in the data section at the bottom.
    98    
    99    3. Run `helm template . > file_to_generate.yaml`
   100    
   101    4. Deploy using the `Deploying` section below.
   102  
   103  ##### Running for a single namespace
   104  
   105  Add environment variable `KUBERNETES_NAMESPACE` in `ingressmonitorcontroller.yaml` for the Deployment resource and set its value
   106   to the namespace you want to watch in. After that, apply the `ingressmonitorcontroller.yaml` manifest in any namespace.
   107    The deployed controller will now watch only that namespace.
   108  
   109  #### Deploying
   110  
   111  You can deploy the controller in the namespace you want to monitor by running the following command:
   112  
   113  ```bash
   114  oc create -f ingressmonitorcontroller.yaml -n <namespace>
   115  ```
   116  
   117  *Note*: Before applying `ingressmonitorcontroller.yaml`, You need to modify the namespace in the `RoleBinding` subjects section to the namespace you want to apply RBAC to.
   118  
   119  ### Helm Charts
   120  
   121  The Ingress Monitor Controller can be deployed with Helm Charts or vanilla manifests. For Helm Charts follow the below steps:
   122  
   123  1. Add the chart repo:
   124  
   125     i. `helm repo add stakater https://stakater.github.io/stakater-charts/`
   126  
   127     ii. `helm repo update`
   128  2. Set configuration as discussed in the Configuration section
   129  
   130     i. `helm fetch --untar stakater/ingressmonitorcontroller`
   131  
   132     ii. Open and edit `ingressmonitorcontroller/values.yaml` in a text editor
   133  3. Install the chart
   134     * `helm install stakater/ingressmonitorcontroller -f ingressmonitorcontroller/values.yaml -n ingressmonitorcontroller`
   135  
   136  ##### Running for a single namespace
   137  
   138  Set `watchNamespace` to `<namespace-name>` in `ingressmonitorcontroller/values.yaml` before applying the helm chart
   139   and the controller will then watch in that namespace.
   140  
   141  ## Bug Reports & Feature Requests
   142  
   143  Please use the [issue tracker](https://github.com/stakater/IngressMonitorController/issues) to report any bugs or file feature requests.
   144  
   145  ## Changelog
   146  
   147  View our closed [Pull Requests](https://github.com/stakater/IngressMonitorController/pulls?q=is%3Apr+is%3Aclosed).