Skip to content

Commit

Permalink
Issue 465: Fixing tls bad certificate issue (#467)
Browse files Browse the repository at this point in the history
* Issue 465: Fixing tls bad certificate issue

Signed-off-by: SrishT <[email protected]>

* Issue 465: Fixing e2e tests

Signed-off-by: SrishT <[email protected]>

* Issue 465: Fixing tls bad certificate issue

Signed-off-by: SrishT <[email protected]>

* Issue 465: Fixing e2e tests

Signed-off-by: SrishT <[email protected]>

Co-authored-by: SrishT <[email protected]>
  • Loading branch information
SrishT and SrishT authored Oct 22, 2020
1 parent 95c21d3 commit 24bb31d
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ spec:
preserveUnknownFields: false
subresources:
status: {}
{{- if .Release.IsUpgrade }}
conversion:
conversionReviewVersions: ["v1beta1", "v1alpha1"]
strategy: Webhook
webhookClientConfig:
{{- if .Release.IsUpgrade }}
caBundle: {{ .Values.webhookCert.crt }}
{{- end }}
service:
name: pravega-webhook-svc
namespace: {{ .Release.Namespace }}
path: /convert
{{- end }}
version: v1beta1
versions:
- name: v1beta1
Expand Down
4 changes: 2 additions & 2 deletions charts/pravega/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: pravega
description: Pravega Helm chart for Kubernetes
version: 0.7.0
appVersion: 0.7.0
version: 0.8.0
appVersion: 0.8.0
keywords:
- pravega
- storage
Expand Down
2 changes: 1 addition & 1 deletion charts/pravega/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The following table lists the configurable parameters of the pravega chart and t

| Parameter | Description | Default |
| ----- | ----------- | ------ |
| `version` | Pravega version | `0.7.0` |
| `version` | Pravega version | `0.8.0` |
| `tls` | Pravega security configuration passed to the Pravega processes | `{}` |
| `authentication.enabled` | Enable authentication to authorize client communication with Pravega | `false` |
| `authentication.passwordAuthSecret` | Name of Secret containing Password based Authentication Parameters, if authentication is enabled | |
Expand Down
2 changes: 1 addition & 1 deletion charts/pravega/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## This is a YAML-formatted file.
## Declare variables to be passed into your templates.

version: 0.7.0
version: 0.8.0

tls: {}
# secret:
Expand Down
14 changes: 1 addition & 13 deletions deploy/crds/cr.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pravega-tier2
spec:
storageClassName: "nfs"
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Gi
---
apiVersion: "pravega.pravega.io/v1beta1"
kind: "PravegaCluster"
metadata:
name: "pravega"
spec:
version: 0.8.0
zookeeperUri: zookeeper-client:2181
externalAccess:
enabled: true
Expand All @@ -31,7 +20,6 @@ spec:
storage: 20Gi
image:
repository: pravega/pravega
tag: 0.7.0
pullPolicy: IfNotPresent
longtermStorage:
filesystem:
Expand Down
8 changes: 0 additions & 8 deletions deploy/crds/pravega.pravega.io_pravegaclusters_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ spec:
preserveUnknownFields: false
subresources:
status: {}
conversion:
conversionReviewVersions: ["v1beta1", "v1alpha1"]
strategy: Webhook
webhookClientConfig:
service:
name: pravega-webhook-svc
namespace: default
path: /convert
version: v1beta1
versions:
- name: v1beta1
Expand Down
11 changes: 11 additions & 0 deletions deploy/crds/tier2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pravega-tier2
spec:
storageClassName: "nfs"
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Gi
4 changes: 2 additions & 2 deletions doc/pravega-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if Pravega version is greater or equal 0.4, then the followings are also added t
```
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseContainerSupport",
"-XX:MaxRAMFraction=2"
"-XX:MaxRAMPercentage=50.0"
```

Default Segmenstore JVM Options
Expand All @@ -57,7 +57,7 @@ if Pravega version is greater or equal to 0.4, then the followings are also adde
```
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseContainerSupport",
"-XX:MaxRAMFraction=2"
"-XX:MaxRAMPercentage=50.0"
```

### SegmentStore Custom Configuration
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/pravega/pravega_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func MakeControllerConfigMap(p *api.PravegaCluster) *corev1.ConfigMap {
jvmOpts = append(jvmOpts,
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseContainerSupport",
"-XX:MaxRAMFraction=2",
"-XX:MaxRAMPercentage=50.0",
)
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/pravega/pravega_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ var _ = Describe("Controller", func() {
Image: &v1beta1.ImageSpec{
Repository: "bar/pravega",
},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
Options: map[string]string{
"dummy-key": "dummy-value",
},
Expand Down Expand Up @@ -203,8 +203,8 @@ var _ = Describe("Controller", func() {
Image: &v1beta1.ImageSpec{
Repository: "bar/pravega",
},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
Options: map[string]string{
"dummy-key": "dummy-value",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/pravega/pravega_segmentstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func MakeSegmentstoreConfigMap(p *api.PravegaCluster) *corev1.ConfigMap {
jvmOpts = append(jvmOpts,
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseContainerSupport",
"-XX:MaxRAMFraction=2",
"-XX:MaxRAMPercentage=50.0",
)
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/controller/pravega/pravega_segmentstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ var _ = Describe("PravegaSegmentstore", func() {
Image: &v1beta1.ImageSpec{
Repository: "bar/pravega",
},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
Options: map[string]string{
"dummy-key": "dummy-value",
},
Expand Down Expand Up @@ -212,8 +212,8 @@ var _ = Describe("PravegaSegmentstore", func() {
Image: &v1beta1.ImageSpec{
Repository: "bar/pravega",
},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
Options: map[string]string{
"dummy-key": "dummy-value",
},
Expand Down Expand Up @@ -316,8 +316,8 @@ var _ = Describe("PravegaSegmentstore", func() {
Image: &v1beta1.ImageSpec{
Repository: "bar/pravega",
},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMFraction=1"},
ControllerJvmOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
SegmentStoreJVMOptions: []string{"-XX:MaxDirectMemorySize=1g", "-XX:MaxRAMPercentage=50.0"},
Options: map[string]string{
"dummy-key": "dummy-value",
},
Expand Down
3 changes: 3 additions & 0 deletions scripts/pre-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ namespace=${2:-default}
kubectl annotate Service pravega-webhook-svc meta.helm.sh/release-name=$name -n $namespace --overwrite
kubectl annotate Service pravega-webhook-svc meta.helm.sh/release-namespace=$namespace -n $namespace --overwrite
kubectl label Service pravega-webhook-svc app.kubernetes.io/managed-by=Helm -n $namespace --overwrite

# Deleting required resources
kubectl delete mutatingwebhookconfiguration pravega-webhook-config
kubectl delete cm pravega-operator-lock
8 changes: 0 additions & 8 deletions test/e2e/resources/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ spec:
preserveUnknownFields: false
subresources:
status: {}
conversion:
conversionReviewVersions: ["v1beta1", "v1alpha1"]
strategy: Webhook
webhookClientConfig:
service:
name: pravega-webhook-svc
namespace: default
path: /convert
version: v1beta1
versions:
- name: v1beta1
Expand Down
6 changes: 4 additions & 2 deletions tools/operatorUpgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ sed -i "s|cert.*|cert-manager.io/inject-ca-from: $namespace/selfsigned-cert|" ./

sed -i "s/namespace.*/namespace: $namespace "/ ./manifest_files/webhook.yaml

#Insalling the webhook
#Installing the webhook
kubectl apply -f ./manifest_files/webhook.yaml

sed -i "s/namespace.*/namespace: $namespace "/ ./manifest_files/version_map.yaml

#Insalling the version map for pravega-operator
#Installing the version map for pravega-operator
kubectl apply -f ./manifest_files/version_map.yaml

cabundle=`kubectl get ValidatingWebhookConfiguration pravega-webhook-config --namespace ${namespace} --output yaml | grep caBundle: | awk '{print $2}'`
Expand All @@ -65,6 +65,8 @@ sed -i "s/value:.*/value: $op_name "/ ./manifest_files/patch.yaml

sed -i "/imagePullPolicy:.*/{n;s/name.*/name: $op_name/}" ./manifest_files/patch.yaml

#deleting required resources
kubectl delete mutatingwebhookconfiguration pravega-webhook-config
kubectl delete cm pravega-operator-lock

#updating the operator using patch file
Expand Down

0 comments on commit 24bb31d

Please sign in to comment.