diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml new file mode 100644 index 0000000..32dc63c --- /dev/null +++ b/.github/workflows/helm-chart.yml @@ -0,0 +1,29 @@ +name: Package Helm Chart + +on: + push: + branches: + - main + +jobs: + package: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: 'v3.7.0' + + - name: Package Helm chart + run: helm package ./charts --version 1.0.0 + + - name: Publish Helm chart package + uses: GitHubPackages/publish-package@v1 + with: + package_name: my-chart + package_version: 1.0.0 + token: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/charts/Chart.yaml b/charts/Chart.yaml new file mode 100644 index 0000000..f72d46b --- /dev/null +++ b/charts/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: durpapi +description: A Helm chart for Kubernetes +type: application + +version: 0.1.0 +appVersion: "0.1.0" diff --git a/charts/templates/deployment.yaml b/charts/templates/deployment.yaml new file mode 100644 index 0000000..7dcf5f5 --- /dev/null +++ b/charts/templates/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: durpapi + name: durpapi + labels: + app: durpapi +spec: + selector: + matchLabels: + app: durpapi + replicas: 1 + template: + metadata: + labels: + app: durpapi + spec: + containers: + - name: durpapi + image: ghcr.io/developerdurp/durpapi:latest + imagePullPolicy: Always + ports: + - name: http + containerPort: 8080 + envFrom: + - secretRef: + name: durpapi-secret \ No newline at end of file diff --git a/charts/templates/ingress.yaml b/charts/templates/ingress.yaml new file mode 100644 index 0000000..611a2f0 --- /dev/null +++ b/charts/templates/ingress.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: durpapi-ingress + annotations: + kubernetes.io/ingress.class: nginx + cert-manager.io/cluster-issuer: letsencrypt-production +spec: + rules: + - host: durpapi.durp.info + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: durpapi + port: + number: 8080 + tls: + - hosts: + - durpapi.durp.info + secretName: durpapi-tls \ No newline at end of file diff --git a/charts/templates/secret.yaml b/charts/templates/secret.yaml new file mode 100644 index 0000000..fbc911e --- /dev/null +++ b/charts/templates/secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +data: + OPENAI_API_KEY: + UNRAID_API_KEY: + UNRAID_URI: + jwtToken: +kind: Secret +metadata: + creationTimestamp: null + name: durpapi-secret + namespace: durpapi diff --git a/charts/templates/service.yaml b/charts/templates/service.yaml new file mode 100644 index 0000000..aa51924 --- /dev/null +++ b/charts/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: durpapi +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + protocol: TCP + selector: + app: durpapi \ No newline at end of file