nlamirault / home-assistant-configuration

1 stars 3 forks source link

Kubernetes deployment #2

Open nlamirault opened 7 years ago

nlamirault commented 7 years ago

Generate configuration to deploy home assistant to a Kubernetes cluster.

nlamirault commented 7 years ago

Try with :

apiVersion: v1
kind: Namespace
metadata:
  name: homeassistant
apiVersion: v1
kind: Service
metadata:
  name: homeassistant
  namespace: homeassistant
  labels:
    app: homeassistant
spec:
  ports:
  - port: 8123
    # name: ui
    # targetPort: ui
  selector:
    app: homeassistant
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: homeassistant
  namespace: homeassistant
  labels:
    app: homeassistant
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: homeassistant
    spec:
      containers:
      - image: homeassistant/raspberrypi3-homeassistant:0.51.1
        name: homeassistant
        ports:
        - containerPort: 8123
        volumeMounts:
        - name: config
          mountPath: /etc/homeassistant
      volumes:
      - name: config
        configMap:
          name: homeassistant
      - name: data
        hostPath:
        path: /srv/home-assistant-data
      hostNetwork: true
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: homeassistant
  namespace: homeassistant
  labels:
    app: homeassistant
  annotations:
    # ingress.kubernetes.io/auth-secret: discourse-basic-auth
    # ingress.kubernetes.io/auth-type: basic
    # ingress.kubernetes.io/auth-realm: "thisone"
    # kubernetes.io/tls-acme: "true"
spec:
  rules:
  - host: homeassistant.things.local
    http:
      paths:
      - backend:
          serviceName: homeassistant
          servicePort: 8123
        path: /