feat: setup skaffold
This commit is contained in:
parent
eef59c479c
commit
d56873fc5d
7 changed files with 219 additions and 2 deletions
16
flake.nix
16
flake.nix
|
@ -40,8 +40,20 @@
|
|||
};
|
||||
};
|
||||
|
||||
devShells.default =
|
||||
pkgs.mkShell {buildInputs = with pkgs; [go gopls goreleaser docker];};
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
# Go tools
|
||||
go
|
||||
gopls
|
||||
goreleaser
|
||||
|
||||
# Required for goreleaser
|
||||
docker
|
||||
|
||||
# Testing
|
||||
skaffold
|
||||
];
|
||||
};
|
||||
};
|
||||
flake = {
|
||||
};
|
||||
|
|
59
k8s/bridge.yaml
Normal file
59
k8s/bridge.yaml
Normal file
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: bridge-config
|
||||
data:
|
||||
config.scfg: |
|
||||
http-address 0.0.0.0:8080
|
||||
log-level info
|
||||
log-format text
|
||||
|
||||
ntfy {
|
||||
server http://ntfy:80
|
||||
}
|
||||
|
||||
handler "/flux" {
|
||||
type "flux"
|
||||
topic "flux"
|
||||
}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: bridge
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: bridge
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: bridge
|
||||
spec:
|
||||
containers:
|
||||
- name: bridge
|
||||
image: forge.babariviere.com/babariviere/ntfy-bridge:latest
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
- mountPath: /etc/ntfy-bridge/config.scfg
|
||||
subPath: config.scfg
|
||||
name: config-volume
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: bridge-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: bridge
|
||||
spec:
|
||||
ports:
|
||||
- port: 8080
|
||||
name: http
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: bridge
|
42
k8s/flux.yaml
Normal file
42
k8s/flux.yaml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
apiVersion: notification.toolkit.fluxcd.io/v1beta2
|
||||
kind: Provider
|
||||
metadata:
|
||||
name: ntfy-bridge-dev
|
||||
spec:
|
||||
type: generic
|
||||
secretRef:
|
||||
name: ntfy-bridge-dev-address
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: ntfy-bridge-dev-address
|
||||
stringData:
|
||||
address: "http://bridge.ntfy-bridge-dev.svc.cluster.local:8080/flux"
|
||||
---
|
||||
apiVersion: notification.toolkit.fluxcd.io/v1beta2
|
||||
kind: Alert
|
||||
metadata:
|
||||
name: ntfy-bridge-dev
|
||||
spec:
|
||||
summary: "k3s cluster"
|
||||
providerRef:
|
||||
name: ntfy-bridge-dev
|
||||
eventSeverity: info
|
||||
eventSources:
|
||||
- kind: GitRepository
|
||||
name: '*'
|
||||
namespace: flux-system
|
||||
- kind: Kustomization
|
||||
name: '*'
|
||||
namespace: flux-system
|
||||
- kind: HelmRepository
|
||||
name: '*'
|
||||
namespace: flux-system
|
||||
- kind: HelmChart
|
||||
name: '*'
|
||||
namespace: flux-system
|
||||
- kind: HelmRelease
|
||||
name: '*'
|
||||
namespace: flux-system
|
8
k8s/kustomization.yaml
Normal file
8
k8s/kustomization.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: ntfy-bridge-dev
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- bridge.yaml
|
||||
- flux.yaml
|
||||
- ntfy.yaml
|
4
k8s/namespace.yaml
Normal file
4
k8s/namespace.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: ntfy-bridge-dev
|
77
k8s/ntfy.yaml
Normal file
77
k8s/ntfy.yaml
Normal file
|
@ -0,0 +1,77 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ntfy-config
|
||||
data:
|
||||
server.yml: |
|
||||
cache-file: "/var/cache/ntfy/cache.db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ntfy
|
||||
labels:
|
||||
app: ntfy
|
||||
spec:
|
||||
revisionHistoryLimit: 1
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ntfy
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ntfy
|
||||
spec:
|
||||
containers:
|
||||
- name: ntfy
|
||||
image: binwiederhier/ntfy:latest
|
||||
imagePullPolicy: Always
|
||||
args: ["serve"]
|
||||
env:
|
||||
- name: TZ # set timezone
|
||||
value: Etc/UTC
|
||||
- name: NTFY_DEBUG # enable/disable debug
|
||||
value: "true"
|
||||
- name: NTFY_LOG_LEVEL # adjust log level
|
||||
value: INFO
|
||||
ports:
|
||||
- name: ntfy-http
|
||||
containerPort: 80
|
||||
resources:
|
||||
limits:
|
||||
memory: 300Mi
|
||||
requests:
|
||||
cpu: 150m
|
||||
memory: 150Mi
|
||||
volumeMounts:
|
||||
- mountPath: /etc/ntfy/server.yml
|
||||
subPath: server.yml
|
||||
name: config-volume
|
||||
- mountPath: /var/cache/ntfy
|
||||
name: cache-volume #cache volume mounted to persistent volume
|
||||
- mountPath: /var/lib/ntfy
|
||||
name: lib-volume
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: ntfy-config
|
||||
- name: cache-volume
|
||||
emptyDir: {}
|
||||
- name: lib-volume
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ntfy-http
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: ntfy
|
||||
ports:
|
||||
- name: ntfy-http-out
|
||||
protocol: TCP
|
||||
port: 80
|
||||
targetPort: ntfy-http
|
15
skaffold.yaml
Normal file
15
skaffold.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
apiVersion: skaffold/v4beta6
|
||||
kind: Config
|
||||
metadata:
|
||||
name: ntfy-bridge
|
||||
build:
|
||||
artifacts:
|
||||
- image: forge.babariviere.com/babariviere/ntfy-bridge
|
||||
buildpacks:
|
||||
manifests:
|
||||
kustomize:
|
||||
paths:
|
||||
- k8s
|
||||
deploy:
|
||||
kubectl:
|
||||
defaultNamespace: ntfy-bridge-dev
|
Loading…
Reference in a new issue