Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
K8s PVC changed to one per node. (#43)
Browse files Browse the repository at this point in the history
Previously there were 3 PVC per node: logs, tm and quorum, this changes that to one PVC per node with subPaths for logs, tm and quorum.
  • Loading branch information
libby authored Jul 10, 2020
1 parent c76f98c commit 1191239
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 53 deletions.
37 changes: 1 addition & 36 deletions templates/k8s/persistent-volumes.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ end
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <%= @Node_UserIdent %>-quorum
<%= @Namespace %>
name: <%= @Node_UserIdent %>-pvc
annotations:
<%- @Annotations.each do |annotation| -%>
<%= annotation[0] %>: <%= annotation[1] %>
Expand All @@ -53,39 +53,4 @@ spec:
requests:
storage: <%= @Capacity %>
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <%= @Node_UserIdent %>-tm-pvc
<%= @Namespace %>
annotations:
<%- @Annotations.each do |annotation| -%>
<%= annotation[0] %>: <%= annotation[1] %>
<%- end -%>
spec:
<%= @Storage_Class_Name %>
accessModes:
- ReadWriteOnce
resources:
requests:
storage: <%= @Capacity %>

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: <%= @Node_UserIdent %>-log-pvc
<%= @Namespace %>
annotations:
<%- @Annotations.each do |annotation| -%>
<%= annotation[0] %>: <%= annotation[1] %>
<%- end -%>
spec:
<%= @Storage_Class_Name %>
accessModes:
- ReadWriteOnce
resources:
requests:
storage: <%= @Capacity %>
<% end -%>
35 changes: 18 additions & 17 deletions templates/k8s/quorum-deployment.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ spec:
volumeMounts:
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir %>
subPath: <%= @Node_UserIdent %>
- name: genesis-config-persistent-storage
mountPath: /etc/quorum/genesis/genesis-geth.json
subPath: genesis-geth.json
Expand Down Expand Up @@ -173,12 +174,15 @@ spec:
- name: DDIR
value: <%= @Node_DataDir %>/tm
volumeMounts:
- name: quorum-logs-persistent-storage
mountPath: <%= @Node_DataDir %>/logs
- name: tm-persistent-storage
mountPath: <%= @Node_DataDir %>/tm
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir %>
subPath: <%= @Node_UserIdent %>
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir %>/tm
subPath: <%= @Node_UserIdent %>-tm
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir %>/logs
subPath: <%= @Node_UserIdent %>-logs
- name: keystore-tm
mountPath: <%= @Node_DataDir %>/tm/tm.pub
subPath: tm.pub
Expand Down Expand Up @@ -300,18 +304,21 @@ spec:
- name: THIS_ENODE
value: <%- File.readlines("#{@Key_Dir_Base}/#{@Node_Key_Dir}/enode").each do |line| -%><%= line -%><% end -%>
volumeMounts:
- name: genesis-config-persistent-storage
mountPath: /etc/quorum/genesis/genesis-geth.json
subPath: genesis-geth.json
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir%>
- name: tm-persistent-storage
subPath: <%= @Node_UserIdent %>
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir%>/tm
subPath: <%= @Node_UserIdent %>-tm
- name: quorum-persistent-storage
mountPath: <%= @Node_DataDir %>/logs
subPath: <%= @Node_UserIdent %>-logs
- name: genesis-config-persistent-storage
mountPath: /etc/quorum/genesis/genesis-geth.json
subPath: genesis-geth.json
- name: quorum-key-config-persistent-storage
mountPath: <%= @Node_DataDir%>/dd/keystore/key
subPath: key
- name: quorum-logs-persistent-storage
mountPath: <%= @Node_DataDir %>/logs
- name: quorum-nodekey
mountPath: <%= @Node_DataDir%>/dd/geth/nodekey
subPath: nodekey
Expand Down Expand Up @@ -412,10 +419,4 @@ spec:
# PVC (configurable) https://kubernetes.io/docs/concepts/storage/persistent-volumes/#claims-as-volumes
- name: quorum-persistent-storage
persistentVolumeClaim:
claimName: <%= @Node_UserIdent %>-quorum
- name: tm-persistent-storage
persistentVolumeClaim:
claimName: <%= @Node_UserIdent %>-tm-pvc
- name: quorum-logs-persistent-storage
persistentVolumeClaim:
claimName: <%= @Node_UserIdent %>-log-pvc
claimName: <%= @Node_UserIdent %>-pvc

0 comments on commit 1191239

Please sign in to comment.