Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roll iotam and iota deployments if config has changed #93

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/iot-agent-manager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for IoT Agent Manager
name: iot-agent-manager
version: 0.1.7
version: 0.1.8
sources:
- https://github.com/telefonicaid/iotagent-manager
maintainers:
Expand Down
22 changes: 12 additions & 10 deletions charts/iot-agent-manager/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ This directory contains a Kubernetes chart to deploy an
cluster using Deployment.

## Todo
* Finalise README

- Finalise README

## Chart Details

This chart will do the following:

* Implement a HA scalable IoT Agent Manager cluster using a Kubernetes Deployment.
- Implement a HA scalable IoT Agent Manager cluster using a Kubernetes Deployment.

## Installing the Chart

Expand All @@ -31,14 +33,14 @@ TODO
The following table lists the configurable parameters of the IoT Agent Manager
chart and their default values.

| Parameter | Description | Default |
|-----------------------------------|---------------------------------------------|-----------------------------------------------------|
| `replicaCount` | Amount of pods to spawn | `3` |
| `image.repository` | The image to pull | `fiware/iotagent-ul` |
| `image.tag` | The version of the image to pull | `1.9.0` |
| `image.pullPolicy` | The pull policy | `IfNotPresent` |
| `priorityClassName` | If specified, indicates the pod's priority | `` |
| `affinity` | If specified, defines affinity rules | `` |
| Parameter | Description | Default |
| ------------------- | ------------------------------------------ | -------------------------------- |
| `replicaCount` | Amount of pods to spawn | `3` |
| `image.repository` | The image to pull | `telefonicaiot/iotagent-manager` |
| `image.tag` | The version of the image to pull | `1.13.0` |
| `image.pullPolicy` | The pull policy | `IfNotPresent` |
| `priorityClassName` | If specified, indicates the pod's priority | `` |
| `affinity` | If specified, defines affinity rules | `` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand Down
4 changes: 2 additions & 2 deletions charts/iot-agent-manager/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
name: {{ template "iot-agent-manager.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
name: {{ template "iot-agent-manager.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
Expand All @@ -20,4 +20,4 @@ spec:
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetAverageUtilization }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/iot-agent-manager/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
chaos.alpha.kubernetes.io/enabled: "{{ .Values.chaos.enabled }}"
labels:
app: {{ template "iot-agent-manager.name" . }}
Expand Down
4 changes: 2 additions & 2 deletions charts/iot-agent-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
replicaCount: 1
image:
repository: telefonicaiot/iotagent-manager
tag: 1.6.0
tag: 1.13.0
pullPolicy: IfNotPresent

chaos:
Expand Down Expand Up @@ -37,7 +37,7 @@ mongo:
# The name of the replicaset iot-agent will attempt to connect to
rs: rs
# The hostname of the mongodb service
dbhost: mongo-rs-mongodb-replicaset-0.mongo-rs-mongodb-replicaset.prod,mongo-rs-mongodb-replicaset-1.mongo-rs-mongodb-replicaset.prod,mongo-rs-mongodb-replicaset-2.mongo-rs-mongodb-replicaset.prod
dbhost: mongo-rs-mongodb-replicaset.prod
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c0c0n3 Unfortunately i'm not using IOTA and IOTAM anymore and this PR is quite old, so i do not remember completely. But there is something in the back of my mind that this change was not as flawless as it should be and we ran into some problems with it. Could you please doublecheck that using the servicename instead of the members seperately is supported and works fine with mongo pod restarts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@modularTaco thanks for the heads up, much appreciated! we'll review and retest to see if there are any issues

# The database name to be used for the agent
dbname: iot-agent-manager
# The database name to be used for the agent
Expand Down
2 changes: 1 addition & 1 deletion charts/iot-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for NodeJS based IoT Agents
name: iot-agent
version: 0.1.15
version: 0.1.16
sources:
- https://github.com/telefonicaid/iotagent-json
- https://github.com/telefonicaid/iotagent-ul
Expand Down
53 changes: 28 additions & 25 deletions charts/iot-agent/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
This directory contains a Kubernetes chart to deploy an IoT Agent cluster using
Deployment. IoT Agents supported are:

* [UL](https://github.com/telefonicaid/iotagent-ul) v1.13
* [JSON](https://github.com/telefonicaid/iotagent-json) v1.14
* [LORAWAN](https://github.com/Atos-Research-and-Innovation/IoTagent-LoRaWAN)
- [UL](https://github.com/telefonicaid/iotagent-ul) v1.13
- [JSON](https://github.com/telefonicaid/iotagent-json) v1.14
- [LORAWAN](https://github.com/Atos-Research-and-Innovation/IoTagent-LoRaWAN)

## Prerequisites Details
* Kubernetes 1.9+

- Kubernetes 1.9+

## Todo
* Finalise README

- Finalise README

## Chart Details

This chart will do the following:

* Implement a HA scalable IoT Agent cluster using a Kubernetes Deployment.
- Implement a HA scalable IoT Agent cluster using a Kubernetes Deployment.

## Installing the Chart

Expand All @@ -37,25 +40,25 @@ TODO
The following table lists the configurable parameters of the IoT Agent
chart and their default values.

| Parameter | Description | Default |
|-----------------------------------|---------------------------------------------|-----------------------------------------------------|
| `replicaCount` | Amount of pods to spawn | `3` |
| `image.repository` | The image to pull | `fiware/iotagent-ul` |
| `image.tag` | The version of the image to pull | `1.9.0` |
| `image.pullPolicy` | The pull policy | `IfNotPresent` |
| `service.agentType` | The type of agent deployed | `ul` |
| `service.name` | Name of the service deployed | `iotagent-ul` |
| `service.timestamp` | If this flag is activated, the IoT Agent will add a 'TimeInstant' metadata attribute to all the attributes updated from device information. | `true`
| `service.defaultService` | default service for the IoT Agent. If a device is being registered, and no service information comes with the device data, and no service information is configured for the given type, the default IoT agent service will be used instead. | `Default` |
| `service.defaultSubservice` | default subservice for the IoT Agent. If a device is being registered, and no subservice information comes with the device data, and no subservice information is configured for the given type, the default IoT agent subservice will be used instead. | '/' |
| `service.providerUrl` | URL to send in the Context Provider registration requests. Should represent the external IP of the deployed IoT Agent (the IP where the Context Broker will redirect the NGSI requests) | 'http://ul-iot-agent:4041' |
| `service.deviceRegistrationDuration` | duration of the registrations as Context Providers, in ISO 8601 standard format. | P1M |
| `priorityClassName` | If specified, indicates the pod's priority | `` |
| `affinity` | If specified, defines affinity rules | `` |
| Parameter | Description | Default |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| `replicaCount` | Amount of pods to spawn | `3` |
| `image.repository` | The image to pull | `fiware/iotagent-ul` |
| `image.tag` | The version of the image to pull | `1.9.0` |
| `image.pullPolicy` | The pull policy | `IfNotPresent` |
| `service.agentType` | The type of agent deployed | `ul` |
| `service.name` | Name of the service deployed | `iotagent-ul` |
| `service.timestamp` | If this flag is activated, the IoT Agent will add a 'TimeInstant' metadata attribute to all the attributes updated from device information. | `true` |
| `service.defaultService` | default service for the IoT Agent. If a device is being registered, and no service information comes with the device data, and no service information is configured for the given type, the default IoT agent service will be used instead. | `Default` |
| `service.defaultSubservice` | default subservice for the IoT Agent. If a device is being registered, and no subservice information comes with the device data, and no subservice information is configured for the given type, the default IoT agent subservice will be used instead. | '/' |
| `service.providerUrl` | URL to send in the Context Provider registration requests. Should represent the external IP of the deployed IoT Agent (the IP where the Context Broker will redirect the NGSI requests) | 'http://ul-iot-agent:4041' |
| `service.deviceRegistrationDuration` | duration of the registrations as Context Providers, in ISO 8601 standard format. | P1M |
| `priorityClassName` | If specified, indicates the pod's priority | `` |
| `affinity` | If specified, defines affinity rules | `` |

> **NOTE**: Be careful with enabling `multiCore: true` on k8s running on top of aws nodes.
We witnessed processors constantly spawn and killed, without any instance
remaining active.
> We witnessed processors constantly spawn and killed, without any instance
> remaining active.

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand All @@ -67,8 +70,8 @@ $ helm install --name my-release -f values.yaml oc/iot-agent

> **Tip**: You can use the default [values.yaml](values.yaml)

> **Tip**: Use `service.agentType` to define the type of agent to that
agent specific configuration is applied
> **Tip**: Use `service.agentType` to define the type of agent to that
> agent specific configuration is applied

## Cleanup

Expand Down
4 changes: 2 additions & 2 deletions charts/iot-agent/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
name: {{ template "iot-agent.fullname" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
name: {{ template "iot-agent.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
Expand All @@ -21,4 +21,4 @@ spec:
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetAverageUtilization }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/iot-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-" .Values.agent.agentType ".yaml") . | sha256sum }}
chaos.alpha.kubernetes.io/enabled: "{{ .Values.chaos.enabled }}"
labels:
app: {{ template "iot-agent.name" . }}
Expand Down