mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-10-05 15:46:50 +08:00
sslip.io is hosted on GCP, not GKE
I don't need this k8s configuration for sslip.io (DNS, NTP) because I'm no longer hosting on GKE now that it has an ephemeral IP instead of a reserved IP because otherwise I'd have to pay $360 extra per year for a premium-tier load balancer.
This commit is contained in:
@@ -98,10 +98,8 @@ ssh nono.io curl -L -o /www/sslip.io/document_root/index.html https://raw.github
|
||||
ssh ns-aws.sslip.io curl -L -o /var/nginx/sslip.io/index.html https://raw.githubusercontent.com/cunnie/sslip.io/main/k8s/document_root_sslip.io/index.html
|
||||
ssh ns-azure.sslip.io curl -L -o /var/nginx/sslip.io/index.html https://raw.githubusercontent.com/cunnie/sslip.io/main/k8s/document_root_sslip.io/index.html
|
||||
```
|
||||
Update GCP/GKE with the new executable:
|
||||
Check that the versions of the sslip.io DNS servers are the same:
|
||||
```bash
|
||||
kubectl rollout restart deployment/sslip.io
|
||||
kubectl rollout restart deployment/sslip.io-nginx
|
||||
for IAAS in aws azure gce; do printf "\n$IAAS:\n"; dig @ns-$IAAS.sslip.io version.status.sslip.io txt +short; done
|
||||
fly -t nono trigger-job -j sslip.io/dns-servers
|
||||
```
|
||||
|
225
k8s/sslip.io.yml
225
k8s/sslip.io.yml
@@ -1,225 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: sslip.io
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sslip.io-dns
|
||||
template:
|
||||
metadata:
|
||||
name: sslip.io-pod
|
||||
labels:
|
||||
app: sslip.io-dns
|
||||
spec:
|
||||
terminationGracePeriodSeconds: 30
|
||||
containers:
|
||||
- name: sslip-container
|
||||
image: cunnie/sslip.io-dns-server:latest
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -quiet
|
||||
ports:
|
||||
- containerPort: 53
|
||||
protocol: UDP
|
||||
resources:
|
||||
requests:
|
||||
memory: 16Mi
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- dig
|
||||
- "@localhost"
|
||||
- 127.0.0.1.sslip.io
|
||||
- +short
|
||||
periodSeconds: 300
|
||||
# NTP
|
||||
# Thank you https://goglides.io/manage-ntp-using-kubernetes/90/
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: sslip.io-ntp
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sslip.io-ntp
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: sslip.io-ntp
|
||||
spec:
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- name: sslip-io-ntp
|
||||
image: cunnie/sslip.io-ntp
|
||||
resources:
|
||||
limits:
|
||||
memory: 20Mi
|
||||
cpu: 20m
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
securityContext:
|
||||
privileged: true
|
||||
env:
|
||||
- name: NTP_CONF_FILE
|
||||
value: /app/ntpd.conf
|
||||
volumeMounts:
|
||||
- name: ntp-config
|
||||
mountPath: /app/
|
||||
volumes:
|
||||
- name: ntp-config
|
||||
configMap:
|
||||
name: ntp-config
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: sslip.io-nginx
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sslip.io-nginx
|
||||
template:
|
||||
metadata:
|
||||
name: sslip.io-nginx
|
||||
labels:
|
||||
app: sslip.io-nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: sslip-nginx-container
|
||||
image: cunnie/sslip.io-nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
memory: 32Mi
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: sslip-io-dns-cluster # must be DNS-compliant
|
||||
spec:
|
||||
ports:
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
# dig @worker-3.nono.io 127.0.0.1.sslip.io +short -p 32767
|
||||
selector:
|
||||
app: sslip.io-dns
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: sslip-io-ntp-cluster # must be DNS-compliant
|
||||
spec:
|
||||
ports:
|
||||
- protocol: UDP
|
||||
port: 123
|
||||
# ntpdate ( LoadBalancer IP | Cluster IP | Pod IP )
|
||||
# sntp ( LoadBalancer IP | Cluster IP | Pod IP )
|
||||
selector:
|
||||
app: sslip.io-ntp
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: sslip-io-nginx-cluster
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
selector:
|
||||
app: sslip.io-nginx
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: sslip-io-dns
|
||||
namespace: default
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
externalTrafficPolicy: Local
|
||||
loadBalancerIP: 104.155.144.4
|
||||
ports:
|
||||
- name: dns
|
||||
port: 53
|
||||
protocol: UDP
|
||||
targetPort: 53
|
||||
selector:
|
||||
app: sslip.io-dns
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: sslip-io-ntp
|
||||
namespace: default
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
externalTrafficPolicy: Local
|
||||
loadBalancerIP: 104.155.144.4
|
||||
ports:
|
||||
- name: ntp
|
||||
port: 123
|
||||
protocol: UDP
|
||||
targetPort: 123
|
||||
selector:
|
||||
app: sslip.io-ntp
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: sslip.io-nginx
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
cert-manager.io/issuer: "letsencrypt-prod"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- 104-155-144-4.sslip.io
|
||||
- 104.155.144.4.sslip.io
|
||||
secretName: 104-155-144-4.sslip.io
|
||||
rules:
|
||||
- host: 104-155-144-4.sslip.io
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: sslip-io-nginx-cluster
|
||||
port:
|
||||
number: 80
|
||||
- host: 104.155.144.4.sslip.io
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: sslip-io-nginx-cluster
|
||||
port:
|
||||
number: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ntp-config
|
||||
data:
|
||||
ntpd.conf: |
|
||||
# This is a config file for OpenNTPD, not NTP, nor chrony, nor NTPsec
|
||||
listen on *
|
||||
# Our upstream timekeepers; thank you Google
|
||||
server time1.google.com
|
||||
server time2.google.com
|
||||
server time3.google.com
|
||||
server time4.google.com
|
Reference in New Issue
Block a user