mirror of
https://github.com/jcwimer/startup-infrastructure
synced 2026-05-20 19:57:43 +00:00
Switched from docker swarm to Kubernetes with rke
This commit is contained in:
2
roles/longhorn/defaults/main.yaml
Normal file
2
roles/longhorn/defaults/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
longhorn_version: v0.8.1
|
||||
27
roles/longhorn/tasks/main.yaml
Normal file
27
roles/longhorn/tasks/main.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Create Longhorn config Directory
|
||||
file:
|
||||
path: "{{ startup_infrastructure_directory }}/longhorn"
|
||||
state: directory
|
||||
|
||||
- name: Get Longhorn Install
|
||||
get_url:
|
||||
url: https://raw.githubusercontent.com/longhorn/longhorn/{{ longhorn_version }}/deploy/longhorn.yaml
|
||||
dest: "{{ startup_infrastructure_directory }}/longhorn/longhorn.yaml"
|
||||
|
||||
- name: Put other Longhorn yaml in place
|
||||
template:
|
||||
src: ../templates/{{ item }}.j2
|
||||
dest: "{{ startup_infrastructure_directory }}/longhorn/{{ item }}"
|
||||
with_items:
|
||||
- longhorn-ingress.yaml
|
||||
|
||||
- name: Install Longhorn
|
||||
command: kubectl apply -f {{ startup_infrastructure_directory }}/longhorn/longhorn.yaml
|
||||
|
||||
- name: Install Longhorn Extras
|
||||
command: kubectl apply -f {{ startup_infrastructure_directory }}/longhorn/
|
||||
|
||||
- name: Set default storageclass
|
||||
command: >
|
||||
kubectl patch storageclass longhorn -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
|
||||
22
roles/longhorn/templates/longhorn-ingress.yaml.j2
Normal file
22
roles/longhorn/templates/longhorn-ingress.yaml.j2
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: longhorn-ingress
|
||||
namespace: longhorn-system
|
||||
annotations:
|
||||
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
spec:
|
||||
rules:
|
||||
- host: longhorn.{{ root_domain }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
backend:
|
||||
serviceName: longhorn-frontend
|
||||
servicePort: 80
|
||||
#tls:
|
||||
# - hosts:
|
||||
# - longhorn.{{ root_domain }}
|
||||
# secretName: longhorn-ssl
|
||||
Reference in New Issue
Block a user