update helm chart + development machine instructions

This commit is contained in:
2022-06-20 19:24:42 +02:00
parent 1c6e4ce30f
commit 945d735896
7 changed files with 90 additions and 0 deletions

45
Development.md Normal file
View File

@@ -0,0 +1,45 @@
# Development setup
## Install kubectl on client machine
See [installation tutorial here](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/)
## Install helm on client machine
See [installation tutorial here](https://helm.sh/docs/intro/install/)
## Configure cluster with kubectl
- Get cluster info with command `microk8s config`
- Add the cluster info to the kubectl config file on the client machine at `~/.kube/config`
Example config file
```bash
apiVersion: v1
clusters:
- cluster:
certificate-authority-data:
......
server: https://63.250.54.81:16443
name: homeserver
contexts:
- context:
cluster: homeserver
user: admin
name: homeserver
current-context: homeserver
kind: Config
preferences: {}
users:
- name: admin
user:
token: TnNDNURIV1I3RFdFMFora1NEaTdlNi9uNEgwR0pHRVRVajdPeFFrYWUvND0K
```
- In config file above, change context name
- To use this cluster with kubectl, enter `kubectl config use-context homeserver`
## Configure cluster with helm
- Run `helm --kube-context homeserver`

2
helm/Chart.yaml Normal file
View File

@@ -0,0 +1,2 @@
name: homeautomation
version: 0.0.1

3
helm/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Helm
This folder contains the helm template for my home automation setup.

View File

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mosquitto-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: microk8s-hostpath
resources:
requests:
storage: 1Gi

View File

View File

@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mosquitto
spec:
serviceName: mosquitto
selector:
matchLabels:
app: mosquitto
replicas: 1
template:
metadata:
labels:
app: mosquitto
spec:
containers:
- name: mosquitto
image: eclipse-mosquitto
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
volumeMounts:
- name: mosquitto-data
mountPath: /mosquitto/data
volumes:
- name: mosquitto-data
persistentVolumeClaim:
claimName: mosquitto-pvc