Mira's attempts to understand Kuwubernetes

Links RSS
Author ArgentumCation Posts Notes
License CC-BY-NC-SA 4.0+ Updated

Install k3s, helm

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: adminer
  name: adminer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: adminer
  template:
    metadata:
      labels:
        app: adminer
    spec:
      containers:
        - image: adminer:latest
          name: adminer
          ports:
            - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: adminer-svc
spec:
  type: ClusterIP
  selector:
    app: adminer
  ports:
    - port: 8080
      targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: adminer-http
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
  rules:
    - host: adminer.lipotropin.lan
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: adminer-svc
                port:
                  number: 8080

The above two result in the following

$ kubectl describe svc
Name:                     adminer
Namespace:                default
Labels:                   io.kompose.service=adminer
Annotations:              <none>
Selector:                 io.kompose.service=adminer
Type:                     ClusterIP
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.43.229.81
IPs:                      10.43.229.81
Port:                     8090  8090/TCP
TargetPort:               8080/TCP
Endpoints:                10.42.0.10:8080
Session Affinity:         None
Internal Traffic Policy:  Cluster
Events:                   <none>

Adminer can be accesed at 10.42.0.10:8080

[!TODO] how tf do I access this from 127.0.0.1 or outside?


kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml export KUBECONFIG=/etc/rancher/k3s/k3s.yaml


TODO: