Skip to content

Instantly share code, notes, and snippets.

View rinormaloku's full-sized avatar

Rinor Maloku rinormaloku

View GitHub Profile
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
apiVersion: v1
kind: Secret
metadata:
name: secretname
data:
secretKey: YWRtaW4K
secret: xxxxK
type: Opaque
{ "keys":[ {"e":"AQAB","kid":"CU-ADJJEbH9bXl0tpsQWYuo4EwlkxFUHbeJ4ckkakCM","kty":"RSA","n":"zl9VRDbmVvyXNdyoGJ5uhuTSRA2653KHEi3XqITfJISvedYHVNGoZZxUCoiSEumxqrPY_Du7IMKzmT4bAuPnEalbY8rafuJNXnxVmqjTrQovPIerkGW5h59iUXIz6vCznO7F61RvJsUEyw5X291-3Z3r-9RcQD9sYy7-8fTNmcXcdG_nNgYCnduZUJ3vFVhmQCwHFG1idwni8PJo9NH6aTZ3mN730S6Y1g_lJfObju7lwYWT8j2Sjrwt6EES55oGimkZHzktKjDYjRx1rN4dJ5PR5zhlQ4kORWg1PtllWy1s5TSpOUv84OPjEohEoOWH0-g238zIOYA83gozgbJfmQ"}]}
@rinormaloku
rinormaloku / named-arguments.sh
Last active July 8, 2020 07:46
named arguments sample for bash
#!/bin/bash
#set -e
help() {
cat <<EOF
A minimalistic script to showcase named arguments in bash.
The following flags are required.
--req-arg If required arg is not specified execution is interrupted.
@rinormaloku
rinormaloku / mod-service-role-binding.yaml
Created January 13, 2019 15:56
[Moderator Service Role Binding] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRoleBinding
metadata:
name: mod-user-binding
namespace: default
spec:
subjects:
- properties:
request.auth.claims[https://sa.io/group]: "Moderators"
roleRef:
@rinormaloku
rinormaloku / mod-service-role.yaml
Last active January 13, 2019 18:52
[Moderator service role] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRole
metadata:
name: mod-user
namespace: default
spec:
rules:
- services: ["*"]
paths: ["*"]
methods: ["*"]
@rinormaloku
rinormaloku / regular-user-service-role-binding.yaml
Created January 13, 2019 15:24
[Regular user service role binding] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRoleBinding
metadata:
name: regular-user-binding
namespace: default
spec:
subjects:
- user: "*"
roleRef:
kind: ServiceRole
@rinormaloku
rinormaloku / servicerole.yaml
Created January 13, 2019 15:24
[Regular user service role] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRole
metadata:
name: regular-user
namespace: default
spec:
rules:
- services:
- "sa-frontend.default.svc.cluster.local"
- "sa-web-app.default.svc.cluster.local"
@rinormaloku
rinormaloku / enable-rbac.yaml
Created January 13, 2019 15:22
[Enabling authorization with Inclusion of services] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
apiVersion: "rbac.istio.io/v1alpha1"
kind: RbacConfig
metadata:
name: default
spec:
mode: 'ON_WITH_INCLUSION' # 1
inclusion:
services: # 2
- "sa-frontend.default.svc.cluster.local"
- "sa-web-app.default.svc.cluster.local"
@rinormaloku
rinormaloku / namespacedGroup.js
Last active January 13, 2019 16:11
[Rule for adding group to access token] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
function (user, context, callback) {
context.accessToken['https://sa.io/group'] = user.groups[0];
return callback(null, user, context);
}