-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kubectl): add manifests for kubectl install
- adding example manifests files for kubectl apply - resolves #188 Signed-off-by: Anton Ouzounov <aouzounov@vmware.com>
- Loading branch information
Anton Ouzounov
committed
Apr 6, 2021
1 parent
3dda3bd
commit 8d19666
Showing
4 changed files
with
263 additions
and
1 deletion.
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,22 @@ | ||
### Installing log-router manually with kubectl: | ||
|
||
We support installing log-router (KFO) with Helm 3. However, in cases where that is not possible or not preferred, these instructions should suffice in getting started with log-router in a k8s cluster. You are responsible for figuring out which [flags](https://github.com/vmware/kube-fluentd-operator#synopsis) and environment variables need to be set on the log-router containers for your particular environment. | ||
|
||
#### Install the CRD: | ||
```bash | ||
kubectl apply -f ./crd.yaml | ||
``` | ||
|
||
|
||
#### Install the other kubectl manifests: | ||
|
||
```bash | ||
# Get the latest tag from github via curl: | ||
export kube_latest_tag=$(curl --silent "https://api.github.com/repos/vmware/kube-fluentd-operator/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') | ||
|
||
# Inject the latest tag into the manifests: | ||
sed -i .bak -e "s|<INSERT_TAG_HERE>|${kube_latest_tag}|g" manifests.yaml | ||
|
||
# Install with kubectl: | ||
kubectl apply -f ./manifests.yaml | ||
``` |
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,28 @@ | ||
# log-router CRD resource: | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: fluentdconfigs.logs.vdp.vmware.com | ||
spec: | ||
conversion: | ||
strategy: None | ||
group: logs.vdp.vmware.com | ||
names: | ||
kind: FluentdConfig | ||
listKind: FluentdConfigList | ||
plural: fluentdconfigs | ||
singular: fluentdconfig | ||
scope: Namespaced | ||
versions: | ||
- name: v1beta1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
properties: | ||
fluentconf: | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true |
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,212 @@ | ||
--- | ||
# Source: log-router/templates/sa.yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: log-router | ||
release: log-router | ||
name: log-router-log-router | ||
--- | ||
# Source: log-router/templates/clusterrole.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app: log-router | ||
release: log-router | ||
name: log-router-log-router | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- configmaps | ||
- namespaces | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: [""] | ||
resources: | ||
- namespaces | ||
verbs: | ||
- patch | ||
- apiGroups: ["apiextensions.k8s.io"] | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- create | ||
- get | ||
- watch | ||
- list | ||
- apiGroups: ["logs.vdp.vmware.com"] | ||
resources: | ||
- fluentdconfigs | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
--- | ||
# Source: log-router/templates/rolebinding.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
app: log-router | ||
release: log-router | ||
name: log-router-log-router | ||
subjects: | ||
- kind: ServiceAccount | ||
name: log-router-log-router | ||
namespace: infra-system | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: log-router-log-router | ||
--- | ||
# Source: log-router/templates/service.yaml | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: log-router | ||
release: log-router | ||
metrics: fluentd | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "24231" | ||
name: log-router-log-router | ||
spec: | ||
selector: | ||
app: log-router | ||
release: log-router | ||
ports: | ||
- port: 24231 | ||
name: prometheus | ||
targetPort: prometheus | ||
--- | ||
# Source: log-router/templates/service.yaml | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: log-router | ||
release: log-router | ||
metrics: reloader | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "9000" | ||
name: log-router-log-router-reloader | ||
spec: | ||
selector: | ||
app: log-router | ||
release: log-router | ||
ports: | ||
- port: 9000 | ||
name: metrics | ||
targetPort: metrics | ||
--- | ||
# Source: log-router/templates/daemonset.yaml | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: log-router-log-router | ||
labels: | ||
app: log-router | ||
chart: log-router-0.3.6 | ||
release: log-router | ||
heritage: Helm | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: log-router | ||
release: log-router | ||
template: | ||
metadata: | ||
labels: | ||
app: log-router | ||
release: log-router | ||
spec: | ||
serviceAccountName: log-router-log-router | ||
securityContext: | ||
fsGroup: 0 | ||
runAsGroup: 0 | ||
runAsUser: 0 | ||
containers: | ||
- name: fluentd | ||
image: "vmware/kube-fluentd-operator:<INSERT_TAG_HERE>" | ||
env: | ||
- name: K8S_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: prometheus | ||
containerPort: 24231 | ||
volumeMounts: | ||
- name: fluentconf | ||
mountPath: /fluentd/etc | ||
- name: varlog | ||
mountPath: /var/log | ||
- name: kubeletroot | ||
mountPath: "/var/lib/kubelet" | ||
readOnly: true | ||
- name: varlibdockercontainers | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
- mountPath: /var/ossec | ||
name: ossec | ||
readOnly: true | ||
resources: | ||
limits: | ||
memory: 2048Mi | ||
requests: | ||
memory: 2048Mi | ||
- name: reloader | ||
image: "vmware/kube-fluentd-operator:<INSERT_TAG_HERE>" | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: metrics | ||
containerPort: 9000 | ||
command: | ||
- /bin/config-reloader | ||
- --datasource=crd | ||
- --default-configmap=fluentd-config | ||
- --interval=90 | ||
- --log-level=info | ||
- --output-dir=/fluentd/etc | ||
- --templates-dir=/templates | ||
- --id=log-router-log-router | ||
- --fluentd-binary | ||
- /usr/local/bundle/bin/fluentd -p /fluentd/plugins --log-rotate-age 5 --log-rotate-size 1048576000 | ||
- --kubelet-root | ||
- "/var/lib/kubelet" | ||
- --prometheus-enabled | ||
- --metrics-port=9000 | ||
- --admin-namespace=kube-system | ||
volumeMounts: | ||
- name: fluentconf | ||
mountPath: /fluentd/etc | ||
resources: | ||
limits: | ||
memory: 1Gi | ||
requests: | ||
memory: 512Mi | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
volumes: | ||
- name: fluentconf | ||
emptyDir: {} | ||
- name: kubeletroot | ||
hostPath: | ||
path: "/var/lib/kubelet" | ||
- name: varlog | ||
hostPath: | ||
path: /var/log | ||
- name: varlibdockercontainers | ||
hostPath: | ||
path: /var/lib/docker/containers | ||
updateStrategy: | ||
type: RollingUpdate |