Skip to content

Commit

Permalink
Add AWSIOT connection for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MyChaOS87 committed Jan 16, 2023
1 parent db75b61 commit 0f9d0e2
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
24 changes: 24 additions & 0 deletions deployments/mosquitto/templates/awsiot.sealed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"kind": "SealedSecret",
"apiVersion": "bitnami.com/v1alpha1",
"metadata": {
"name": "awsiot-certificates",
"namespace": "mosquitto",
"creationTimestamp": null
},
"spec": {
"template": {
"metadata": {
"name": "awsiot-certificates",
"namespace": "mosquitto",
"creationTimestamp": null
}
},
"encryptedData": {
"awsiot.ca.pem": "AgCqJ77rGMRs64u8bwKHE2VU1bZM+w4cgIKz9W/ceqVLkyHXcclYtq8EAYTE/w4xZ2XhGtGUEZta0TWQrju8veW6ZQsHPD5aQbcPyqWttVawWNkQLlmrp0s9gFfWyjX7GbbjuVkvgQFStdQRcxNJDEGTTyukoN1vhAn/zIA+WHHhAc5NBHUdeKOI4Z3n5kv1y0tSiodRohxer1cJtcY566lnOLbvx8cNBPrD20xarjjs7wDJPS7JS0rkHA4e8UH8X9SHwU5ioQWe7hyzOPYAtWCJu8zuXUqdANcLi3SHhliel0GPNLcG73Iid4OhzlJPtG02kgpTX7koHLMNIbzJ6OhdyK3J2yUOo2vZLVBt1gl4EB5AnPfWWJ+4Pt/YaH2ZjRhUg/u8puxg4At9nJErbysnDFbhuBOfD9qta8W/mcIkWdmoa6aUEqwL6VsJ5T7wbSfXP7nVoV+s45NuCpOP9cwZFD2EkqDW7224u+hhbOBSN9J7Xwao7eYzFBwQMC7hnjOGazNvO3+WgciAUciC5Mv04HanDJLJwbvPLuBS7/OXL622soHMAXDXpSur1ppPt18DLtVEfTcer4mQF4jUZAfmzDNiMWxYE0ARCQpU+VQ7gYNkxJ4a1Ugm241oFX3fRhqFenMAqf0IGHwtMrNXcx4shw3cfRjuVnCW68C25CAovj0C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/xg9CaD8f1kgC/Xagf6lC9v0EM1xWfQwQWRrm+w79363IlDQddvF2J/ciDzidvKVtGrqAhsfP0OH2+1QprIK81MkfYXjTYOyT1ZdXWPRzSX0QtRkHhij3PNtub/T8sa/S8cE0z5O498FoYPikUwzkR6OqVzaPFplUoFb9MJ/PiihB0+Y04RkUr0bkttuCfybT5Z63iwM0nPg9U3Cen/9qvtUa4riL5pohGzckPKTDURTVxDIZa6ABhqISx7BVlAz6+Ov/oDAsq3nfq/crzMGo8F5WhrFr+x76MRPAOFNNdYde2uodmAhOeJtu1rqzfj1qMTaUIjOzg93Bg+JIQvf+atD2VsOTBXl46tfej7U9wo1iGLDUcqzct49DQx6WLn5Szrtz+fLoYiJlnFHL+NyAxTy+zy3GMSilkIGlUKcxqsuUfQ27sfS0DQfiugynHSUiuJ1p40ZaTiw767xgg/xlmKkx7O8jLlKxncstyTYpY167RFxBhk/5IDbFaFeq3G1IfchrQFmaaU041iTWSkXl6yLhfkQ7JOS/8VyZ1GytpSB1QwkPQwq+vmd4eR7+hijxKGmRVOdEEvqf9pZOCp4sv9xR5pIbtfv2FFy4zY4qkbLrshG4XxDXcAuqooi6CSSvsbJZkQoOxKXoRI45fp7ZLGV/LX"
}
}
}
14 changes: 14 additions & 0 deletions deployments/mosquitto/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@ data:
log_dest stdout
allow_anonymous true
connection awsiot
address a2r45j733id3jo-ats.iot.eu-central-1.amazonaws.com:8883
topic shellies/+/relay/+/power out 1
topic shellies/+/relay/+/energy out 1
bridge_insecure false
cleansession true
clientid bridgeawsiot
start_type automatic
notifications false
log_type all
bridge_cafile /etc/mosquitto/certs/awsiot/awsiot.ca.pem
bridge_certfile /etc/mosquitto/certs/awsiot/awsiot.cert.crt
bridge_keyfile /etc/mosquitto/certs/awsiot/awsiot.private.key
6 changes: 6 additions & 0 deletions deployments/mosquitto/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ spec:
mountPath: /mosquitto/config/mosquitto.conf
subPath: mosquitto.conf
readOnly: true
- name: certs
readOnly: true
mountPath: /etc/mosquitto/certs/awsiot
volumes:
- name: config
configMap:
name: {{ include "mosquitto.fullname" . }}
- name: certs
secret:
secretName: awsiot-certificates
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
29 changes: 29 additions & 0 deletions seal-awsiotbridge-certificates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -e +x

echo Trying to find the AWS IOT Certificates ... 1>&2
[ ! -f .secrets/awsiot.ca.pem ] && echo .ssh/awsiot.cert.pem does not exist 1>&2 && exit 1
[ ! -f .secrets/awsiot.cert.crt ] && echo .ssh/awsiot.cert.crt does not exist 1>&2 && exit 1
[ ! -f .secrets/awsiot.public.key ] && echo .ssh/awsiot.public.key does not exist 1>&2 && exit 1
[ ! -f .secrets/awsiot.private.key ] && echo .ssh/awsiot.private.key does not exist 1>&2 && exit 1

echo Sealing certificates/keys into secret ... 1>&2

kubeseal > deployments/mosquitto/templates/awsiot.sealed.json << EOF
apiVersion: v1
kind: Secret
metadata:
name: awsiot-certificates
namespace: mosquitto
data:
awsiot.ca.pem: |
$(cat .secrets/awsiot.ca.pem | base64 | sed 's/^/ /')
awsiot.cert.crt: |
$(cat .secrets/awsiot.cert.crt | base64 | sed 's/^/ /')
awsiot.public.key: |
$(cat .secrets/awsiot.public.key | base64 | sed 's/^/ /')
awsiot.private.key: |
$(cat .secrets/awsiot.private.key | base64 | sed 's/^/ /')
EOF

echo Secrets are sealed 1>&2

0 comments on commit 0f9d0e2

Please sign in to comment.