commit 2fb09b447a9126700cfe4eb868683203daebc509 Author: Tanguy Herbron Date: Sun Dec 1 00:19:22 2024 +0100 feat: Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..b0fe4ad --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Headlamp + +## Configuration + +Once all manifests have been applied, use the following command to get the authentication token: + +```bash +kubectl create token headlamp-admin -n headlamp +``` diff --git a/manifests/clusterrolebinding.yaml b/manifests/clusterrolebinding.yaml new file mode 100644 index 0000000..e769334 --- /dev/null +++ b/manifests/clusterrolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: headlamp-admin +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: +- kind: ServiceAccount + name: headlamp-admin + namespace: headlamp diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml new file mode 100644 index 0000000..9c1f1c9 --- /dev/null +++ b/manifests/deployment.yaml @@ -0,0 +1,32 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: headlamp + namespace: headlamp +spec: + replicas: 1 + selector: + matchLabels: + k8s-app: headlamp + template: + metadata: + labels: + k8s-app: headlamp + spec: + containers: + - name: headlamp + image: ghcr.io/headlamp-k8s/headlamp:v0.26.0 + args: + - "-in-cluster" + - "-plugins-dir=/headlamp/plugins" + ports: + - containerPort: 4466 + livenessProbe: + httpGet: + scheme: HTTP + path: / + port: 4466 + initialDelaySeconds: 30 + timeoutSeconds: 30 + nodeSelector: + 'kubernetes.io/os': linux diff --git a/manifests/ingress.yaml b/manifests/ingress.yaml new file mode 100644 index 0000000..84fd7d3 --- /dev/null +++ b/manifests/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: headlamp + namespace: headlamp + annotations: + kubernetes.io/ingress.class: "traefik-inter" +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`headlamp.entos`) + services: + - name: headlamp-svc + port: 80 + tls: + certResolver: default diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml new file mode 100644 index 0000000..edd80e9 --- /dev/null +++ b/manifests/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - deployment.yaml + - serviceaccount.yaml + - clusterrolebinding.yaml + - service.yaml + - ingress.yaml + - secret.yaml diff --git a/manifests/namespace.yaml b/manifests/namespace.yaml new file mode 100644 index 0000000..6f6c133 --- /dev/null +++ b/manifests/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: headlamp diff --git a/manifests/secret.yaml b/manifests/secret.yaml new file mode 100644 index 0000000..c19c0e7 --- /dev/null +++ b/manifests/secret.yaml @@ -0,0 +1,8 @@ +kind: Secret +apiVersion: v1 +metadata: + name: headlamp-admin + namespace: headlamp + annotations: + kubernetes.io/service-account.name: "headlamp-admin" +type: kubernetes.io/service-account-token diff --git a/manifests/service.yaml b/manifests/service.yaml new file mode 100644 index 0000000..a76576d --- /dev/null +++ b/manifests/service.yaml @@ -0,0 +1,11 @@ +kind: Service +apiVersion: v1 +metadata: + name: headlamp-svc + namespace: headlamp +spec: + ports: + - port: 80 + targetPort: 4466 + selector: + k8s-app: headlamp diff --git a/manifests/serviceaccount.yaml b/manifests/serviceaccount.yaml new file mode 100644 index 0000000..c757447 --- /dev/null +++ b/manifests/serviceaccount.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: headlamp-admin + namespace: headlamp