Giter Site home page Giter Site logo

k8s-fundamental's Introduction

K8s Fundamentals (Crossplane, LitmusChaos, Velero)

Prerequisites

  • Helm
  • Velero
  • kubectl

Update kubectl config for AWS Cluster

aws eks update-kubeconfig --region <REGION> --name <CLUSTER_NAME>

Step 1: Crossplane

Installation

helm repo add \
crossplane-stable https://charts.crossplane.io/stable
helm repo update
helm install crossplane \
crossplane-stable/crossplane \
--namespace crossplane-system \
--create-namespace
kubectl get pods -n crossplane-system

Provider and ProviderConfig

cat <<EOF | kubectl apply -f -
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-aws-s3
spec:
  package: xpkg.upbound.io/upbound/provider-aws-s3:v0.37.0
EOF
kubectl get providers

To work with the provider you need to install provider config with the AWS secret mentioned

[default]
aws_access_key_id = <YOUR_KEY>
aws_secret_access_key = <YOUR_KEY>
kubectl create secret \
generic aws-secret \
-n crossplane-system \
--from-file=creds=./aws-credentials.txt
cat <<EOF | kubectl apply -f -
apiVersion: aws.upbound.io/v1beta1
kind: ProviderConfig
metadata:
  name: default
spec:
  credentials:
    source: Secret
    secretRef:
      namespace: crossplane-system
      name: aws-secret
      key: creds
EOF
bucket=$(echo "crossplane-bucket-"$(head -n 4096 /dev/urandom | openssl sha1 | tail -c 10))
cat <<EOF | kubectl apply -f -
apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
  name: $bucket
spec:
  forProvider:
    region: us-east-2
  providerConfigRef:
    name: default
EOF
kubectl get buckets

Step 2: LitmusChaos

helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/
helm repo list
kubectl create ns litmus
helm install chaos litmuschaos/litmus --namespace=litmus --set portal.frontend.service.type=LoadBalancer

Step 3: Velero Backup

velero install \
    --provider aws \
    --plugins velero/velero-plugin-for-aws:v1.0.1 \
    --bucket <BUCKET_NAME> \
    --backup-location-config region=<REGION> \
    --snapshot-location-config region=<REGION> \
    --secret-file ./aws-credentials.txt
velero backup create <BACKUP_NAME> --include-namespaces <NAMESPACE>

Update kubectl config for Azure Cluster

az aks get-credentials --resource-group <RESOURCE_GROUP> --name <CLUSTER_NAME>

Step 4: Velero Restore

velero install \
    --provider aws \
    --plugins velero/velero-plugin-for-aws:v1.0.1 \
    --bucket <BUCKET_NAME> \
    --backup-location-config region=<REGION> \
    --snapshot-location-config region=<REGION> \
    --secret-file ./aws-credentials.txt
velero restore create --from-backup <BACKUP_NAME>

k8s-fundamental's People

Watchers

Nanthakumaran S avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.