Skip to content

Instantly share code, notes, and snippets.

@nak3
Last active March 11, 2020 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nak3/28a5d47621d8697445b716e298c6a497 to your computer and use it in GitHub Desktop.
Save nak3/28a5d47621d8697445b716e298c6a497 to your computer and use it in GitHub Desktop.

1. Download manifest

mkdir /tmp/dev && cd /tmp/dev/
wget https://raw.githubusercontent.com/openshift/knative-serving/release-v0.11.1/openshift/release/knative-serving-v0.11.1.yaml

NOTE: This downloads v0.11.1 manifest. It should same version with $ oc get ks -n knative-serving.

2. Edit the downloaded manifest

e.g

vim knative-serving-v0.11.1.yaml

3. Create configmap with the downloaded manifest

operator_ns=$(kubectl get og --all-namespaces | grep global-operators | awk '{print $1}')
oc create configmap ko-data -n $operator_ns --from-file="knative-serving-v0.11.1.yaml"

4. Edit CSV to use the configmap

oc edit csv serverless-operator.v1.4.1 -n $operator_ns

NOTE: The version v1.4.1 must match for the serverless operator version oc get olm -n $operator_ns NOTE: The CSV you edit must be in $operator_ns.

The CSV should have following settings:

      deployments:
      - name: knative-serving-operator
      ...
                - name: METRICS_DOMAIN
                  value: knative.dev/serving-operator
                - name: KO_DATA_PATH                           # ADD
                  value: /tmp/				       # ADD

                       .. snip ..

                ports:
                - containerPort: 9090
                  name: metrics
                volumeMounts:                                  # ADD
                - mountPath: /tmp/knative-serving	       # ADD
                  name: release-manifest		       # ADD
              serviceAccountName: knative-serving-operator
              volumes:                                         # ADD
              - configMap:				       # ADD
                  items:				       # ADD
                  - key: knative-serving-v0.11.1.yaml	       # ADD
                    path: knative-serving-v0.11.1.yaml	       # ADD
                  name: ko-data				       # ADD
                name: release-manifest                         # ADD

5. Recreate knative-serving-operator deployment

$ oc delete deployment -n $operator_ns  knative-serving-operator

The deploment should be re-created and updted.

$ oc get deployment -n $operator_ns  knative-serving-operator -o yaml |grep KO_DATA
        - name: KO_DATA_PATH

6. Recreate one of Knative Serving pod in knative-serving namespace

oc delete pod -n knative-serving webhook-b49b8c5df-bwvlg

This will be the trigger and the config should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment