Skip to content

Commit

Permalink
Merge pull request #4 from bennsimon/change-default-domain-prefix
Browse files Browse the repository at this point in the history
use bennsimon.github.io as default domain
  • Loading branch information
bennsimon committed Jan 16, 2023
2 parents dd05416 + 527653b commit bae51f1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
domain: my.domain
domain: bennsimon.github.io
layout:
- go.kubebuilder.io/v3
projectName: uptimerobot-operator
repo: github.com/bennsimon/uptimerobot-operator
resources:
- controller: true
domain: my.domain
group: my.domain
domain: bennsimon.github.io
group: bennsimon.github.io
kind: Uptimerobot
version: v1
version: "3"
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go](https://github.com/bennsimon/uptimerobot-operator/actions/workflows/go.yaml/badge.svg?branch=main)](https://github.com/bennsimon/uptimerobot-operator/actions/workflows/go.yaml)

The operator creates, updates, deletes uptimerobot monitors for a particular ingress resource. It's designed to use `friendly_name` attribute of a monitor and/or alert contact for unique identification.
The operator creates, updates, deletes uptimerobot monitors for a particular ingress resource. It's designed to use `friendly_name` parameter of a monitor and/or alert contact for unique identification.

## Description

Expand All @@ -16,21 +16,26 @@ Environment Variables Supported:

In addition to the environments supplied on the tooling mentioned above, the operator has the following configurations.

| Variable | Description | Default |
|-----------------|---------------------------------------------------------|-------------|
| `DOMAIN_PREFIX` | The domain name to use when specifying the annotations. | `my.domain` |
| Variable | Description | Default |
|-----------------|---------------------------------------------------------|-----------------------|
| `DOMAIN_PREFIX` | The domain name to use when specifying the annotations. | `bennsimon.github.io` |

With the `DOMAIN_PREFIX` as `my.domain` the configurations will be supplied as follows:
With the `DOMAIN_PREFIX` as `bennsimon.github.io` the configurations will be supplied as follows:

Example 1
```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: https-minimal-ingress
annotations:
my.domain/uptimerobot-monitor: "true"
my.domain/uptimerobot-monitor-type: "HTTP"
my.domain/uptimerobot-monitor-friendly_name: "tester"
bennsimon.github.io/uptimerobot-monitor: "true"
bennsimon.github.io/uptimerobot-monitor-type: "HTTP"
bennsimon.github.io/uptimerobot-monitor-friendly_name: "tester"
bennsimon.github.io/uptimerobot-monitor-alert_contacts: "tester opsgenie"
bennsimon.github.io/uptimerobot-monitor-interval: "60"
bennsimon.github.io/uptimerobot-monitor-timeout: "30"
# To use more parameters append valid uptimerobot monitor api parameter from https://uptimerobot.com/api/ to the prefix `bennsimon.github.io/uptimerobot-monitor-`
spec:
rules:
- host: test-domain.localhost
Expand All @@ -47,10 +52,10 @@ spec:

The operator reads configurations of the monitor from the annotation on the ingress resource.

The first annotation entry `my.domain/uptimerobot-monitor` enables the ingress resource to be evaluated by the operator. The other annotations supply the attributes of the monitor. The naming convention is:
`my.domain/uptimerobot-monitor-<attrib>`.
**The first annotation entry `bennsimon.github.io/uptimerobot-monitor` enables the ingress resource to be evaluated by the operator. The other annotations supply the parameters of the monitor. The naming convention is:
`bennsimon.github.io/uptimerobot-monitor-<parameter>`.**

To get more attributes refer to the tooling documentation and uptime robot api documentation.
**To get more parameters refer to the [tooling documentation](https://github.com/bennsimon/uptimerobot-tooling) and uptimerobot api documentation.**

## Getting Started

Expand Down Expand Up @@ -154,7 +159,7 @@ spec:
# value: "-"
# - name: MONITOR_ALERT_CONTACTS_ATTRIB_DELIMITER
# value: "_"
image: bennsimon/uptimerobot-operator:v0.0.2
image: bennsimon/uptimerobot-operator:v0.1.0
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -197,13 +202,13 @@ Use the latest tag from [dockerhub](https://hub.docker.com/r/bennsimon/uptimerob
1. Build and push your image to the location specified by `IMG`:

```sh
make docker-build docker-push IMG=bennsimon/uptimerobot-operator:v0.0.2
make docker-build docker-push IMG=bennsimon/uptimerobot-operator:v0.1.0
```

2. Deploy the controller to the cluster with the image specified by `IMG`:

```sh
make deploy IMG=bennsimon/uptimerobot-operator:v0.0.2
make deploy IMG=bennsimon/uptimerobot-operator:v0.1.0
```

### Uninstall CRDs
Expand Down
4 changes: 2 additions & 2 deletions charts/uptimerobot-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.3
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.0.2"
appVersion: "v0.1.0"
2 changes: 1 addition & 1 deletion charts/uptimerobot-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following table lists the configurable parameters of the Uptimerobot-operato
| `replicaCount` | | `1` |
| `image.repository` | | `"bennsimon/uptimerobot-operator"` |
| `image.pullPolicy` | | `"IfNotPresent"` |
| `image.tag` | | `"v0.0.2"` |
| `image.tag` | | `"v0.1.0"` |
| `imagePullSecrets` | | `[]` |
| `nameOverride` | | `""` |
| `fullnameOverride` | | `""` |
Expand Down
2 changes: 1 addition & 1 deletion charts/uptimerobot-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
repository: bennsimon/uptimerobot-operator
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.0.2"
tag: "v0.1.0"

imagePullSecrets: []
nameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: bennsimon/uptimerobot-operator
newTag: v0.0.2
newTag: v0.1.0
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "b6c1f3bb.my.domain",
LeaderElectionID: "b6c1f3bb.bennsimon.github.io",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
2 changes: 1 addition & 1 deletion util/monitorutil/monitorutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func GetUptimeRobotDomain() string {
prefixStr := "/" + AnnotationPrefix
envPrefix := getUptimeRobotDomain()
if len(envPrefix) == 0 {
return "my.domain" + prefixStr
return "bennsimon.github.io" + prefixStr
}
return envPrefix + prefixStr
}
Expand Down

0 comments on commit bae51f1

Please sign in to comment.