Skip to content

Instantly share code, notes, and snippets.

@wuhanstudio
Last active November 9, 2022 16:38
Show Gist options
  • Save wuhanstudio/2564cac1e3658b5729b002652bb561da to your computer and use it in GitHub Desktop.
Save wuhanstudio/2564cac1e3658b5729b002652bb561da to your computer and use it in GitHub Desktop.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
dhclient enp2s0f0
exit 0
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-ingress
spec:
rules:
- host: hello.wuhanstudio.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello-world
port:
name: web
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
labels:
app: hello
spec:
replicas: 1
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- image: tutum/hello-world:latest
name: hello-world
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: hello-world
spec:
ports:
- name: web
port: 80
targetPort: 80
selector:
app: hello
type: ClusterIP
0. Proxmox (FQDN)
$ chmod +x /etc/rc.local
$ systemctl daemon-reload
$ systemctl start rc-local
$ systemctl status rc-local
1. k3sup join (hostname)
2. MetalLB
$ kubctl apply -f metallb-install.yml
$ kubectl apply -f metallb-config.yml
3. Application
$ kubectl apply -f hello-world.yml
4. Certificate
kubectl describe secret hello-tls
4. Helm (traefik)
$ helm install traefik ./
$ kubectl apply -f hello-ingress.yml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: first-pool
namespace: metallb-system
spec:
addresses:
- 192.168.1.200-192.168.1.254
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: example
namespace: metallb-system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment