Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ on:
push:
branches:
- main
paths:
Copy link
Author

@andrewsomething andrewsomething Dec 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is used to make the action trigger only on changes to certain files. It's not required. In my example repo, I did it mainly to keep it from deploying on changes to the README. You can remove it completely like this or update it to include the things required for the python app (e.g. server.py).

https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths

- 'config/**'
- 'site/**'
- 'Dockerfile'
- '.github/workflows/**'

jobs:

Expand All @@ -18,9 +13,6 @@ jobs:
- name: Checkout master
uses: actions/checkout@main

- name: Update SHA
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing as it the directory does not exist. It is part of the static site example and not needed for the python app.

https://github.com/sharmita3/sample-python/runs/1481140544?check_suite_focus=true#step:3:4

run: echo $GITHUB_SHA > $GITHUB_WORKSPACE/site/_meta

- name: Build container image
run: docker build -t registry.digitalocean.com/sdas/python-example:$(echo $GITHUB_SHA | head -c7) .

Expand Down
10 changes: 3 additions & 7 deletions config/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ apiVersion: v1
kind: Service
metadata:
name: python-example-service
annotations:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These annotations are used to manage DNS using external-dns and set up SSL. It's not strictly required for a push to deploy example and would require additional prerequisites.

https://www.digitalocean.com/docs/kubernetes/how-to/configure-load-balancers/#ssl-certificates
https://blog.andrewsomething.com/2019/04/04/external-dns-with-ssl-on-k8s/

external-dns.alpha.kubernetes.io/hostname: "doctl-action.do-api.dev"
service.beta.kubernetes.io/do-loadbalancer-certificate-id: "37f354b1-0043-4bef-84b9-4666390026f3"
service.beta.kubernetes.io/do-loadbalancer-redirect-http-to-https: "true"
spec:
type: LoadBalancer
ports:
- name: https
- name: http
protocol: TCP
port: 443
targetPort: 5000
port: 80
targetPort: 80
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This app listens on port 80, so we need to update the targetPort.

https://github.com/sharmita3/sample-python/blob/main/server.py#L16

Since we removed the SSL configuration above, we need to change the port to 80 as well.

selector:
app: python-example