Skip to content

Instantly share code, notes, and snippets.

View mdrakiburrahman's full-sized avatar
💤
living the data dream

Raki mdrakiburrahman

💤
living the data dream
View GitHub Profile
@mdrakiburrahman
mdrakiburrahman / onboarder-kubeconfig-gen.sh
Created May 17, 2022 17:42
Generating a User kubeconfig and using that kubeconfig instead of Cluster Admin for onboarding Arc
# Here is a sample set of roles we'd want our SA/User account to have, this can be anything and the kubeconfig will inherit it
kubectl apply -f https://gist.githubusercontent.com/mdrakiburrahman/d94613872601c397f3a052492f168827/raw/a7909c131beb02f45970f2b605178859c6882555/tina-onboarder-rbac.yaml
# = = = = = = = = =
# Create a kubeconfig from this that overwrites our Cluster Admin that we get when we install a new K8s cluster
# = = = = = = = = =
# Service Account is in default but because of ClusterRoleBinding it has Cluster scope
namespace=default
serviceAccount=arc-data-deployer
apiVersion: v1
data:
password: YWNudG9yUFJFU1RPIQ==
username: Ym9vcg==
kind: Secret
metadata:
name: sql-bc-1-login-secret
namespace: arc-primary
type: Opaque
---
@mdrakiburrahman
mdrakiburrahman / azure-arc-least-priveleges_DRAFT.sh
Last active June 13, 2022 21:22
[DRAFT] E2E Deployment of Arc Operators without requiring a cluster-admin kubeconfig
# = = = = = = = = = = = = = = = = = = = =
# Verbosity wrapper
# = = = = = = = = = = = = = = = = = = = =
# On
export VERBOSE=1
# Off
unset VERBOSE
# = = = = = = = = = = = = = = = = = = = =
# #
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-conf
namespace: azure-arc-data
labels:
app: opentelemetry
component: otel-collector-conf
data:
otel-collector-config: |
@mdrakiburrahman
mdrakiburrahman / OTEL-agent-and-fluentforward.yaml
Last active June 15, 2022 21:21
OTEL daemonset and fluentforward not working
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-conf
namespace: azure-arc-data
labels:
app: opentelemetry
component: otel-collector-conf
data:
otel-collector-config: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mdrakiburrahman
mdrakiburrahman / install.sh
Created June 29, 2022 21:09
Helper functions for installing tools
#!/bin/bash -e
################################################################################
## File: install.sh
## Desc: Helper functions for installing tools
################################################################################
download_with_retries() {
# Due to restrictions of bash functions, positional arguments are used here.
# In case if you using latest argument NAME, you should also set value to all previous parameters.
# Example: download_with_retries $ANDROID_SDK_URL "." "android_sdk.zip"
@mdrakiburrahman
mdrakiburrahman / single-job-hook-no.yaml
Last active July 1, 2022 23:53
ArgoCD Hook Health issue
apiVersion: v1
kind: Namespace
metadata:
annotations:
argocd.argoproj.io/sync-wave: "-1"
name: single-job-hook-no
---
apiVersion: v1
data:
password: aGVsbG8K

The key capability a GitOps tool can provide to declaratively deploy each of our CRDs is health checks. Most Production Grade Gitops tools have the logic necessary to monitor K8s native resources (Pod, Service etc), but also the flexibility to extend to any Custom Resource.

Both Flux V1 and V2 has good support for K8s native resources, which makes it a great tool for the average Arc-enabled Kubernetes Customers deploying K8s components that aren't Customer Resources.

For custom resources, Flux V2 has limited literature, as it offloads that responsibility to kstatus, which makes rigid assumptions about the fields a CR should emit to be considered healthy - a boolean called Ready. Due to there being no standardized pattern for this, many open source