Skip to content

Instantly share code, notes, and snippets.

View sadysnaat's full-sized avatar
🥷
Nature does not hurry, yet everything is accomplished

Deepak Sharma sadysnaat

🥷
Nature does not hurry, yet everything is accomplished
View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
name: cuda-vector-add
spec:
restartPolicy: OnFailure
containers:
- name: cuda-vector-add
image: "gcr.io/spectro-images-public/gpu/nvidia/ubuntu-nvidia-add:ubuntu
# specify gpu request
# Download the git repository
# This repository contains the code and manifest file
# for device driver installer and
# device plugin
git clone -b spectro-gpu https://github.com/spectrocloud/container-engine-accelerators/
cd nvidia-driver-installer/ubuntu/1804
# First we label the nodes with GPU,
# so that we can schedule device driver installer and device plugin on nodes.
kubectl label nodes <gpu enabled node name> spectrocloud.com/gpu-accelerator=""
@sadysnaat
sadysnaat / sample-coreprovider.yaml
Last active December 6, 2024 07:02
CoreProvider
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
namespace: capi-system
spec:
version: v1.8.5
@sadysnaat
sadysnaat / sample-coreprovider.yaml
Created December 11, 2024 17:59
Sample CoreProvider with ManifestPatches
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
name: cluster-api
namespace: capi-system
spec:
manifestPatches:
- |
apiVersion: v1
kind: Service
@sadysnaat
sadysnaat / Add Providers.patch
Created December 17, 2024 20:03
Git Ops Repo patches for Cluster API Operator Flux tutorial
diff --git a/apps/base/capi-operator/kustomization.yaml b/apps/base/capi-operator/kustomization.yaml
index bb5688c..15049ae 100644
--- a/apps/base/capi-operator/kustomization.yaml
+++ b/apps/base/capi-operator/kustomization.yaml
@@ -1,4 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- - capi-operator.yaml
\ No newline at end of file
@sadysnaat
sadysnaat / pod.yaml
Created December 27, 2024 06:19
Sample Pod
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
@sadysnaat
sadysnaat / cluster.yaml
Created December 28, 2024 14:39
Sample Cluster
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: sample-cluster
spec:
clusterNetwork:
pods:
cidrBlocks: ["192.168.0.0/16"]
@sadysnaat
sadysnaat / ClusterClassSpec.go
Created January 4, 2025 12:48
Cluster Class Spec - release-1.9
// ClusterClassSpec describes the desired state of the ClusterClass.
type ClusterClassSpec struct {
// infrastructure is a reference to a provider-specific template that holds
// the details for provisioning infrastructure specific cluster
// for the underlying provider.
// The underlying provider is responsible for the implementation
// of the template to an infrastructure cluster.
// +optional
Infrastructure LocalObjectTemplate `json:"infrastructure,omitempty"`
@sadysnaat
sadysnaat / ClusterClassWithPatchExample.yaml
Last active January 4, 2025 18:31
Cluster Class With Patch Example
apiVersion: cluster.x-k8s.io/v1beta1
kind: ClusterClass
metadata:
name: docker-clusterclass-v0.1.0
spec:
...
patches:
- name: dnsImageRespository
definitions:
- selector:
@sadysnaat
sadysnaat / ClusterTopologyWithVariableExample.yaml
Created January 4, 2025 18:34
Clusters With Topology Variables
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: my-docker-cluster
spec:
topology:
...
variables:
- name: dnsImageRespository
value: my.custom.dns.registry