Skip to content

Instantly share code, notes, and snippets.

View netoxico's full-sized avatar
🏠
Working from home

Ernesto Vargas netoxico

🏠
Working from home
View GitHub Profile
@netoxico
netoxico / K8s-DigitalOcean-CoreOS.md
Created September 26, 2018 03:24 — forked from kevashcraft/K8s-DigitalOcean-CoreOS.md
How to Setup Kubernetes on DigitalOcean with CoreOS

Kubernetes on DigitalOcean with CoreOS

Let's look at an example of how to launch a Kubernetes cluster from scratch on DigitalOcean, including kubeadm, an Nginx Ingress controller, and Letsencrypt certificates.

Overview

Environment

We'll be creating a four-node cluster (k8s-master, k8s-000...k8s-002), load balancer, and ssl certificates.

Table of Contents

  1. Install Kubernetes
#!/bin/bash
sudo su
echo "Initializing docker service ..."
systemctl enable docker && systemctl start docker
echo "Docker service initialized successfully."
echo "Installing CNI ..."
CNI_VERSION="v0.6.0"
mkdir -p /opt/cni/bin
PUBLIC_IP=$(ip -f inet -o addr show eth0|cut -d\ -f 7 | cut -d/ -f 1 | head -n 1)
sudo kubeadm init --apiserver-advertise-address=$PUBLIC_IP --pod-network-cidr=10.244.0.0/16
sudo sysctl net.bridge.bridge-nf-call-iptables=1
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/default-backend.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/configmap.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/tcp-services-configmap.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/udp-services-configmap.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/with-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml
kubectl get svc -n ingress-nginx
@netoxico
netoxico / function.js
Created February 24, 2024 03:42 — forked from czue/function.js
OpenAI function for Source Citations in a RAG architecture
{
"name": "answer_and_sources",
"description": "Gets an answer and cites the relevant sources used to provide the answer.",
"parameters": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"description": "The answer to the user's question.",
},
@netoxico
netoxico / example.md
Created August 21, 2024 02:55 — forked from wiseman/example.md
Get store hours from images
$ python hours.py image.jpg
{
  "day_hours": [
    {
      "day": "Mon - Fri",
      "hours": "7 AM - 5 PM"
    },
    {
 "day": "Saturday",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.