feat: add Ingress and Service configurations for nginx deployment, and implement MetalLB and Traeik installation scripts
refactor: remove obsolete Traefik installation script feat: add environment checks and configurations for Vagrant setup, including dnsmasq MetalLB and ingress
This commit is contained in:
parent
bd222ce39e
commit
b2b028a16c
19 changed files with 375 additions and 147 deletions
|
|
@ -13,6 +13,14 @@ spec:
|
|||
labels:
|
||||
app: nginx-storage
|
||||
spec:
|
||||
|
||||
initContainers:
|
||||
- name: init-nginx-content
|
||||
image: busybox
|
||||
command: ["sh", "-c", "echo '<html><body><h1>Welcome to nginx!</h1><h2>using MVK</h2><p><a href=\"https://mvk.headshed.dev/\">https://mvk.headshed.dev/</a></p></body></html>' > /usr/share/nginx/html/index.html"]
|
||||
volumeMounts:
|
||||
- name: nginx-data
|
||||
mountPath: /usr/share/nginx/html
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:stable
|
||||
|
|
|
|||
27
vagrant/dev/ubuntu/k8s/nginx-test/ingress.yaml
Normal file
27
vagrant/dev/ubuntu/k8s/nginx-test/ingress.yaml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: traefik-ingress
|
||||
namespace: default
|
||||
# This annotation is good practice to ensure it uses the right entrypoint
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
spec:
|
||||
# This block is the key. It tells Ingress controllers like Traefik
|
||||
# to use the specified secret for TLS termination for the listed hosts.
|
||||
tls:
|
||||
- hosts:
|
||||
- "*.headshed.it" # Or a specific subdomain like test.headshed.it
|
||||
secretName: wildcard-headshed-it-tls # <-- The name of the secret you created
|
||||
|
||||
rules:
|
||||
- host: nginx.headshed.it # The actual domain you will use to access the service
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: nginx-storage # The name of the k8s service for your app
|
||||
port:
|
||||
number: 80 # The port your service is listening on
|
||||
12
vagrant/dev/ubuntu/k8s/nginx-test/service.yaml
Normal file
12
vagrant/dev/ubuntu/k8s/nginx-test/service.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-storage
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: nginx-storage
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
8
vagrant/dev/ubuntu/k8s/traefik-tlsstore.yaml
Normal file
8
vagrant/dev/ubuntu/k8s/traefik-tlsstore.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: traefik.io/v1alpha1
|
||||
kind: TLSStore
|
||||
metadata:
|
||||
name: default
|
||||
namespace: traefik
|
||||
spec:
|
||||
defaultCertificate:
|
||||
secretName: wildcard-headshed-it-tls
|
||||
Loading…
Add table
Add a link
Reference in a new issue