我尝试sed替换值0.1.233 ...在命令行上没有问题;但是,当将此命令放入 shell 脚本中时,出现错误:
sed: couldn't open temporary file ../project/cas-dp-ap/sedwi3jVw: Permission denied
Run Code Online (Sandbox Code Playgroud)
我不明白这个临时 sedwi 文件来自哪里。
您知道为什么我有这个临时文件以及如何传递它吗?
$(sed -i "s/$current_version/$version/" $PATHPROJET$CREATE_PACKAGE/Chart.yaml)
++ sed -i s/0.1.233/0.1.234/ ../project/cas-dp-ap/Chart.yaml
sed: couldn't open temporary file ../project/cas-dp-ap/sedwi3jVw: Permission denied
+ printf 'The version has been updated to : 0.1.234 \n\n \n\n'
The version has been updated to : 0.1.234
+ printf '***********************************'
Run Code Online (Sandbox Code Playgroud) 目前,我尝试在我的yaml文件中实现PersistentVolume。我在互联网上阅读了很多文档,但我不明白为什么当我转到仪表板窗格时收到此消息
找不到persistentvolumeclaim“ karaf-conf”
pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: karafpod
spec:
containers:
- name: karaf
image: xxx/karaf:ids-1.1.0
volumeMounts:
- name: karaf-conf-storage
mountPath: "/apps/karaf/etc"
volumes:
- name: karaf-conf-storage
persistentVolumeClaim:
claimName: karaf-conf-claim
Run Code Online (Sandbox Code Playgroud)
PersistentVolumeClaimKaraf.yml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: karaf-conf-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
Run Code Online (Sandbox Code Playgroud)
PersistentVolume.yaml
kind: PersistentVolume
apiVersion: v1
metadata:
name: karaf-conf
labels:
type: local
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/apps/karaf/etc"
Run Code Online (Sandbox Code Playgroud)
您会在下面找到命令kubectl get pv的结果
NAME CAPACITY ACCESS MODES RECLAIM POLICY …Run Code Online (Sandbox Code Playgroud) 当我运行我的 Pod 时,我得到 Pod (cas-de) is invalid spec :禁止的 Pod 更新可能不会更改spec.containers[*].image, spec.initContainers[*].image, spec.activeDeadlineSecondsor以外的字段 spec.tolerations(仅添加到现有的容忍度)
不过我在kubernetes网站上搜了下也没发现有什么不对的地方:(真不明白我的错在哪里)
volumeMounts在 Pod 中设置还是在 Deployment 中设置更好?
apiVersion: v1
kind: Pod
metadata:
name: cas-de
namespace: ds-svc
spec:
containers:
- name: ds-mg-cas
image: "docker-all.xxx.net/library/ds-mg-cas:latest"
imagePullPolicy: Always
ports:
- containerPort: 8443
- containerPort: 6402
env:
- name: JAVA_APP_CONFIGS
value: "/apps/ds-cas/configs"
- name: JAVA_EXTRA_PARAMS
value: "-Djava.security.auth.login.config=./config/jaas.config -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6402"
volumeMounts:
- name: ds-cas-config
mountPath: "/apps/ds-cas/context"
volumes:
- name: ds-cas-config
hostPath:
path: "/apps/ds-cas/context"
Run Code Online (Sandbox Code Playgroud) 我需要将我的掌舵 ( /usr/local/bin/helm)移动到另一台服务器,但我无法弄清楚如何掌舵连接到远程分蘖或远程 Kubernetes 服务器。
Helm 在服务器 B (k8s) 上本地运行。我希望它运行服务器 A,以便能够连接到服务器 B 以执行 YAML 文件。
我尝试部署容器,但不幸的是,当我尝试执行kubectl apply -f *.yaml时出现错误
错误是:
验证数据时出错:ValidationError(Pod.spec.containers[1]): io.k8s.api.core.v1.Container 中的未知字段“persistentVolumeClaim”;
我不明白为什么我收到错误,因为我 在我的 pd.yaml 配置中写了ClaimName: under permanentVolumeClaim: :(
Pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: karafpod
spec:
containers:
- name: karaf
image: xxx/karaf:ids-1.1.0
volumeMounts:
- name: karaf-conf-storage
mountPath: /apps/karaf/etc
- name: karaf-conf-storage
persistentVolumeClaim:
claimName: karaf-conf-claim
Run Code Online (Sandbox Code Playgroud)
持久卷声明Karaf.yml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: karaf-conf-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
Run Code Online (Sandbox Code Playgroud)
部署.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: karaf
namespace: poc
spec:
replicas: 1
template:
metadata:
labels:
app: karaf
spec:
containers: …Run Code Online (Sandbox Code Playgroud) 我想知道您如何使用 Helm 管理您的服务?
我已经知道我们将拥有超过200 个微服务。如何轻松管理它们?
每个微服务都有自己的 yaml 文件(部署、服务、入口、值等)或所有微服务的几个大型(部署、入口等)yaml 文件,并且我使用特定参数推送值 yaml 文件应用。
我找了一个bash脚本,可以备份所有的kubernetes在YAML格式或JSON它的好太:)我已经备份kubernetes conf文件了。
/etc/kubernetes
/etc/systemd/system/system/kubelet.service.d
Run Code Online (Sandbox Code Playgroud)
等等...
现在我只是想保存
命名空间
部署
等等...