Browse Source

add pvc access mode

tags/0.0.6
Vladimir Smagin 2 months ago
parent
commit
2c33400c07
4 changed files with 12 additions and 6 deletions
  1. +1
    -1
      VERSION
  2. +4
    -3
      pkg/apis/blindage/v1alpha1/wordpress_types.go
  3. +6
    -1
      pkg/controller/wordpress/pvc.go
  4. +1
    -1
      version/version.go

+ 1
- 1
VERSION View File

@@ -1 +1 @@
0.0.5
0.0.6

+ 4
- 3
pkg/apis/blindage/v1alpha1/wordpress_types.go View File

@@ -62,9 +62,10 @@ type WordpressSpec struct {
WordpressTolerations *[]v1.Toleration `json:"wordpressTolerations"`

// set volume for wp-content
WordpressVolumeCleanup bool `json:"wordpressVolumeCleanup,omitempty"` // true to save PVC after CR delete
WordpressVolumeSize *resource.Quantity `json:"wordpressVolumeSize,omitempty"` // default 1 Gb
WordpressStorageClass string `json:"wordpressStorageClass,omitempty"`
WordpressVolumeCleanup bool `json:"wordpressVolumeCleanup,omitempty"` // true to save PVC after CR delete
WordpressVolumeSize *resource.Quantity `json:"wordpressVolumeSize,omitempty"` // default 1 Gb
WordpressStorageClass string `json:"wordpressStorageClass,omitempty"`
WordpressAccessMode *v1.PersistentVolumeAccessMode `json:"wordpressAccessMode,omitempty"` // change mode if only one wp instance used

// set annotations to service and pod, default is empty
WordpressServiceAnnotations *map[string]string `json:"wordpressServiceAnnotations,omitempty"`


+ 6
- 1
pkg/controller/wordpress/pvc.go View File

@@ -13,6 +13,11 @@ func generateWordpressContentVolume(cr *blindagev1alpha1.Wordpress) corev1.Persi
volumeSize = *cr.Spec.WordpressVolumeSize
}

pvcAccessMode := corev1.ReadWriteMany
if cr.Spec.WordpressAccessMode != nil {
pvcAccessMode = *cr.Spec.WordpressAccessMode
}

claim := corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: cr.Name + "-content",
@@ -22,7 +27,7 @@ func generateWordpressContentVolume(cr *blindagev1alpha1.Wordpress) corev1.Persi
),
},
Spec: corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany},
AccessModes: []corev1.PersistentVolumeAccessMode{pvcAccessMode},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: volumeSize,


+ 1
- 1
version/version.go View File

@@ -1,5 +1,5 @@
package version

var (
Version = "0.0.5"
Version = "0.0.6"
)

Loading…
Cancel
Save