8000 THREESCALE-8491 upgrade system sphinx secret key env var by eguzki · Pull Request #783 · 3scale/3scale-operator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

THREESCALE-8491 upgrade system sphinx secret key env var #783

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

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

eguzki
Copy link
Member
@eguzki eguzki commented Sep 6, 2022

what

Completes https://issues.redhat.com/browse/THREESCALE-8491 after #762

how

Adding env var mutator to the sphinx deployment resource to

  • SECRET_KEY_BASE added
  • DELTA_INDEX_INTERVAL removed
  • FULL_REINDEX_INTERVAL removed

verification steps

Deploy 2.12

git checkout 3scale-2.12.0-GA
make run
k apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  creationTimestamp: null
  name: aws-auth
stringData:
  AWS_ACCESS_KEY_ID: testID
  AWS_SECRET_ACCESS_KEY: testkey
  AWS_BUCKET: testbucket
  AWS_REGION: us-east-1
type: Opaque
EOF
k apply -f - <<EOF
---
apiVersion: apps.3scale.net/v1alpha1
kind: APIManager
metadata:
  name: apimanager1
spec:
  wildcardDomain: eguzki.apps.dev-eng-ocp4-operator.dev.3sca.net
  resourceRequirementsEnabled: false
  system:
    fileStorage:
      simpleStorageService:
        configurationSecretRef:
          name: aws-auth
EOF

wait for deployment to be ready

oc wait --for=condition=available apimanager/apimanager1 --timeout=-1s
apimanager.apps.3scale.net/apimanager1 condition met

Check sphinx deployment config does not have the SECRET_KEY_BASE env var

k get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="SECRET_KEY_BASE")].value}'

Check sphinx deployment config has the DELTA_INDEX_INTERVAL env var

k get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="DELTA_INDEX_INTERVAL")].value}'
5

Check sphinx deployment config has the FULL_REINDEX_INTERVAL env var

k get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="FULL_REINDEX_INTERVAL")].value}'
60

Kill 2.12 operator with CTRL+c and move git workspace to upgrade-system-sphinx-secret-key branch

git checkout upgrade-system-sphinx-secret-key

Run the controller to perform upgrade

make run

wait for deployment to be ready

oc wait --for=condition=available apimanager/apimanager1 --timeout=-1s
apimanager.apps.3scale.net/apimanager1 condition met

Check sphinx deployment config has the SECRET_KEY_BASE env var

k get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="SECRET_KEY_BASE")].value}'
rails/32947

Check sphinx deployment config does not have the DELTA_INDEX_INTERVAL env var

k get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="DELTA_INDEX_INTERVAL")].value}'

Check sphinx deployment config does not have the FULL_REINDEX_INTERVAL env var

k get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="FULL_REINDEX_INTERVAL")].value}'

@openshift-ci
Copy link
openshift-ci bot commented Sep 6, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@codeclimate
Copy link
codeclimate bot commented Sep 6, 2022

Code Climate has analyzed commit 019d105 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Style 1

View more on Code Climate.

@eguzki eguzki requested review from KevFan and sergioifg94 September 6, 2022 15:46
@eguzki eguzki marked this pull request as ready for review September 6, 2022 15:46
@austincunningham
Copy link
Contributor
austincunningham commented Sep 7, 2022

@eguzki attempted to follow the verification steps, didn't get the desired outcome

git checkout 3scale-2.12.0-GA

➜  3scale-operator git:(a2e70c72) ✗ oc wait --for=condition=available apimanager/apimanager1 --timeout=-1s          
apimanager.apps.3scale.net/apimanager1 condition met
➜  3scale-operator git:(a2e70c72) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="SECRET_KEY_BASE")].value}' 
➜  3scale-operator git:(a2e70c72) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="DELTA_INDEX_INTERVAL")].value}' 
5%                                                                                                                                                                                                                                      
➜  3scale-operator git:(a2e70c72) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="FULL_REINDEX_INTERVAL")].value}'
60%

ctrl-C the running operator
git checkout upgrade-system-sphinx-secret-key
run operator again from the upgrade-system-sphinx-secret-key branch

➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc wait --for=condition=available apimanager/apimanager1 --timeout=-1s                                           
apimanager.apps.3scale.net/apimanager1 condition met
➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="SECRET_KEY_BASE")].value}' 
➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="DELTA_INDEX_INTERVAL")].value}' 
5%
➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="FULL_REINDEX_INTERVAL")].value}'
60%                

So no change best guess we are missing a verification step

ah operator crashes , guess we need to update the CRD when running from your branch

2022-09-07T11:54:32.803+0100    ERROR   setup   problem running manager {"error": "[no matches for kind \"ProxyConfigPromote\" in version \"capabilities.3scale.net/v1beta1\", failed waiting for all runnables to end within grace period of 30s: context deadline exceeded]", "errorCauses": [{"error": "no matches for kind \"ProxyConfigPromote\" in version \"capabilities.3scale.net/v1beta1\""}, {"error": "failed waiting for all runnables to end within grace period of 30s: context deadline exceeded"}]}
github.com/go-logr/zapr.(*zapLogger).Error

ran make install and re ran the verification

➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc wait --for=condition=available apimanager/apimanager1 --timeout=-1s                                           
apimanager.apps.3scale.net/apimanager1 condition met
➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="SECRET_KEY_BASE")].value}'
rails/32947%
➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="DELTA_INDEX_INTERVAL")].value}' 
➜  3scale-operator git:(upgrade-system-sphinx-secret-key) ✗ oc get dc system-sphinx -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="FULL_REINDEX_INTERVAL")].value}'

So verified
/lgtm

@eguzki eguzki merged commit 2064fa9 into master Sep 7, 2022
@eguzki eguzki deleted the upgrade-system-sphinx-secret-key branch September 7, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0