Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vault): switch storage #4402

Merged
merged 1 commit into from
Jan 28, 2025
Merged

fix(vault): switch storage #4402

merged 1 commit into from
Jan 28, 2025

Conversation

jazzlyn
Copy link
Collaborator

@jazzlyn jazzlyn commented Jan 28, 2025

No description provided.

@tyriis-automation
Copy link
Contributor

--- kubernetes/talos-flux/apps/secops/vault/app Kustomization: flux-system/vault HelmRelease: secops/vault

+++ kubernetes/talos-flux/apps/secops/vault/app Kustomization: flux-system/vault HelmRelease: secops/vault

@@ -50,43 +50,46 @@

         storageClass: ceph-block
       extraEnvironmentVars:
         TZ: Europe/Vienna
       extraLabels:
         reloader.stakater.com/auto: 'true'
       ha:
-        config: |
-          # api_addr = "http://127.0.0.1:8200"
-          # cluster_addr = "https://127.0.0.1:8201"
-          disable_mlock = true
-          ui = true
-          # seal "gcpckms" {
-          #   disabled    = "false"
-          #   project     = "techtales"
-          #   region      = "europe-west3"
-          #   key_ring    = "home-infra"
-          #   crypto_key  = "vault-unseal"
-          # }
-          listener "tcp" {
-            tls_disable = 1
-            address = "[::]:8200"
-            cluster_address = "[::]:8201"
-            telemetry {
-              unauthenticated_metrics_access = "true"
+        enabled: true
+        raft:
+          config: |
+            # api_addr = "http://127.0.0.1:8200"
+            # cluster_addr = "https://127.0.0.1:8201"
+            disable_mlock = true
+            ui = true
+            # seal "gcpckms" {
+            #   disabled    = "false"
+            #   project     = "techtales"
+            #   region      = "europe-west3"
+            #   key_ring    = "home-infra"
+            #   crypto_key  = "vault-unseal"
+            # }
+            listener "tcp" {
+              tls_disable = 1
+              address = "[::]:8200"
+              cluster_address = "[::]:8201"
+              telemetry {
+                unauthenticated_metrics_access = "true"
+              }
             }
-          }
-          storage "file" {
-            path = "/vault/data"
-          }
-          # storage "raft" {
-          #   path = "/vault/data"
-          #   # retry_join {
-          #   #   leader_api_addr = "http://vault-0.vault-internal:8200"
-          #   # }
-          # }
-          service_registration "kubernetes" {}
-        enabled: true
+            # storage "file" {
+            #   path = "/vault/data"
+            # }
+            storage "raft" {
+              path = "/vault/data"
+              # retry_join {
+              #   leader_api_addr = "http://vault-0.vault-internal:8200"
+              # }
+            }
+            service_registration "kubernetes" {}
+          enabled: true
+          setNodeId: true
         replicas: 1
       ingress:
         annotations:
           cert-manager.io/cluster-issuer: letsencrypt-staging
           kubernetes.io/tls-acme: 'true'
           nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'

@tyriis-automation
Copy link
Contributor

--- HelmRelease: secops/vault ConfigMap: secops/vault-config

+++ HelmRelease: secops/vault ConfigMap: secops/vault-config

@@ -26,19 +26,19 @@

       address = "[::]:8200"
       cluster_address = "[::]:8201"
       telemetry {
         unauthenticated_metrics_access = "true"
       }
     }
-    storage "file" {
+    # storage "file" {
+    #   path = "/vault/data"
+    # }
+    storage "raft" {
       path = "/vault/data"
+      # retry_join {
+      #   leader_api_addr = "http://vault-0.vault-internal:8200"
+      # }
     }
-    # storage "raft" {
-    #   path = "/vault/data"
-    #   # retry_join {
-    #   #   leader_api_addr = "http://vault-0.vault-internal:8200"
-    #   # }
-    # }
     service_registration "kubernetes" {}
 
     disable_mlock = true
 
--- HelmRelease: secops/vault StatefulSet: secops/vault

+++ HelmRelease: secops/vault StatefulSet: secops/vault

@@ -102,23 +102,29 @@

         - name: HOSTNAME
           valueFrom:
             fieldRef:
               fieldPath: metadata.name
         - name: VAULT_CLUSTER_ADDR
           value: https://$(HOSTNAME).vault-internal:8201
+        - name: VAULT_RAFT_NODE_ID
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.name
         - name: HOME
           value: /home/vault
         - name: VAULT_LOG_LEVEL
           value: info
         - name: VAULT_LOG_FORMAT
           value: json
         - name: TZ
           value: Europe/Vienna
         volumeMounts:
         - name: audit
           mountPath: /vault/audit
+        - name: data
+          mountPath: /vault/data
         - name: config
           mountPath: /vault/config
         - name: home
           mountPath: /home/vault
         ports:
         - containerPort: 8200
@@ -144,12 +150,21 @@

               command:
               - /bin/sh
               - -c
               - sleep 5 && kill -SIGTERM $(pidof vault)
   volumeClaimTemplates:
   - metadata:
+      name: data
+    spec:
+      accessModes:
+      - ReadWriteOnce
+      resources:
+        requests:
+          storage: 1Gi
+      storageClassName: ceph-block
+  - metadata:
       name: audit
     spec:
       accessModes:
       - ReadWriteOnce
       resources:
         requests:

@tyriis-automation
Copy link
Contributor

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 1 0 0.01s
✅ REPOSITORY gitleaks yes no 3.13s
✅ YAML prettier 1 0 0.37s
✅ YAML yamllint 1 0 0.3s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@jazzlyn jazzlyn merged commit e965ddb into main Jan 28, 2025
16 checks passed
@jazzlyn jazzlyn deleted the feature/add-test-vault branch January 28, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant