From cac867c9060c0a99b7f81886e9c49beffc8cac5a Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Sat, 4 May 2024 21:07:35 -0400 Subject: [PATCH] Add general api --- api/api-service.yaml | 14 +++++++ api/general-api/general-api-config-map.yaml | 15 +++++++ api/general-api/general-api-deployment.yaml | 46 +++++++++++++++++++++ api/general-api/sealed-secret.yaml | 15 +++++++ 4 files changed, 90 insertions(+) create mode 100644 api/api-service.yaml create mode 100644 api/general-api/general-api-config-map.yaml create mode 100644 api/general-api/general-api-deployment.yaml create mode 100644 api/general-api/sealed-secret.yaml diff --git a/api/api-service.yaml b/api/api-service.yaml new file mode 100644 index 0000000..e593432 --- /dev/null +++ b/api/api-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: api-service + namespace: api-ns +spec: + type: LoadBalancer + ports: + - name: general-api + port: 8080 + targetPort: 80 + + selector: + app: api-apps diff --git a/api/general-api/general-api-config-map.yaml b/api/general-api/general-api-config-map.yaml new file mode 100644 index 0000000..a42e892 --- /dev/null +++ b/api/general-api/general-api-config-map.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: general-api-config-map + namespace: api-ns +data: + config.yaml: | + images: + access_key: ${ACCESS_KEY} + secret_key: ${SECRET_KEY} + endpoint: s3.clortox.com + bucket: backgrounds + secure: True + weather: + period: 15 diff --git a/api/general-api/general-api-deployment.yaml b/api/general-api/general-api-deployment.yaml new file mode 100644 index 0000000..25fb235 --- /dev/null +++ b/api/general-api/general-api-deployment.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: general-api + namespace: api-ns + labels: + app: general-api +spec: + replicas: 1 + selector: + matchLabels: + app: api-apps + template: + metadata: + labels: + app: api-apps + spec: + containers: + - name: general-api + image: git.clortox.com/tyler/general-api:1.0.15 + imagePullPolicy: Always + env: + - name: ACCESS_KEY + valueFrom: + secretKeyRef: + name: general-api-secret + key: access-key + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: general-api-secret + key: secret-key + - name: CONFIG + value: "config.yaml" + ports: + - containerPort: 80 + volumesMounts: + - name: config-volume + mountPath: /media/config.yaml + volumes: + - name: config-volume + configMap: + name: general-api-config-map + items: + - key: config.yaml + path: config.yaml diff --git a/api/general-api/sealed-secret.yaml b/api/general-api/sealed-secret.yaml new file mode 100644 index 0000000..aec029c --- /dev/null +++ b/api/general-api/sealed-secret.yaml @@ -0,0 +1,15 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: general-api-secret + namespace: api-ns +spec: + encryptedData: + access-key: AgAPhGl0HfCpVQEmmLhArZgJgfXRUBEvokXse1mzEbsrIiSech0beSlKgTwrDwIFt//HISitEn3qtJkU1UXtVjhv8iTco9JgFLg/xmv+24eiRwG5smrtZqPN1iE7SL5kGfxM4RDvpSMxwdNnfsF53WGjsXIYaHtIVn316e2TQf85vSyLpq+BUgbgP5GqG931ur5ErZf48LHIdZ91wvxd1Lcog+C/jVKRmq0KvDKQZPJZD5qF1uyUiMz/ttY2NDLieGzkhQRpjVJmZaqHTdb6nBGcsMhdu8rI1pCkP8PHe8LsnwooRqPdZwg63Vdna7PzztrEesy5koyQwm4IOduB8xU48wY7KGiQ7ZLk4AHoamIQ1mYwK7D/Z5yvpVHItOUPsCzqo+JYbNhTMlXWVrCTWJU5D+CIvIgRUN5d4W4mM70wb75Glo5JGZr4Yw31zbxMSqCOzGeqILRwnKXP78RtM0URFU5sVfkvqbjm/1qP70YgtlowC/gBNEgHykYJV8CjeBb8tf1vjUDLOr+NgOj0FV/SrnFwan3YyMdwMirrZSoB3irta+7AEe1211ur+13JjZWhdbuJfCkP2l3uJz7zxWdGEapf2psCmC+syzyVrkEA5p1B0/Mu8H+d3dpranRmCWNOTySa1CEIPFuJ+ipxMsbQmPi7R60nQ6ZIUAOnJh/SAae1n1ixuOdc7KfYaSR+abYXMgrTBkC9riG6ew== + secret-key: AgCcGmblfLgGakV8y2p1S3PHReMe2EuqvnfM8XHs6mK8fRGlFIzUw9Rsi9R/MeEfSx5eBTHzN+Euy/ykWJAKhbWw0cEcx+YcL8RahnGAJIqFsSw+atYmv4MJ9JjsCXX+3H4svjtV5AiE019YxwwAX27QzMcEyWE3Rg7/WPNnqyvferfdI0j5NttDiFKyKQvZSrWg2knyopbfNywMijEICBGWgZMj/nRbNm2vXdgYWhFvxkGYVCuRjnbz+iU+T0PMlqWZmj1Yxs72QOoKBYa4pJxSfDjg1erTEiPQgFJPULiSiEargIrxcCdxRdbn9Us/qO26lgvTSCdtiHTzOALmeD9no8Cr6wqZDQD616OyBaFvTTcwCTa+YxaVB5mpoLHDUPOzjVBCpB7ojRH5nXXa7x3bIt9fz9dA9KNPywySsRcQ0hR/UoeMmtJfKx0I86VvxqhhhlEHAKAnUjZyCfaRvftCOkc4JfB9XZtDJr0/I47ToWNofEU1WDJlTkvm9dOJFvRsNGzsLAHhT3I/8cP+sCAY594lmI6J+MMfOjPV5Ig0xQic2my9clrKPohUbKue0R8cSUIb42OnskLOE0bx91JYXBdDeZ6lxawrWznWwPG3j7BsIslqDYSUeKFun91c4xSp2GvdliTS3Md/O/f+yqcBSKGnRkGXZaOpPEB+9MyP3PYVd2pSFt/7fXi9gFj2CxnbClVCsDNCf+hqVH52a2UB9Q758FLO+N+iSpzD61hQZg== + template: + metadata: + creationTimestamp: null + name: general-api-secret + namespace: api-ns