Skip to content

Instantly share code, notes, and snippets.

@cdot65
Last active October 31, 2022 22:15
Show Gist options
  • Save cdot65/9c48ab633db239a87de04e8ea7eac997 to your computer and use it in GitHub Desktop.
Save cdot65/9c48ab633db239a87de04e8ea7eac997 to your computer and use it in GitHub Desktop.

up-and-running-nautobot

A reference for spinning up Nautobot on top of a Kubernetes environment

k3s install

Install k3s with bash script

curl -sfL https://get.k3s.io | sh -

change permissions on k3s config file

sudo chown $USER:$USER /etc/rancher/k3s/k3s.yaml

validate status

kubectl get nodes

deploy nautobot with Helm

installing helm

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

update KUBECONFIG environmental

create KUBECONFIG variable and set the value to our k3s config file

export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

install helm repo for nautobot

helm repo add nautobot https://nautobot.github.io/helm-charts/

Create nautobot-config.yaml and store our configuration options for Nautobot

nautobot-config.yaml

postgresql:
  postgresqlPassword: "panofficehours"
redis:
  auth:
    password: "panofficehours"
nautobot:
  superUser:
    apitoken: "abcdefghijklmnop123"
    email: "[email protected]"
    enabled: True
    password: "panofficehours"
    username: "paloalto"

deploy nautobot with our nautobot-config.yaml file

helm install nautobot nautobot/nautobot -f ./nautobot-config.yaml --create-namespace -n nautobot

nautobot-service.yaml

create a service file to expose nautobot on port 30080

vim nautobot-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: nautobot-service
spec:
  ports:
    - name: http
      protocol: TCP
      port: 8080
      targetPort: 8080
      nodePort: 30080
  selector:
    app.kubernetes.io/component: nautobot
    app.kubernetes.io/instance: nautobot
    app.kubernetes.io/name: nautobot
  type: NodePort

deploy our service file

kubectl apply -f nautobot-service.yaml -n nautobot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment