port kms to kubernetes

This commit is contained in:
Pim Kunis 2024-03-27 23:19:47 +01:00
parent 6fd25419be
commit 58f8ae10f5
3 changed files with 35 additions and 35 deletions

View file

@ -1,35 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: loadbalancer-test
# annotations:
# metallb.universe.tf/loadBalancerIPs: 192.168.1.100
spec:
ports:
- port: 80
targetPort: 8000
selector:
app: loadbalancer-test
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: loadbalancer-test
labels:
app: loadbalancer-test
spec:
replicas: 3
selector:
matchLabels:
app: loadbalancer-test
template:
metadata:
labels:
app: loadbalancer-test
spec:
containers:
- name: loadbalancer-test
image: mpepping/cyberchef
ports:
- containerPort: 8000

View file

@ -9,6 +9,7 @@
kubenix.modules.helm
./freshrss.nix
./cyberchef.nix
./kms.nix
];
kubernetes.kubeconfig = "~/.kube/config";
kubenix.project = "home";

34
nix/flake/kubenix/kms.nix Normal file
View file

@ -0,0 +1,34 @@
{
kubernetes.resources = {
deployments.kms = {
metadata.labels.app = "kms";
spec = {
selector.matchLabels.app = "kms";
template = {
metadata.labels.app = "kms";
spec.containers.kms = {
image = "teddysun/kms";
ports = [{
containerPort = 1688;
protocol = "TCP";
}];
};
};
};
};
services.kms.spec = {
type = "LoadBalancer";
selector.app = "kms";
ports = [{
port = 1688;
targetPort = 1688;
}];
};
};
}