Skip to content

Commit

Permalink
chore(k8s/amour/backup/legacy): add smb server
Browse files Browse the repository at this point in the history
  • Loading branch information
uhthomas committed Sep 23, 2024
1 parent 7c909e7 commit 3b50e54
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions k8s/amour/backup/legacy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@com_github_tnarg_rules_cue//cue:cue.bzl", "cue_library")
cue_library(
name = "cue_legacy_library",
srcs = [
"deployment_list.cue",
"ingress_list.cue",
"list.cue",
"persistent_volume_claim_list.cue",
Expand Down
66 changes: 66 additions & 0 deletions k8s/amour/backup/legacy/deployment_list.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package legacy

import (
appsv1 "k8s.io/api/apps/v1"
"k8s.io/api/core/v1"
)

#DeploymentList: appsv1.#DeploymentList & {
apiVersion: "apps/v1"
kind: "DeploymentList"
items: [...{
apiVersion: "apps/v1"
kind: "Deployment"
}]
}

#DeploymentList: items: [{
metadata: name: "\(#Name)-smb"
spec: {
// replicas: 0
selector: matchLabels: "app.kubernetes.io/name": "\(#Name)-smb"
template: {
metadata: labels: "app.kubernetes.io/name": "\(#Name)-smb"
spec: {
volumes: [{
name: "data"
persistentVolumeClaim: {
claimName: #Name
readOnly: true
}
}]
containers: [{
name: "samba"
image: "ghcr.io/uhthomas/automata/samba:latest"
ports: [{
name: "smb"
containerPort: 445
}]
resources: limits: {
(v1.#ResourceCPU): "1"
(v1.#ResourceMemory): "1Gi"
}
volumeMounts: [{
name: "data"
mountPath: "/data"
}]
imagePullPolicy: v1.#PullIfNotPresent
},
// securityContext: {
// capabilities: drop: ["ALL"]
// readOnlyRootFilesystem: true
// allowPrivilegeEscalation: false
// }
]
// securityContext: {
// runAsUser: 1000
// runAsGroup: 3000
// runAsNonRoot: true
// fsGroup: 2000
// fsGroupChangePolicy: v1.#FSGroupChangeOnRootMismatch
// seccompProfile: type: v1.#SeccompProfileTypeRuntimeDefault
// }
}
}
}
}]
1 change: 1 addition & 0 deletions k8s/amour/backup/legacy/list.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
#List: items: list.Concat(_items)

_items: [
#DeploymentList.items,
#IngressList.items,
#PersistentVolumeClaimList.items,
#ServiceList.items,
Expand Down
11 changes: 11 additions & 0 deletions k8s/amour/backup/legacy/service_list.cue
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@ import "k8s.io/api/core/v1"
selector: "app.kubernetes.io/name": "\(#Name)-syncthing"
type: v1.#ServiceTypeLoadBalancer
}
}, {
metadata: name: "\(#Name)-smb"
spec: {
ports: [{
name: "smb"
port: 445
targetPort: "smb"
}]
selector: "app.kubernetes.io/name": "\(#Name)-smb"
type: v1.#ServiceTypeLoadBalancer
}
}]

0 comments on commit 3b50e54

Please sign in to comment.