diff --git a/k8s/README.md b/k8s/README.md index 96a2aac..1856292 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -357,7 +357,7 @@ kubectl apply $(ls octobot-fabi/*.yaml | awk ' { print " -f " $1 } ') ```sh helm repo add nextcloud https://nextcloud.github.io/helm/ helm repo update -helm upgrade --install nextcloud nextcloud/nextcloud -n nextcloud --version 2.14.3 -f nextcloud/nextcloud.secret.yml +helm upgrade --install nextcloud nextcloud/nextcloud -n nextcloud --version 3.0.0 -f nextcloud/nextcloud.secret.yml helm upgrade --install nextcloud-phpmyadmin bitnami/phpmyadmin -n nextcloud -f nextcloud/nextcloud-phpmyadmin.yml ``` @@ -383,16 +383,29 @@ Unknown why normal url is not working. See https://help.nextcloud.com/t/davx5-co #TODO with Velero +## influxdb & mosquitto - -## fuel datalab +## datalab ```sh helm repo add influxdata https://helm.influxdata.com/ -helm upgrade --install influxdb influxdata/influxdb --namespace datalab --values datalab/influxdb.yml -helm upgrade --install telegraf influxdata/telegraf --namespace datalab --values datalab/telegraf.yml +# influx stuff +helm upgrade --install influxdb2 influxdata/influxdb2 --namespace datalab --values datalab/influxdb2.yml +helm upgrade --install telegraf-operator influxdata/telegraf-operator --namespace datalab --values datalab/telegraf-operator.yml +# helm repo add bitnami https://charts.bitnami.com/bitnami helm install postgres bitnami/postgresql --namespace datalab --values datalab/postgres.yml.secret +#mqtt +helm repo add TrueCharts https://charts.truecharts.org +helm repo update +helm upgrade --install mosquitto TrueCharts/mosquitto --namespace datalab --values datalab/mosquitto.yml +``` + +work with it + +```sh +# retrieve admin password +echo $(kubectl get secret influxdb2-auth -o "jsonpath={.data['admin-password']}" --namespace datalab | base64 --decode) ``` Tear down: diff --git a/k8s/datalab/influxdb.yml b/k8s/datalab/influxdb.yml deleted file mode 100644 index 60146ba..0000000 --- a/k8s/datalab/influxdb.yml +++ /dev/null @@ -1,8 +0,0 @@ -persistence: - size: 20Gi - -setDefaultUser: - enabled: true - user: - username: "admin" - password: "hdlmfg" \ No newline at end of file diff --git a/k8s/datalab/influxdb2.yml b/k8s/datalab/influxdb2.yml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/datalab/mosquitto.yml b/k8s/datalab/mosquitto.yml new file mode 100644 index 0000000..14b886c --- /dev/null +++ b/k8s/datalab/mosquitto.yml @@ -0,0 +1,25 @@ + + +configmap: + config: + enabled: true + data: + mosquitto.conf: | + listener {{ .Values.service.main.ports.main.targetPort }} + {{- if .Values.websockets.enabled }} + listener {{ .Values.service.websockets.ports.websockets.targetPort }} + protocol websockets + {{- end }} + {{- if .Values.auth.enabled }} + allow_anonymous false + {{- else }} + allow_anonymous true + {{- end }} + {{- if .Values.persistence.data.enabled }} + persistence true + persistence_location {{ .Values.persistence.data.mountPath }} + autosave_interval 1800 + {{- end }} + {{- if .Values.persistence.configinc.enabled }} + include_dir {{ .Values.persistence.configinc.mountPath }} + {{- end }} \ No newline at end of file diff --git a/k8s/datalab/telegraf-operator.yml b/k8s/datalab/telegraf-operator.yml new file mode 100644 index 0000000..91af5ae --- /dev/null +++ b/k8s/datalab/telegraf-operator.yml @@ -0,0 +1,5 @@ +replicaCount: 1 +certManager: + enable: true + +hotReload: true \ No newline at end of file diff --git a/k8s/datalab/telegraf.yml b/k8s/datalab/telegraf.yml deleted file mode 100644 index 80b45fc..0000000 --- a/k8s/datalab/telegraf.yml +++ /dev/null @@ -1,7 +0,0 @@ -config: - outputs: - - influxdb: - urls: - - "http://influxdb.datalab:8086" - database: "telegraf" - \ No newline at end of file diff --git a/k8s/kuard/deployment.yaml b/k8s/kuard/deployment.yaml index c2839d1..46388cc 100644 --- a/k8s/kuard/deployment.yaml +++ b/k8s/kuard/deployment.yaml @@ -1,21 +1,21 @@ -# apiVersion: apps/v1 -# kind: Deployment -# metadata: -# name: kuard -# namespace: kuard -# spec: -# selector: -# matchLabels: -# app: kuard -# replicas: 1 -# template: -# metadata: -# labels: -# app: kuard -# spec: -# containers: -# - image: gcr.io/kuar-demo/kuard-amd64:1 -# imagePullPolicy: Always -# name: kuard -# ports: -# - containerPort: 8080 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kuard + namespace: kuard +spec: + selector: + matchLabels: + app: kuard + replicas: 1 + template: + metadata: + labels: + app: kuard + spec: + containers: + - image: gcr.io/kuar-demo/kuard-amd64:1 + imagePullPolicy: Always + name: kuard + ports: + - containerPort: 8080 diff --git a/k8s/kuard/ingress.yaml b/k8s/kuard/ingress.yaml index 804d917..a64d479 100644 --- a/k8s/kuard/ingress.yaml +++ b/k8s/kuard/ingress.yaml @@ -1,22 +1,22 @@ -# apiVersion: extensions/v1beta1 -# kind: Ingress -# metadata: -# name: kuard -# namespace: kuard -# annotations: -# kubernetes.io/ingress.class: "nginx" -# cert-manager.io/cluster-issuer: "letsencrypt-prod" +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: kuard + namespace: kuard + annotations: + kubernetes.io/ingress.class: "nginx" + cert-manager.io/cluster-issuer: "letsencrypt-prod" -# spec: -# tls: -# - hosts: -# - "kuard.haumdaucher.de" -# secretName: kuard-haumdaucher -# rules: -# - host: kuard.haumdaucher.de -# http: -# paths: -# - path: / -# backend: -# serviceName: kuard -# servicePort: 80 +spec: + tls: + - hosts: + - "kuard.haumdaucher.de" + secretName: kuard-haumdaucher + rules: + - host: kuard.haumdaucher.de + http: + paths: + - path: / + backend: + serviceName: kuard + servicePort: 80 diff --git a/k8s/kuard/service.yaml b/k8s/kuard/service.yaml index b7ca3e6..37f0991 100644 --- a/k8s/kuard/service.yaml +++ b/k8s/kuard/service.yaml @@ -1,12 +1,12 @@ -# apiVersion: v1 -# kind: Service -# metadata: -# name: kuard -# namespace: kuard -# spec: -# ports: -# - port: 80 -# targetPort: 8080 -# protocol: TCP -# selector: -# app: kuard +apiVersion: v1 +kind: Service +metadata: + name: kuard + namespace: kuard +spec: + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + selector: + app: kuard diff --git a/k8s/octobot-fabi/config.secret.yaml b/k8s/octobot-fabi/config.secret.yaml new file mode 100644 index 0000000..90e2411 Binary files /dev/null and b/k8s/octobot-fabi/config.secret.yaml differ diff --git a/k8s/octobot-fabi/deployment.yaml b/k8s/octobot-fabi/deployment.yaml new file mode 100644 index 0000000..eddd9e0 --- /dev/null +++ b/k8s/octobot-fabi/deployment.yaml @@ -0,0 +1,78 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + k8s-app: octobot-fabi + name: octobot + namespace: octobot-fabi +spec: + selector: + matchLabels: + k8s-app: octobot-fabi + strategy: + rollingUpdate: + maxUnavailable: 0 + template: + metadata: + labels: + k8s-app: octobot-fabi + spec: + containers: + - resources: + requests: + cpu: "100m" + memory: "200Mi" + limits: + cpu: "1" + memory: "800Mi" + # # To make manual configurations on the container + # command: + # - "sleep" + # - "9999" + image: drakkarsoftware/octobot:stable + imagePullPolicy: Always + # livenessProbe: + # failureThreshold: 3 + # httpGet: + # path: /livez + # port: https + # scheme: HTTPS + # periodSeconds: 10 + name: metrics-server + ports: + - containerPort: 5001 + name: http + protocol: TCP + # readinessProbe: + # failureThreshold: 3 + # httpGet: + # path: /readyz + # port: https + # scheme: HTTPS + # periodSeconds: 10 + # securityContext: + # #readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + volumeMounts: + # - mountPath: /octobot/user + # name: octobot-config + # subPath: config.json + - mountPath: /octobot/user + name: user + - mountPath: /octobot/tentacles + name: tentacles + - mountPath: /octobot/logs + name: logs + nodeSelector: + kubernetes.io/os: linux + # serviceAccountName: metrics-server + volumes: + - name: user + persistentVolumeClaim: + claimName: octobot-user + - name: tentacles + persistentVolumeClaim: + claimName: octobot-tentacles + - emptyDir: {} + name: logs \ No newline at end of file diff --git a/k8s/octobot-fabi/oauth2.secret.values b/k8s/octobot-fabi/oauth2.secret.values new file mode 100644 index 0000000..07b25f9 Binary files /dev/null and b/k8s/octobot-fabi/oauth2.secret.values differ diff --git a/k8s/octobot-fabi/pvc.yaml b/k8s/octobot-fabi/pvc.yaml new file mode 100644 index 0000000..ca9f0d3 --- /dev/null +++ b/k8s/octobot-fabi/pvc.yaml @@ -0,0 +1,30 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + k8s-app: octobot-fabi + name: octobot-user + namespace: octobot-fabi +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: openebs-hostpath +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + k8s-app: octobot-fabi + name: octobot-tentacles + namespace: octobot-fabi +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: openebs-hostpath \ No newline at end of file diff --git a/k8s/octobot-fabi/service.yaml b/k8s/octobot-fabi/service.yaml new file mode 100644 index 0000000..0e73c25 --- /dev/null +++ b/k8s/octobot-fabi/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + k8s-app: octobot-fabi + name: octobot + namespace: octobot-fabi +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 5001 + selector: + k8s-app: octobot-fabi