-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkube-fluentd-operator.yaml
160 lines (136 loc) · 5.63 KB
/
kube-fluentd-operator.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package:
name: kube-fluentd-operator
version: 1.18.2
epoch: 100
description: Auto-configuration of Fluentd daemon-set based on Kubernetes metadata
copyright:
- license: MIT
resources:
cpu: 16
memory: 16Gi
dependencies:
runtime:
- busybox
- jemalloc
- libsystemd
- ruby-3.2
- ruby3.2-bundler
environment:
contents:
packages:
- bash
- build-base
- busybox
- bzip2
- ca-certificates-bundle
- gdbm
- gdbm-dev
- git
- gmp-dev
- go
- gpg
- libedit
- libedit-dev
- libffi-dev
- openssl-dev
- ruby-3.2
- ruby-3.2-dev
- ruby3.2-bundler
- wget
- zlib-dev
# https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/commit/53d481a6f417e9d039cae717eab4773ab754738e
vars:
FLUENT_PLUGIN_GOOGLE_CLOUD_COMMIT: "53d481a6f417e9d039cae717eab4773ab754738e"
pipeline:
- uses: git-checkout
with:
repository: https://github.com/vmware/kube-fluentd-operator
tag: v${{package.version}}
expected-commit: 20e6130591ab07d1c73fcc892a4f9146c5a26b25
- uses: go/bump
with:
deps: google.golang.org/[email protected] golang.org/x/[email protected]
modroot: image
- uses: go/bump
with:
deps: google.golang.org/[email protected] golang.org/x/[email protected] golang.org/x/[email protected]
modroot: config-reloader
- runs: |
echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
cd image
GEM_DIR=${{targets.destdir}}$(ruby -e 'puts Gem.default_dir')
mkdir -p ${GEM_DIR}
bundle config set --local path ${GEM_DIR}
bundle config set --local without 'development test'
bundle update rack
bundle install
mkdir -p ${{targets.destdir}}/etc/fluent/plugin
mv ./plugins/* ${{targets.destdir}}/etc/fluent/plugin
cd ..
git clone https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud.git
cd fluent-plugin-google-cloud
git checkout ${{vars.FLUENT_PLUGIN_GOOGLE_CLOUD_COMMIT}}
# Remediate GHSA-p25m-jpj4-qcrr CVE in the grpc. GHSA-p25m-jpj4-qcrr is fixed in grpc >=1.53.2 but 1.58.3 is
# the first version that has precompiled binaries for both x86_64 and aarch64. Compilation issues on aarch64
# prompted this change. It will result in faster builds too.
sed -e "s/'grpc', '1.53.0'/'grpc', '1.58.3'/g" -i fluent-plugin-google-cloud.gemspec
# Moving to grpc 1.58.3 causes a dependency resolution issue as grpc >= 1.55.0, < 1.59.0 requires
# google-protobuf ~> 3.23 but fluent-plugin-google-cloud had pinned google-protobuf to version 3.22.1.
# Bumping google-protobuf to 3.23 solves this.
sed -e "s/'google-protobuf', '3.22.1'/'google-protobuf', '3.25.5'/g" -i fluent-plugin-google-cloud.gemspec
bundle config set --local path ${GEM_DIR}
bundle config set --local without 'development test'
bundle install
# remove cache to avoid including it in the package
rm -rf ${{targets.destdir}}/$(ruby -e "puts File.join(Gem.default_dir, 'ruby', RbConfig::CONFIG['ruby_version'])")/cache
- uses: strip
- runs: |
# makefile has moved to the root of the repo without any changes
# This may break in future versions TODO : Remove this when the makefile works again from root of repo
cp Makefile ./config-reloader
mkdir -p ${{targets.destdir}}/usr/bin
cd config-reloader
make build VERSION=${{package.version}}
mv config-reloader ${{targets.destdir}}/usr/bin/
mv ./templates ${{targets.destdir}}/etc/fluent/
subpackages:
- name: kube-fluentd-operator-oci-entrypoint
description: Entrypoint for using kube-fluentd-operator
dependencies:
runtime:
- bash
pipeline:
- runs: |
cd image
mkdir -p ${{targets.subpkgdir}}/var/lib/kube-fluentd-operator/initdb
cp entrypoint.sh ${{targets.subpkgdir}}/var/lib/kube-fluentd-operator/initdb/
chmod +x ${{targets.subpkgdir}}/var/lib/kube-fluentd-operator/initdb/entrypoint.sh
- name: kube-fluentd-operator-default-config
description: Default configuration for kube-fluentd-operator
pipeline:
- runs: |
cd image
mkdir -p ${{targets.subpkgdir}}/etc/fluent
cp failsafe.conf ${{targets.subpkgdir}}/etc/fluent/fluent.conf
- name: kube-fluentd-operator-compat
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/fluentd/etc
mkdir -p ${{targets.subpkgdir}}/bin
mkdir -p ${{targets.subpkgdir}}/usr/local/bundle/bin
mkdir -p ${{targets.subpkgdir}}/usr/lib/gem
ln -sf /var/lib/kube-fluentd-operator/initdb/entrypoint.sh ${{targets.subpkgdir}}/fluentd/entrypoint.sh
ln -sf /etc/fluent/fluent.conf ${{targets.subpkgdir}}/fluentd/failsafe.conf
ln -sf /etc/fluent/plugin ${{targets.subpkgdir}}/fluentd/plugins
ln -sf /etc/fluent/plugin ${{targets.subpkgdir}}/fluentd/log
ln -sf /etc/fluent/templates ${{targets.subpkgdir}}/templates
ln -sf /usr/bin/config-reloader ${{targets.subpkgdir}}/bin/config-reloader
ln -sf $(ruby -e "puts File.join(Gem.default_dir, 'ruby', RbConfig::CONFIG['ruby_version'], 'bin', 'fluentd')") ${{targets.subpkgdir}}/usr/local/bundle/bin/fluentd
# this should probably live in the ruby-3.2 package but not sure if we need to do it in a way that multiple ruby versions can coexist
# TODO JR to followup
ln -sf $(ruby -e "puts File.join(Gem.default_dir, 'ruby', RbConfig::CONFIG['ruby_version'])") ${{targets.subpkgdir}}/usr/lib/gem/home
update:
enabled: true
github:
identifier: vmware/kube-fluentd-operator
strip-prefix: v