Skip to content

Commit

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

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

* Issue 80: CRD changes

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

Co-authored-by: SrishT <[email protected]>
  • Loading branch information
SrishT and SrishT authored Oct 21, 2020
1 parent bdc1a35 commit 591eac1
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ spec:
required:
- kind
- name
nullable: true
type: object
resources:
description: 'Resources represents the minimum resources the
Expand Down Expand Up @@ -393,6 +394,7 @@ spec:
required:
- kind
- name
nullable: true
type: object
resources:
description: 'Resources represents the minimum resources the
Expand Down Expand Up @@ -530,6 +532,7 @@ spec:
required:
- kind
- name
nullable: true
type: object
resources:
description: 'Resources represents the minimum resources the
Expand Down
2 changes: 2 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
)

Expand All @@ -55,6 +56,7 @@ func printVersion() {

func main() {
flag.Parse()
logf.SetLogger(logf.ZapLogger(false))

printVersion()

Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/bookkeeper.pravega.io_bookkeeperclusters_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ spec:
required:
- kind
- name
nullable: true
type: object
resources:
description: 'Resources represents the minimum resources the
Expand Down Expand Up @@ -392,6 +393,7 @@ spec:
required:
- kind
- name
nullable: true
type: object
resources:
description: 'Resources represents the minimum resources the
Expand Down Expand Up @@ -529,6 +531,7 @@ spec:
required:
- kind
- name
nullable: true
type: object
resources:
description: 'Resources represents the minimum resources the
Expand Down
3 changes: 3 additions & 0 deletions doc/operator-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ To install cert-manager check [this](https://cert-manager.io/docs/installation/k
```
./pre-upgrade.sh [BOOKKEEPER_OPERATOR_RELEASE_NAME][BOOKKEEPER_OPERATOR_NAMESPACE]
```
where:
- `[BOOKKEEPER_OPERATOR_RELEASE_NAME]` is the release name of the bookkeeper operator deployment
- `[BOOKKEEPER_OPERATOR_NAMESPACE]` is the namespace in which the bookkeeper operator has been deployed (this is an optional parameter and its default value is `default`)

### Triggering the upgrade

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/zapr v0.1.0 h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54=
github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=
github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE=
github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
Expand Down Expand Up @@ -1065,18 +1066,21 @@ go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU=
go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo=
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
Expand Down
8 changes: 3 additions & 5 deletions pkg/apis/bookkeeper/v1alpha1/bookkeepercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,7 @@ type BookkeeperClusterList struct {
Items []BookkeeperCluster `json:"items"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// BookkeeperCluster is the Schema for the BookkeeperClusters API
// +k8s:openapi-gen=true
// Generate CRD using kubebuilder

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=bk
Expand All @@ -146,7 +141,10 @@ type BookkeeperClusterList struct {
// +kubebuilder:printcolumn:name="Desired Members",type=integer,JSONPath=`.status.replicas`,description="The number of desired bookkeeper members"
// +kubebuilder:printcolumn:name="Ready Members",type=integer,JSONPath=`.status.readyReplicas`,description="The number of ready bookkeeper members"
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:openapi-gen=true

// BookkeeperCluster is the Schema for the BookkeeperClusters API
type BookkeeperCluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions scripts/pre-upgrade.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#! /bin/bash
set -ex

if [ "$#" -ne 2 ]; then
if [[ "$#" -lt 1 || "$#" -gt 2 ]]; then
echo "Error : Invalid number of arguments"
Usage: "./pre-upgrade.sh <bookkeeper-operator-release-name> <bookkeeper-operator-namespace>"
exit 1
fi

name=$1
namespace=$2
namespace=${2:-default}

kubectl annotate Service bookkeeper-webhook-svc meta.helm.sh/release-name=$name -n $namespace --overwrite
kubectl annotate Service bookkeeper-webhook-svc meta.helm.sh/release-namespace=$namespace -n $namespace --overwrite
kubectl label Service bookkeeper-webhook-svc app.kubernetes.io/managed-by=Helm -n $namespace --overwrite

#deleting the mutatingwebhookconfiguration created by the previous operator
kubectl delete mutatingwebhookconfiguration bookkeeper-webhook-config
3 changes: 3 additions & 0 deletions tools/operatorUpgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ 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 the mutatingwebhookconfiguration created by the previous operator
kubectl delete mutatingwebhookconfiguration bookkeeper-webhook-config

#updating the operator using patch file
kubectl patch deployment $op_name --namespace ${namespace} --type merge --patch "$(cat ./manifest_files/patch.yaml)"

Expand Down

0 comments on commit 591eac1

Please sign in to comment.