-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
033f689
commit eec0dae
Showing
34 changed files
with
709 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: fulcimen | ||
name: fulcimen | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: fulcimen | ||
template: | ||
metadata: | ||
annotations: | ||
imageregistry: "https://docker.pkg.github.com" | ||
labels: | ||
app: fulcimen | ||
spec: | ||
containers: | ||
- name: fulcimen | ||
image: docker.pkg.github.com/mlibrary/heliotropium/fulcimen:latest | ||
ports: | ||
- containerPort: 3000 | ||
imagePullSecrets: | ||
- name: github-packages-read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: fulcimen | ||
name: web # hatcher-umich magic name for auto-magic DNS entry | ||
spec: | ||
ports: | ||
- port: 80 # static node port (virtual or physical machine) | ||
protocol: TCP | ||
targetPort: 3000 # container port e.g. deployment/fulcimen | ||
selector: | ||
app: fulcimen | ||
type: LoadBalancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: fulcimen-mysql | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: fulcimen | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: fulcimen | ||
spec: | ||
containers: | ||
- image: mysql:5.6 | ||
name: fulcimen-mysql | ||
env: | ||
# Use secret in real usage | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: password | ||
ports: | ||
- containerPort: 3306 | ||
name: fulcimen-mysql | ||
volumeMounts: | ||
- name: fulcimen-mysql-persistent-storage | ||
mountPath: /var/lib/mysql | ||
volumes: | ||
- name: fulcimen-mysql-persistent-storage | ||
persistentVolumeClaim: | ||
claimName: fulcimen-mysql-pv-claim |
11 changes: 11 additions & 0 deletions
11
.github/manifests/fulcimen-mysql-persistant-volume-claim.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: fulcimen-mysql-pv-claim | ||
spec: | ||
storageClassName: manual | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 100Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: fulcimen-mysql-pv | ||
labels: | ||
type: local | ||
spec: | ||
storageClassName: manual | ||
capacity: | ||
storage: 20Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
hostPath: | ||
path: "/mnt/data" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: fulcimen | ||
name: mysql | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- port: 3306 | ||
selector: | ||
app: fulcimen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: github-delete-workflow-runs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
days: | ||
description: 'Number of days.' | ||
required: true | ||
default: 7 | ||
|
||
jobs: | ||
del_runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete workflow runs | ||
uses: Mattraks/delete-workflow-runs@main | ||
with: | ||
# token: ${{ secrets.AUTH_PAT }} | ||
# repository: ${{ github.repository }} | ||
retain_days: ${{ github.event.inputs.days }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: package-nginx-image | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Package | ||
uses: craftech-io/package-action@v3.1.0 | ||
id: url-GPR | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
context: ./nginx | ||
dockerfile: ./nginx/Dockerfile.nginx | ||
image_name: nginx | ||
tags: | | ||
latest | ||
${{ github.sha }} | ||
- name: imageURL | ||
run: echo ${{ steps.url-GPR.outputs.imageURL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: testing-delete-all-svc-deploy-po | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
delete: | ||
runs-on: ubuntu-latest | ||
environment: fulcrum-testing | ||
steps: | ||
- name: Setup Kubectl | ||
uses: azure/setup-kubectl@v1 | ||
- name: Authenticate with kubernetes | ||
run: | | ||
mkdir -p ${HOME}/.kube/certs/cluster | ||
echo ${{ secrets.CA_CRT_BASE64 }} | base64 -d > ${HOME}/.kube/certs/cluster/k8s-ca.crt | ||
kubectl config set-cluster cluster --certificate-authority=${HOME}/.kube/certs/cluster/k8s-ca.crt --server=`echo ${{ secrets.SERVER_URL_BASE64 }} | base64 -d` | ||
kubectl config set-credentials default --token=`echo ${{ secrets.TOKEN_BASE64 }} | base64 -d` | ||
kubectl config set-context default --cluster=cluster --user=default --namespace=`echo ${{ secrets.NAMESPACE_BASE64 }} | base64 -d` | ||
kubectl config use-context default | ||
kubectl config view | ||
kubectl config current-context | ||
- name: Kubectl delete all | ||
run: | | ||
kubectl delete deployments --all | ||
kubectl delete services --all | ||
kubectl delete pods --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: testing-deploy-nginx-hub-image | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: fulcrum-testing | ||
steps: | ||
- name: Setup Kubectl | ||
uses: azure/setup-kubectl@v1 | ||
- name: Authenticate with kubernetes | ||
run: | | ||
mkdir -p ${HOME}/.kube/certs/cluster | ||
echo ${{ secrets.CA_CRT_BASE64 }} | base64 -d > ${HOME}/.kube/certs/cluster/k8s-ca.crt | ||
kubectl config set-cluster cluster --certificate-authority=${HOME}/.kube/certs/cluster/k8s-ca.crt --server=`echo ${{ secrets.SERVER_URL_BASE64 }} | base64 -d` | ||
kubectl config set-credentials default --token=`echo ${{ secrets.TOKEN_BASE64 }} | base64 -d` | ||
kubectl config set-context default --cluster=cluster --user=default --namespace=`echo ${{ secrets.NAMESPACE_BASE64 }} | base64 -d` | ||
kubectl config use-context default | ||
kubectl config view | ||
kubectl config current-context | ||
- name: Deploy with kubectl | ||
run: | | ||
kubectl apply -f - <<EOF | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: nginx | ||
name: nginx | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
annotations: | ||
imageregistry: "https://hub.docker.com/" | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx | ||
ports: | ||
- containerPort: 80 | ||
EOF | ||
kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: nginx | ||
name: web | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: testing-deploy-nginx-pkg-image | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: fulcrum-testing | ||
steps: | ||
- name: Setup Kubectl | ||
uses: azure/setup-kubectl@v1 | ||
- name: Authenticate with kubernetes | ||
run: | | ||
mkdir -p ${HOME}/.kube/certs/cluster | ||
echo ${{ secrets.CA_CRT_BASE64 }} | base64 -d > ${HOME}/.kube/certs/cluster/k8s-ca.crt | ||
kubectl config set-cluster cluster --certificate-authority=${HOME}/.kube/certs/cluster/k8s-ca.crt --server=`echo ${{ secrets.SERVER_URL_BASE64 }} | base64 -d` | ||
kubectl config set-credentials default --token=`echo ${{ secrets.TOKEN_BASE64 }} | base64 -d` | ||
kubectl config set-context default --cluster=cluster --user=default --namespace=`echo ${{ secrets.NAMESPACE_BASE64 }} | base64 -d` | ||
kubectl config use-context default | ||
kubectl config view | ||
kubectl config current-context | ||
- name: Deploy with kubectl | ||
run: | | ||
kubectl apply -f - <<EOF | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: nginx | ||
name: nginx | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
annotations: | ||
imageregistry: "https://docker.pkg.github.com" | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: docker.pkg.github.com/mlibrary/heliotropium/nginx:latest | ||
ports: | ||
- containerPort: 80 | ||
imagePullSecrets: | ||
- name: github-packages-read | ||
EOF | ||
kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: nginx | ||
name: web | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
app: nginx | ||
type: LoadBalancer | ||
EOF |
Oops, something went wrong.