diff --git a/caddy/depl.yaml b/caddy/depl.yaml index a369bfe..07cabde 100644 --- a/caddy/depl.yaml +++ b/caddy/depl.yaml @@ -15,7 +15,7 @@ spec: labels: app: caddy spec: - hostNetwork: true + #hostNetwork: true restartPolicy: Always containers: - name: caddy @@ -36,6 +36,11 @@ spec: timeoutSeconds: 1 periodSeconds: 10 failureThreshold: 3 + ports: + - containerPort: 5001 + - containerPort: 5002 + - containerPort: 5030 + - containerPort: 5567 volumeMounts: - name: caddy-file mountPath: /etc/caddy diff --git a/caddy/serv.yaml b/caddy/serv.yaml index c0d9582..d332299 100644 --- a/caddy/serv.yaml +++ b/caddy/serv.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: v1 kind: Service metadata: name: caddy @@ -6,13 +6,14 @@ spec: selector: app: caddy ports: - - protocol: TCP - port: 5001 - targetPort: 5001 - - protocol: TCP - port: 5002 - targetPort: 5002 - - protocol: TCP - port: 5033 - targetPort: 5033 + - port: 5001 + name: http1 + - port: 5002 + name: http2 + - port: 5030 + name: http3 + - port: 5033 + name: http4 + - port: 5567 + name: http5 type: LoadBalancer diff --git a/debug/pod.yaml b/debug/pod.yaml new file mode 100644 index 0000000..5fea02c --- /dev/null +++ b/debug/pod.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: debug +spec: + containers: + - name: debug + image: ubuntu + resources: + requests: + cpu: 1000m + memory: 512Mi + limits: + cpu: 4000m + memory: 4Gi diff --git a/porty/serv.yaml b/porty/serv.yaml index c0d4015..aaeed28 100644 --- a/porty/serv.yaml +++ b/porty/serv.yaml @@ -1,12 +1,12 @@ apiVersion: v1 kind: Service metadata: - name: porty + name: porty-svc spec: selector: app: porty ports: - protocol: TCP - port: 3333 # this is the port the users will access, so probably should be 80 + port: 3000 # this is the port the users will access, so probably should be 80 targetPort: 3000 type: LoadBalancer diff --git a/url/data/urls.sqlite b/url/data/urls.sqlite new file mode 100644 index 0000000..6170091 Binary files /dev/null and b/url/data/urls.sqlite differ diff --git a/url/depl.yaml b/url/depl.yaml new file mode 100644 index 0000000..271daef --- /dev/null +++ b/url/depl.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: url + labels: + app: url +spec: + replicas: 1 + selector: + matchLabels: + app: url + template: + metadata: + name: url + labels: + app: url + spec: + restartPolicy: Always + containers: + - name: url + image: sintan1729/chhoto-url + imagePullPolicy: Always + resources: + requests: + cpu: 500m + memory: 4Mi + limits: + cpu: 1000m + memory: 32Mi + livenessProbe: + httpGet: + port: 4567 + path: / + initialDelaySeconds: 5 + timeoutSeconds: 1 + periodSeconds: 10 + failureThreshold: 3 + ports: + - containerPort: 4567 + env: + - name: password + value: test123 + - name: db_url + value: /data/urls.sqlite + volumeMounts: + - name: url-data + mountPath: /data + volumes: + - name: url-data + hostPath: + path: /mnt/Projects/k3s-testing/url/data + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0% + maxSurge: 10% diff --git a/url/serv.yaml b/url/serv.yaml new file mode 100644 index 0000000..21c8624 --- /dev/null +++ b/url/serv.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: url +spec: + selector: + app: url + ports: + - port: 4567 + targetPort: 4567 + type: LoadBalancer