Last active
September 29, 2024 20:20
-
-
Save danpawlik/774c0ca57aea5f9130abedd398e7c631 to your computer and use it in GitHub Desktop.
Install OLM with Operatorhub.io support on MicroShift 4.14 and newer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OPERATOR_SDK="v1.34.2" | |
OLM="0.27.0" | |
# Grant more permissions | |
oc patch scc restricted --type=merge -p '{"runAsUser": {"type": "RunAsAny"}}' | |
oc patch scc restricted-v2 --type=merge -p '{"runAsUser": {"type": "RunAsAny"}}' | |
# optional | |
oc adm policy add-scc-to-user privileged system:serviceaccount:olm:default | |
# download Operator SDK | |
curl -SL https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK/operator-sdk_linux_amd64 | |
chmod +x operator-sdk_linux_amd64 | |
# install OLM via OperatorSDK. Alternative way is to use script - https://github.com/operator-framework/operator-lifecycle-manager/releases/ | |
operator-sdk_linux_amd64 olm install --version "$OLM" | |
oc apply -f - <<EOF | |
--- | |
apiVersion: operators.coreos.com/v1alpha1 | |
kind: CatalogSource | |
metadata: | |
name: operatorhubio-catalog | |
namespace: olm | |
spec: | |
sourceType: grpc | |
image: quay.io/operatorhubio/catalog:latest | |
displayName: Community Operators | |
publisher: OperatorHub.io | |
updateStrategy: | |
registryPoll: | |
interval: 60m | |
EOF | |
# Install e.g. cert manager | |
kubectl create -f https://operatorhub.io/install/cert-manager.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment