-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3391 from ivans3/logviewer-addon-pr7
Initial commit of logviewer addon
- Loading branch information
Showing
6 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: logviewer | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/minikube-addons: logviewer | ||
kubernetes.io/minikube-addons-endpoint: logviewer | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
spec: | ||
ports: | ||
- port: 3000 | ||
name: http | ||
nodePort: 32000 | ||
selector: | ||
app: logviewer | ||
type: NodePort | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: logviewer | ||
namespace: kube-system | ||
labels: | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
kubernetes.io/minikube-addons: logviewer | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: logviewer | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
template: | ||
metadata: | ||
labels: | ||
app: logviewer | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
spec: | ||
serviceAccountName: sa-logviewer | ||
containers: | ||
- name: logviewer | ||
imagePullPolicy: Always | ||
image: docker.io/ivans3/minikube-log-viewer:latest | ||
volumeMounts: | ||
- name: logs | ||
mountPath: /var/log/containers/ | ||
- name: logs-pods | ||
mountPath: /var/log/pods | ||
- name: logs-containers-mnt-sda1 | ||
mountPath: /mnt/sda1/var/lib/docker/containers/ | ||
- name: logs-containers | ||
mountPath: /var/lib/docker/containers/ | ||
ports: | ||
- containerPort: 3000 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 3000 | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 30 | ||
volumes: | ||
- name: logs | ||
hostPath: | ||
path: /var/log/containers | ||
- name: logs-pods | ||
hostPath: | ||
path: /var/log/pods | ||
#for minikube v0.22.2: | ||
- name: logs-containers-mnt-sda1 | ||
hostPath: | ||
path: /mnt/sda1/var/lib/docker/containers/ | ||
#for minikube v0.22.3+: | ||
- name: logs-containers | ||
hostPath: | ||
path: /var/lib/docker/containers/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: sa-logviewer | ||
namespace: kube-system | ||
labels: | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
kubernetes.io/minikube-addons: logviewer | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
kubernetes.io/minikube-addons: logviewer | ||
name: cr-logviewer | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
verbs: ["get", "watch", "list"] | ||
|
||
--- | ||
|
||
# This cluster role binding allows "sa-logviewer" to read namespace metadata | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: crb-logviewer | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/minikube-addons: logviewer | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sa-logviewer | ||
namespace: kube-system | ||
roleRef: | ||
kind: ClusterRole #this must be Role or ClusterRole | ||
name: cr-logviewer # this must match the name of the Role or ClusterRole you wish to bind to | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters