Skip to content

Instantly share code, notes, and snippets.

View cmoulliard's full-sized avatar
🏠
Working from home

Charles Moulliard cmoulliard

🏠
Working from home
View GitHub Profile
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/ch007m/konflux-demo?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main"
@cmoulliard
cmoulliard / gosmee.md
Last active April 14, 2023 07:18
RHTAP & Gosmee to custom pipelines

Stonesoup k8s objects

k get all -n user1-tenant
ktree -n user1-tenant components/stonesoup-spring-boot-hdv4
ktree -n user1-tenant applications.v1alpha1.appstudio.redhat.com my-app

Gosmee

k delete -n pipelines-as-code deployment/gosmee-client
cat <<'EOF' | k apply -f -
@cmoulliard
cmoulliard / secured-docker-registry.md
Last active April 13, 2023 12:34
Commands used top of kind + docker registry
rm -rf $HOME/.docker/certs.d/registry.local:5000 
./kind-tls-secured-reg.sh

ls -la $HOME/.docker/certs.d
docker ps

docker pull gcr.io/google-samples/hello-app:1.0
docker tag gcr.io/google-samples/hello-app:1.0 kind-registry:5000/google-samples/hello-app:1.0

HTTPProxy quarkus-app-contour-quarkus-app.tap-demo

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  annotations:
    projectcontour.io/ingress.class: contour
  creationTimestamp: "2022-02-17T08:45:16Z"
  generation: 1
  labels:

Intro

The data collected by the ispindle IoT can be forwarded to a server, MQTT broker, brewery web site, ...

The following node-red flow has been designed to collect from a MQTT broker running on a laptop (or raspberry pi) the data which are then enriched in order to post them on ubidots

Before to start the flow locally, install node-red and mosquitto as MQTT broker

github.com/redhat-buildpacks/poc/kaniko github.com/GoogleContainerTools/kaniko@v1.7.0
github.com/redhat-buildpacks/poc/kaniko github.com/google/go-containerregistry@v0.4.1-0.20210128200529-19c2b639fab1
github.com/redhat-buildpacks/poc/kaniko github.com/pkg/errors@v0.9.1
github.com/redhat-buildpacks/poc/kaniko github.com/sirupsen/logrus@v1.8.1
github.com/redhat-buildpacks/poc/kaniko github.com/stretchr/testify@v1.6.1
github.com/redhat-buildpacks/poc/kaniko gotest.tools@v2.2.0+incompatible
cloud.google.com/go@v0.56.0 cloud.google.com/go/bigquery@v1.4.0
cloud.google.com/go@v0.44.2 rsc.io/binaryregexp@v0.2.0
cloud.google.com/go@v0.44.2 honnef.co/go/tools@v0.0.0-20190418001031-e561f6794a2a
cloud.google.com/go@v0.44.2 google.golang.org/grpc@v1.21.1
This file has been truncated, but you can view the full file.
time="2021-11-19T20:13:04Z" level=info msg="The layered tzg files will be extracted to the home dir ..."
INFO[0000] Starting the Kaniko application to process a Dockerfile ...
INFO[0000] Initialize the BuildPackConfig and set the defaults values ...
DEBU[0000] Check if DOCKER_FILE_NAME env is defined...
DEBU[0000] DOCKER_FILE_NAME=Dockerfile2
DEBU[0000] DockerfileName is: Dockerfile2
DEBU[0000] Checking if CNB_* env var have been declared ...
DEBU[0000] CNB ENV var is: map[]
DEBU[0000] KanikoOptions defined
INFO[0000] Kaniko dir: /kaniko

Podman on macos

  • Init a new vm
podman machine init macvm
Extracting compressed file
podman machine list
  • Start/stop/delete the VM

How to get the port number of the Server IP address of a k8s cluster using the info of the kubeconfig file

clusterName="kind-kind"
kubectl config view -o json | \
     jq '.clusters[] | select(.name=="'$clusterName'").cluster.server' | \
     sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g'
50211
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1ETXdPREE1TWpjME1Gb1hEVE14TURNd05qQTVNamMwTUZvd0ZURVRNQ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