generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
kubernetes/main/apps/database/dragonfly/app/helmrelease.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: &app dragonfly-operator | ||
spec: | ||
interval: 2h | ||
chart: | ||
spec: | ||
chart: app-template | ||
version: 3.2.1 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: bjw-s | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
strategy: rollback | ||
retries: 3 | ||
values: | ||
controllers: | ||
dragonfly-operator: | ||
strategy: RollingUpdate | ||
containers: | ||
app: | ||
image: | ||
repository: ghcr.io/dragonflydb/operator | ||
tag: v1.1.2@sha256:f0d76725950095ac65b36252e0042d339d1db9b181b1d068f4b6686ea93055e4 | ||
command: ["/manager"] | ||
args: | ||
- --health-probe-bind-address=:8081 | ||
- --metrics-bind-address=:8080 | ||
probes: | ||
liveness: | ||
enabled: true | ||
custom: true | ||
spec: | ||
httpGet: | ||
path: /healthz | ||
port: &port 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
readiness: | ||
enabled: true | ||
custom: true | ||
spec: | ||
httpGet: | ||
path: /readyz | ||
port: *port | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
resources: | ||
requests: | ||
cpu: 10m | ||
limits: | ||
memory: 128Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
defaultPodOptions: | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 65534 | ||
runAsGroup: 65534 | ||
seccompProfile: | ||
type: RuntimeDefault | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: kubernetes.io/hostname | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: *app | ||
service: | ||
app: | ||
controller: *app | ||
ports: | ||
http: | ||
port: *port | ||
metrics: | ||
port: 8080 | ||
serviceMonitor: | ||
app: | ||
serviceName: *app | ||
endpoints: | ||
- port: metrics | ||
scheme: http | ||
path: /metrics | ||
interval: 1m | ||
scrapeTimeout: 10s | ||
serviceAccount: | ||
create: true | ||
name: *app |
9 changes: 9 additions & 0 deletions
9
kubernetes/main/apps/database/dragonfly/app/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
# renovate: datasource=github-releases depName=dragonflydb/dragonfly-operator | ||
- https://raw.githubusercontent.com/dragonflydb/dragonfly-operator/v1.1.2/manifests/crd.yaml | ||
- ./helmrelease.yaml | ||
- ./rbac.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: dragonfly-operator | ||
rules: | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create", "patch"] | ||
- apiGroups: [""] | ||
resources: ["pods", "services"] | ||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
- apiGroups: ["apps"] | ||
resources: ["statefulsets"] | ||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
- apiGroups: ["dragonflydb.io"] | ||
resources: ["dragonflies"] | ||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
- apiGroups: ["dragonflydb.io"] | ||
resources: ["dragonflies/finalizers"] | ||
verbs: ["update"] | ||
- apiGroups: ["dragonflydb.io"] | ||
resources: ["dragonflies/status"] | ||
verbs: ["get", "patch", "update"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: dragonfly-operator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: dragonfly-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: dragonfly-operator | ||
namespace: database |
32 changes: 32 additions & 0 deletions
32
kubernetes/main/apps/database/dragonfly/cluster/cluster.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.18b.haus/dragonflydb.io/dragonfly_v1alpha1.json | ||
apiVersion: dragonflydb.io/v1alpha1 | ||
kind: Dragonfly | ||
metadata: | ||
name: dragonfly | ||
spec: | ||
image: ghcr.io/dragonflydb/dragonfly:v1.18.1 | ||
replicas: 3 | ||
env: | ||
- name: MAX_MEMORY | ||
valueFrom: | ||
resourceFieldRef: | ||
resource: limits.memory | ||
divisor: 1Mi | ||
args: | ||
- --maxmemory=$(MAX_MEMORY)Mi | ||
- --proactor_threads=2 | ||
- --cluster_mode=emulated | ||
- --lock_on_hashtags | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: kubernetes.io/hostname | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
app.kubernetes.io/part-of: dragonfly | ||
resources: | ||
requests: | ||
cpu: 100m | ||
limits: | ||
memory: 512Mi |
7 changes: 7 additions & 0 deletions
7
kubernetes/main/apps/database/dragonfly/cluster/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./cluster.yaml | ||
- ./podmonitor.yaml |
14 changes: 14 additions & 0 deletions
14
kubernetes/main/apps/database/dragonfly/cluster/podmonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.18b.haus/monitoring.coreos.com/podmonitor_v1.json | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PodMonitor | ||
metadata: | ||
name: dragonfly | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: dragonfly | ||
podTargetLabels: | ||
- app | ||
podMetricsEndpoints: | ||
- port: admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.18b.haus/kustomize.toolkit.fluxcd.io/kustomization_v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app dragonfly | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: database | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: ./kubernetes/main/apps/database/dragonfly/app | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-kubernetes | ||
wait: true | ||
interval: 2h | ||
retryInterval: 1m | ||
timeout: 5m | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.18b.haus/kustomize.toolkit.fluxcd.io/kustomization_v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app dragonfly-cluster | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: database | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
dependsOn: | ||
- name: dragonfly | ||
path: ./kubernetes/main/apps/database/dragonfly/cluster | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-kubernetes | ||
wait: true | ||
interval: 2h | ||
retryInterval: 1m | ||
timeout: 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters