Skip to content

Instantly share code, notes, and snippets.

View pierDipi's full-sized avatar
👋
:() { : | : & }; :

Pierangelo Di Pilato pierDipi

👋
:() { : | : & }; :
View GitHub Profile
@pierDipi
pierDipi / README.md
Last active February 26, 2024 16:21
Install Serverless midstream

Install Serverless midstream

These are unofficial installation instructions for early access OpenShift Serverless builds:

oc apply -f serverless.yaml

Notes

@pierDipi
pierDipi / authz-eventing.yaml
Last active April 4, 2024 11:02
Knative Event Policy draft APIs
apiVersion: eventing.knative.dev/v1alpha1
kind: EventPolicy
metadata:
name: my-event-policy
namespace: default
spec:
to: # ToEventPolicy struct -> empty "to" means applies to all resources in the namespace
- selector: # Object selector, no gvk means applies to all gvks that support authz
matchLabels:
app: my-broker
@pierDipi
pierDipi / knative-kafka.yaml
Last active January 15, 2024 12:37
KnativeKafka override producer and consumer config
apiVersion: operator.serverless.openshift.io/v1alpha1
kind: KnativeKafka
metadata:
name: knative-kafka
namespace: knative-eventing
spec:
# ... other spec fields omitted ...
# Change config-kafka-broker-data-plane ConfigMap
# We *MUST* specify all values as otherwise some values will be different (Config are not merged)
@pierDipi
pierDipi / cert-manager-spec-update-issue.md
Last active October 11, 2023 11:53
cert-manager spec Update Issue
  1. Install cert-manager

  2. Apply the cert-manager-spec-update-issue.yaml file (it's down below)

  3. Get the certificate

$ k get certificates -n cert-manager-issue server-tls -oyaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
@pierDipi
pierDipi / git_reset_submodules.bash
Created October 3, 2023 15:08
Git reset submodules
function git_reset_submodules() {
git submodule deinit -f .
git submodule update --init
}
@pierDipi
pierDipi / README.md
Last active October 3, 2023 14:12
Send CloudEvents with curl
url=...
curl -X POST -v -H "content-type: application/json"  -H "ce-specversion: 1.0"  -H "ce-source: my/curl/command" -H "ce-type: my.demo.event" -H "ce-id: 0815"  -d '{"name":"Curl"}' "${url}"
apiVersion: v1
kind: ServiceAccount
metadata:
name: apiserversource-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: apiserversource-role
rules:
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: knative-demo-topic
namespace: kafka
labels:
strimzi.io/cluster: my-cluster
spec:
partitions: 3
replicas: 1
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: seldon-deployment-addressable-resolver
labels:
app.kubernetes.io/version: devel
duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
annotations:
eventing.knative.dev/broker.class: Kafka
name: <broker-name>
spec:
config:
apiVersion: v1
kind: ConfigMap