在ubuntu或者centos安装,都需要使用snap…
https://snapcraft.io/install/kustomize/centos
https://snapcraft.io/install/kustomize/ubuntu
644 yum install epel-release
645 yum install snapd -y
646 systemctl enable --now snapd.socket
[root@k3s-master ~]# systemctl enable --now snapd.socket
Created symlink from /etc/systemd/system/sockets.target.wants/snapd.socket to /usr/lib/systemd/system/snapd.socket.
[root@k3s-master ~]# ln -s /var/lib/snapd/snap /snap
[root@k3s-master ~]# snap install kustomize
error: too early for operation, device not yet seeded or device model not acknowledged
[root@k3s-master ~]# snap install kustomize
2022-07-20T13:39:12+08:00 INFO Waiting for automatic snapd restart...
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session
since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
for more details.
kustomize 4.5.5 from abskmj installed
[root@k3s-master ~]# ln -s /var/lib/snapd/snap/bin/kustomize /usr/local/bin/kustomize
[root@k3s-master ~]# kustomize build -h
kustomize全部示例:参考
挂载configmap:https://www.bbsmax.com/A/6pdD9p4Dzw/
对于添加的节点
如果节点不存在,则新添加的第一级节点,需要在path中指定,其他子节点,在value中指定;
- op: replace
path: /apiVersion
value: networking.k8s.io/v1
- op: add
path: /spec/rules/0/http/paths/0/pathType
value: Prefix
- op: add
path: /spec/rules/0/http/paths/0/backend/service
value:
name: $(SERVICE_NAME)
port:
number: $(SERVICE_PORT)