├── .gitignore ├── README.md ├── k3d.yaml ├── k8s ├── deployment.yaml ├── ingress.yaml └── service.yaml └── kind.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | /kubeconfig.yaml 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [K3d - How to run Kubernetes cluster locally using Rancher k3s](https://youtu.be/mCesuGk-Fks) 2 | -------------------------------------------------------------------------------- /k3d.yaml: -------------------------------------------------------------------------------- 1 | kind: Simple 2 | apiVersion: k3d.io/v1alpha2 3 | name: my-cluster 4 | image: rancher/k3s:v1.20.4-k3s1 5 | servers: 3 6 | agents: 3 7 | ports: 8 | - port: 80:80 9 | nodeFilters: 10 | - loadbalancer 11 | # options: 12 | # k3s: 13 | # extraServerArgs: 14 | # - --no-deploy=traefik 15 | -------------------------------------------------------------------------------- /k8s/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: devops-toolkit 5 | labels: 6 | app: devops-toolkit 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: devops-toolkit 11 | template: 12 | metadata: 13 | labels: 14 | app: devops-toolkit 15 | spec: 16 | containers: 17 | - name: devops-toolkit 18 | image: vfarcic/devops-toolkit-series 19 | ports: 20 | - containerPort: 80 21 | livenessProbe: 22 | httpGet: 23 | path: / 24 | port: 80 25 | readinessProbe: 26 | httpGet: 27 | path: / 28 | port: 80 29 | resources: 30 | limits: 31 | cpu: 100m 32 | memory: 256Mi 33 | requests: 34 | cpu: 80m 35 | memory: 128Mi 36 | 37 | -------------------------------------------------------------------------------- /k8s/ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: devops-toolkit 5 | annotations: 6 | ingress.kubernetes.io/ssl-redirect: "false" 7 | spec: 8 | rules: 9 | - http: 10 | paths: 11 | - path: / 12 | pathType: Prefix 13 | backend: 14 | service: 15 | name: devops-toolkit 16 | port: 17 | number: 80 18 | -------------------------------------------------------------------------------- /k8s/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: devops-toolkit 5 | labels: 6 | app: devops-toolkit 7 | spec: 8 | type: ClusterIP 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: devops-toolkit 16 | -------------------------------------------------------------------------------- /kind.yaml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | nodes: 4 | - role: control-plane 5 | kubeadmConfigPatches: 6 | - | 7 | kind: InitConfiguration 8 | nodeRegistration: 9 | kubeletExtraArgs: 10 | node-labels: "ingress-ready=true" 11 | extraPortMappings: 12 | - containerPort: 80 13 | hostPort: 80 14 | protocol: TCP 15 | - containerPort: 443 16 | hostPort: 443 17 | protocol: TCP 18 | - role: control-plane 19 | - role: control-plane 20 | - role: worker 21 | - role: worker 22 | - role: worker 23 | --------------------------------------------------------------------------------