Skip to content

Commit

Permalink
added svc
Browse files Browse the repository at this point in the history
  • Loading branch information
s-archer committed Dec 19, 2024
1 parent d57f8ab commit 9331a60
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 49 deletions.
72 changes: 36 additions & 36 deletions terraform/k8s-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-reflector
namespace: s-archer
annotations:
ves.io/workload-flavor : arch-custom
spec:
selector:
matchLabels:
app: nginx-reflector
template:
metadata:
labels:
app: nginx-reflector
spec:
containers:
- image: ghcr.io/s-archer/nginx-reflector:main
imagePullPolicy: Always
name: nginx-reflector
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- mountPath: /var/run
name: nginx-run
- mountPath: /var/cache/nginx
name: nginx-cache
volumes:
- emptyDir:
sizeLimit: 10Mi
name: nginx-run
- emptyDir:
sizeLimit: 100Mi
name: nginx-cache
# ---
# apiVersion: apps/v1
# kind: Deployment
# metadata:
# name: nginx-reflector
# namespace: s-archer
# annotations:
# ves.io/workload-flavor : arch-custom
# spec:
# selector:
# matchLabels:
# app: nginx-reflector
# template:
# metadata:
# labels:
# app: nginx-reflector
# spec:
# containers:
# - image: ghcr.io/s-archer/nginx-reflector:main
# imagePullPolicy: Always
# name: nginx-reflector
# ports:
# - containerPort: 8080
# protocol: TCP
# volumeMounts:
# - mountPath: /var/run
# name: nginx-run
# - mountPath: /var/cache/nginx
# name: nginx-cache
# volumes:
# - emptyDir:
# sizeLimit: 10Mi
# name: nginx-run
# - emptyDir:
# sizeLimit: 100Mi
# name: nginx-cache
26 changes: 13 additions & 13 deletions terraform/k8s-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
apiVersion: v1
kind: Service
metadata:
name: nginx-reflector
namespace: s-archer
spec:
type: ClusterIP
selector:
app: nginx-reflector
ports:
- name: http
port: 8080
# ---
# apiVersion: v1
# kind: Service
# metadata:
# name: nginx-reflector
# namespace: s-archer
# spec:
# type: ClusterIP
# selector:
# app: nginx-reflector
# ports:
# - name: http
# port: 8080
19 changes: 19 additions & 0 deletions terraform/vk8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,23 @@ resource "kubernetes_deployment" "nginx-reflector" {
}
}
}
}

resource "kubernetes_service" "nginx-reflector" {
metadata {
name = "nginx-reflector"
namespace = var.xc_namespace
}
spec {
selector = {
app = var.xc_deployment_name
}
session_affinity = "ClientIP"
port {
port = 80
target_port = 8080
}

type = "ClusterIP"
}
}

0 comments on commit 9331a60

Please sign in to comment.