Skip to content

Instantly share code, notes, and snippets.

View pbochynski's full-sized avatar

Piotr Bochyński pbochynski

View GitHub Profile
@pbochynski
pbochynski / oidc-sap-ias.md
Last active October 21, 2022 07:12
Configure Kyma with SAP IAS (oidc connector)

Configure IAS tenant

  1. Go to your IAS tenant admin page: https://mytenant.accounts.ondemand.com/admin

  2. Go to Applications & Resources -> Tenant Settings -> OpenID Connect Configuration, and select the Name value from a dropdown list. Choose the one starting with https.

  3. Go to Applications & Resources -> Applications and add new Application. Name it (e.g. kyma) and configure it:

    • set Type to OpenID Connect
    • in OpenID Connect Configuration set name (kyma) and add RedirectURI: https://dex.mykymacluster.domain/callback
    • set HTTP Basic Authentication: provide password and copy generated User ID (e.g. T000005)
    • in Assertion Attributes make sure User Attribute E-mail is mapped to Assertion Attribute email (not mail), and First Name to name
@pbochynski
pbochynski / kyma-cluster.sh
Last active July 9, 2019 14:45
Review comment
# Set ENV variables. See sample values in comments:
export KYMA_VERSION={KYMA_RELEASE_VERSION} # 1.2.0
export CLUSTER_NAME={CLUSTER_NAME_YOU_WANT} # kyma-cluster
export GCP_PROJECT={YOUR_GCP_PROJECT} # myproject
export GCP_ZONE={GCP_ZONE_TO_DEPLOY_TO} # europe-west1-b
# Create a cluster
gcloud container --project "$GCP_PROJECT" clusters \
create "$CLUSTER_NAME" --zone "$GCP_ZONE" \
--cluster-version "1.12" --machine-type "n1-standard-4" \
@pbochynski
pbochynski / review.js
Last active July 9, 2019 21:03
Review lambda code
const Sentiment = require('sentiment');
const sentiment = new Sentiment();
const axios = require("axios");
module.exports = {
main: async function (event, context) {
let status = "hold";
console.log("Event data: %s",JSON.stringify(event.data));
let comment = await getComment(event.data.commentId);
console.log("Comment: %s",comment.content.raw);
@pbochynski
pbochynski / static-ip-gke.md
Created November 12, 2019 08:06
Static IP for GKE cluster

Create a Kyma cluster. By default, GKE uses the Ephemeral IPs. The best option is to use the Cloud NAT together with GKE to get the static IP.

But for demo purpose, the easiest way for me was to disable the auto-scaling and change IP of each VM instance from the existing node pool to Static. (non-production option!)

Disable autoscaling for an existing node pool:

  1. Visit the Google Kubernetes Engine in GCP Console.

  2. Choose the cluster and its node pool and click its Edit button, which looks like a pencil.

@pbochynski
pbochynski / kyma-addon.md
Last active December 16, 2019 09:45
Kyma addon description

Kyma

Integrated stack of the best cloud-native projects for running modern microservice or serverless applications on top of Kubernetes, including Istio, Kiali, Prometheus, Grafana, Jaeger, Knative, Ory Hydra, and Loki. Kyma comes with a new lightweight service catalog you can use to easily connect hyperscaler's services (Azure, GCP, AWS) and SAP applications.

Requirements: minimal cluster size: 2 nodes (4 CPU and 16GB each), recommended (3-5 nodes).

You can find a link to Kyma management console UI and credentials in the shoot cluster dashboard. Learn more: https://kyma-project.io/. Duscuss and get help from Kyma community: http://slack.kyma-project.io/

@pbochynski
pbochynski / testing-kyma-2.0.md
Last active September 23, 2021 14:27
Testing Kyma 2.0

Testing Kyma 2.0 (CLI + reconciler + fast-integration)

  1. Prerequisites

    Checkout github.com/kyma-project/cli and github.com/kyma-project/kyma repositories to $GOPATH/src/github.com/kyma-project folder.

    Install node.js and install mocha globally:

npm install --global mocha

@pbochynski
pbochynski / color-sync.md
Last active November 8, 2022 10:58
Pybrics broadcast

Pybrics hub-to-hub communication test

This is the simple test for broadcast communication between to Technic Hubs (you can change it to City Hub Essential Hub, Inventor Hub, or Prime Hub).

Steps:

  1. Install experimental firmware for your hubs following this guide
  2. Connect sender hub and run this code:
from pybricks.hubs import TechnicHub