Want to start by saying I'm pretty new to Kubernetes and I'm finding it hard to formulate a proper question.
The implementation I'm using of k8s is microk8s.
I have this application that analyzes a feed from a camera. The url of the camera feed is configurable.
At the moment I have 10 cameras. My current solution is to have 10 different deployments and 10 different configmaps looking like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: camera-1-10
spec:
replicas: 1
selector:
matchLabels:
app: camera-1-10
strategy: {}
template:
metadata:
labels:
app: camera-1-10
spec:
volumes:
- name: camera-config
configMap:
name: camera1.json
containers:
- image: xxxxx.azurecr.io/camera-application:0.0.14
name: myrepo
ports:
- containerPort: 3000
volumeMounts:
- name: camera-config
mountPath: "/config/camera.json"
subPath: "data"
imagePullSecrets:
- name: acrsecret
What I don't like about this solution is that I have 10 deployment-yamls and if I want to update the version number of the application I have to change in 10 different files. It also feels like the work of adding a new camera is more than I would like.
Is there an easier way of solving this?
Can I have 1 deployment which describes what container to use.
Then 10 pods just referencing different configmaps?
Is there a way of adding a new camera by just using configs?
To define the number of different camera-pods by configuring something in k8s?