k8s: deployment & nodePort service

- nodePort service is merely a proof-of-concept; this won't be the final
  form the service takes. The port needs to be 53, not 32767.
- the deployment doesn't include the nginx webserver, merely the DNS
  server. Also, I had trouble connecting both UDP & TCP to port 53,
  so I chose UDP.
This commit is contained in:
Brian Cunnie
2020-07-05 08:27:53 -07:00
parent c89ff9cdd8
commit 50e17b3d7f
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sslip.io
spec:
template:
metadata:
name: sslip.io-pod
labels:
app: sslip.io
spec:
containers:
- name: sslip-container
image: cunnie/sslip.io
ports:
- containerPort: 53
protocol: TCP
- containerPort: 53
protocol: UDP
selector:
matchLabels:
app: sslip.io

View File

@@ -0,0 +1,19 @@
# DON'T USE THIS!
#
# NodePorts aren't the right solution; this is for personal testing
# kubectl create -f nodeport-service.yml
# dig -p 32767 127.0.0.1.sslip.io @172.17.0.2
apiVersion: v1
kind: Service
metadata:
name: sslip-io-nodeport-service # must be DNS-compliant
spec:
type: NodePort
ports:
- protocol: UDP
name: dns-udp
port: 53
# targetPort: 53
nodePort: 32767
selector:
app: sslip.io