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

Feat/vault discard #867

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Feat/vault discard #867

merged 2 commits into from
Nov 25, 2024

Conversation

phac008
Copy link
Contributor

@phac008 phac008 commented Nov 25, 2024

No description provided.

Copy link

Changes Rendered Chart
diff -U 4 -r out/target/vault/values-k3d.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml out/pr/vault/values-k3d.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml
--- out/target/vault/values-k3d.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml	2024-11-25 20:35:45.588562202 +0000
+++ out/pr/vault/values-k3d.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml	2024-11-25 20:35:19.616699520 +0000
@@ -149,11 +149,8 @@
               value: "/vault/userconfig/vault-ca/ca.crt"
             
           volumeMounts:
           
-            - name: audit
-              mountPath: /vault/audit
-  
   
     
             - name: data
               mountPath: /vault/data
@@ -269,36 +266,8 @@
             name: vault-root-token
         - command:
           - /bin/sh
           - -c
-          - |
-            while true; do
-              echo "waiting for tomorrow :-)"
-              sleep 86400  # Runs daily, after 1 day
-              echo "Truncating log file..."
-              truncate -s 0 /vault/audit/audit.log
-            done
-          env:
-          - name: VAULT_ADDR
-            valueFrom:
-              secretKeyRef:
-                key: VAULT_ADDR
-                name: sx-vault-env-vars
-          image: hashicorp/vault:1.17.2
-          name: audit-cleanup
-          securityContext:
-            allowPrivilegeEscalation: false
-            capabilities:
-              drop:
-              - ALL
-            privileged: false
-            runAsNonRoot: true
-          volumeMounts:
-          - mountPath: /vault-root-token
-            name: vault-root-token
-        - command:
-          - /bin/sh
-          - -c
           - "while true; do\n  sleep 10\n  if [ -f /vault-root-token/root_token ]; then\n
             \   export VAULT_TOKEN=$(cat /vault-root-token/root_token)\n    VAULT_STATUS=$(vault
             status)\n    if echo \"$VAULT_STATUS\" | grep -q \"Sealed.*false\"; then\n      if
             [ ! $(vault read identity/group/name/admins) ]; then\n\n        # kubernetes\n
@@ -364,19 +333,8 @@
       
       
       spec:
         accessModes:
-          - ReadWriteOnce
-        resources:
-          requests:
-            storage: 1Gi
-      
-    - metadata:
-        name: audit
-      
-      
-      spec:
-        accessModes:
           - ReadWriteOnce
         resources:
           requests:
             storage: 1Gi
diff -U 4 -r out/target/vault/values-k3d.yaml/sx-vault/templates/crossplane/cp-audit.yaml out/pr/vault/values-k3d.yaml/sx-vault/templates/crossplane/cp-audit.yaml
--- out/target/vault/values-k3d.yaml/sx-vault/templates/crossplane/cp-audit.yaml	2024-11-25 20:35:45.588562202 +0000
+++ out/pr/vault/values-k3d.yaml/sx-vault/templates/crossplane/cp-audit.yaml	2024-11-25 20:35:19.616699520 +0000
@@ -11,6 +11,7 @@
   providerConfigRef:
     name: vault-crossplane-providerconfig
   forProvider:
     options:
-      file_path: /vault/audit/audit.log
+     # file_path: /vault/audit/audit.log
+      file_path: discard
     type: file
diff -U 4 -r out/target/vault/values-uibklab.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml out/pr/vault/values-uibklab.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml
--- out/target/vault/values-uibklab.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml	2024-11-25 20:35:45.664562037 +0000
+++ out/pr/vault/values-uibklab.yaml/sx-vault/charts/vault/templates/server-statefulset.yaml	2024-11-25 20:35:19.688699457 +0000
@@ -143,11 +143,8 @@
             
             
           volumeMounts:
           
-            - name: audit
-              mountPath: /vault/audit
-  
   
     
             - name: data
               mountPath: /vault/data
@@ -230,36 +227,8 @@
             name: plugins
         - command:
           - /bin/sh
           - -c
-          - |
-            while true; do
-              echo "waiting for tomorrow :-)"
-              sleep 86400  # Runs daily, after 1 day
-              echo "Truncating log file..."
-              truncate -s 0 /vault/audit/audit.log
-            done
-          env:
-          - name: VAULT_ADDR
-            valueFrom:
-              secretKeyRef:
-                key: VAULT_ADDR
-                name: sx-vault-env-vars
-          image: hashicorp/vault:1.17.2
-          name: audit-cleanup
-          securityContext:
-            allowPrivilegeEscalation: false
-            capabilities:
-              drop:
-              - ALL
-            privileged: false
-            runAsNonRoot: true
-          volumeMounts:
-          - mountPath: /vault-root-token
-            name: vault-root-token
-        - command:
-          - /bin/sh
-          - -c
           - "while true; do\n  sleep 10\n  VAULT_STATUS=$(vault status)\n  if echo \"$VAULT_STATUS\"
             | grep -q \"Initialized.*false\" && [ $HOSTNAME != 'sx-vault-0' ]; then\n    echo
             joining raft cluster\n    vault operator raft join http://sx-vault-0.sx-vault-internal:8200\n
             \   sleep 5\n  fi \n  if echo \"$VAULT_STATUS\" | grep -q \"Initialized.*true\";
@@ -352,15 +321,4 @@
           - ReadWriteOnce
         resources:
           requests:
             storage: 1Gi
-      
-    - metadata:
-        name: audit
-      
-      
-      spec:
-        accessModes:
-          - ReadWriteOnce
-        resources:
-          requests:
-            storage: 5Gi
diff -U 4 -r out/target/vault/values-uibklab.yaml/sx-vault/templates/crossplane/cp-audit.yaml out/pr/vault/values-uibklab.yaml/sx-vault/templates/crossplane/cp-audit.yaml
--- out/target/vault/values-uibklab.yaml/sx-vault/templates/crossplane/cp-audit.yaml	2024-11-25 20:35:45.664562037 +0000
+++ out/pr/vault/values-uibklab.yaml/sx-vault/templates/crossplane/cp-audit.yaml	2024-11-25 20:35:19.692699452 +0000
@@ -11,6 +11,7 @@
   providerConfigRef:
     name: vault-crossplane-providerconfig
   forProvider:
     options:
-      file_path: /vault/audit/audit.log
+     # file_path: /vault/audit/audit.log
+      file_path: discard
     type: file

Copy link

Changes Default Values

@phac008 phac008 merged commit 6064353 into main Nov 25, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant