-
Notifications
You must be signed in to change notification settings - Fork 309
Upgrade fluentbit-operator to fluent-operator #779
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
Conversation
|
@wanjunlei pls help to review |
|
There have two questions:
|
253efcc to
43e7793
Compare
cmd/upgrade/upgrade.sh
Outdated
| echo "${name[i]}" | ||
| temp=$(echo ${name[i]} | sed 's/"//g') | ||
| echo "$temp" | ||
| kubectl delete $resource.logging.kubesphere.io $temp -n ${namespace} || error_exit "Cannot delete resource $reresource" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you need to ignore the error that the resource does not exist
cmd/upgrade/upgrade.sh
Outdated
| converting "outputs" "ClusterOutput" | ||
| converting "fluentbitconfigs" "ClusterFluentBitConfig" | ||
|
|
||
| fluentbit_list=$(kubectl get fluentbits.logging.kubesphere.io -A -o json) || error_exit "Cannot get resource fluentbit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the namespace as a parameter. When the namespace is not empty, it is a namespace-level resource, so you don’t have to deal with FluentBit CRD separately.
cmd/upgrade/Dockerfile
Outdated
| @@ -0,0 +1,11 @@ | |||
| FROM alpine:latest | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many images of kubectl, such as bitnami/kubectl, kubesphere/kubectl, you don’t need to install kubectl and jq yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wanjunlei are u ok with the new change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to modify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@wanjunlei need to take another look
ca0cf56 to
96cc49f
Compare
Signed-off-by: dehaocheng <[email protected]>
cmd/upgrade/upgrade.sh
Outdated
| @@ -0,0 +1,80 @@ | |||
| #!/bin/bash | |||
| namespace=kubesphere-logging-system | |||
| deployment="fluentbit-operator" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| deployment="fluentbit-operator" | |
| fluentbit-operator="fluentbit-operator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been modified, it is better not to have - in the shell name, I modified it to FluentbitOperator
cmd/upgrade/upgrade.sh
Outdated
| converting "fluentbits" "FluentBit" | ||
|
|
||
| # Determine if Deployment exists | ||
| if kubectl get deployment -n $namespace $deployment >/dev/null 2>&1; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if kubectl get deployment -n $namespace $deployment >/dev/null 2>&1; then | |
| if kubectl get deployment -n $namespace $fluentbit-operator >/dev/null 2>&1; then |
cmd/upgrade/upgrade.sh
Outdated
| # Determine if Deployment exists | ||
| if kubectl get deployment -n $namespace $deployment >/dev/null 2>&1; then | ||
| # Delete Deployment if it exists | ||
| kubectl delete deployment -n $namespace $deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| kubectl delete deployment -n $namespace $deployment | |
| kubectl delete deployment -n $namespace $fluentbit-operator |
cmd/upgrade/upgrade.sh
Outdated
| exit 1 | ||
| } | ||
|
|
||
| function converting(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converting can be renamed to migrate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Change function name
What this PR does / why we need it:
During the process of upgrading the fluentbit-operator, this script helps the user to convert the original configuration to the new one and to uninstall the
fluentbit-operator.Which issue(s) this PR fixes:
Fixes #
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.: