OpenShift Container Platform 4.13 CI/CDsecret-example-pod spec: containers: - name: secret-test-container image: busybox command: [ "/bin/sh", "-c", "cat /etc/secret-volume/*" ] volumeMounts: # name must match the volume name secret-example-pod spec: containers: - name: secret-test-container image: busybox command: [ "/bin/sh", "-c", "export" ] env: - name: TEST_SECRET_USERNAME_ENV_VAR valueFrom: when the image is run RUN echo '#!/bin/sh' > /input_report.sh RUN echo '(test -f /secrets/secret1 && echo -n "secret1=" && cat /secrets/secret1)' >> /input_report.sh RUN echo '(test -f /config && echo -n0 码力 | 129 页 | 1.37 MB | 1 年前3
OpenShift Container Platform 4.4 构建(build)when the image is run RUN echo '#!/bin/sh' > /input_report.sh RUN echo '(test -f /secrets/secret1 && echo -n "secret1=" && cat /secrets/secret1)' >> /input_report.sh RUN echo '(test -f /config && echo -n -n "relative-configMap=" && cat /config)' >> /input_report.sh RUN chmod 755 /input_report.sh CMD ["/bin/sh", "-c", "/input_report.sh"] 注意 注意 用户通常应该从最终的应用程序镜像中移除输入 secret,以便从该镜像运行的容器中不会 存在这些 secret。但是,secret shell 命令: .s2i/bin/assemble 文件 文件 #!/bin/sh APP_VERSION=1.0 wget http://repository.example.com/app/app-$APP_VERSION.jar -O app.jar .s2i/bin/run 文件 文件 #!/bin/sh exec java -jar app.jar 对于 Docker 构建策略,您必须修改0 码力 | 101 页 | 1.12 MB | 1 年前3
OpenShift Container Platform 4.10 可伸缩性和性能+------------+--------------------+--------+ $ oc rsh -n openshift-etcd etcd-ip-10-0-159-225.example.redhat.com sh-4.4# unset ETCDCTL_ENDPOINTS OpenShift Container Platform 4.10 可伸 可伸缩 缩性和性能 性和性能 20 输 输出示例 出示例 Container Platform worker 订阅: sh-4.4# etcdctl --command-timeout=30s --endpoints=https://localhost:2379 defrag Finished defragmenting etcd member[https://localhost:2379] sh-4.4# etcdctl endpoint status ---+----------- +------------+--------------------+--------+ sh-4.4# etcdctl alarm list memberID:12345678912345678912 alarm:NOSPACE sh-4.4# etcdctl alarm disarm 第 第 1 章 章 推荐的主机 推荐的主机实 实践 践 21 在主控机上运行的0 码力 | 315 页 | 3.19 MB | 1 年前3
OpenShift Container Platform 4.2 镜像846ca524bf07c04a6f6c9e103a76 ContainerConfig: AttachStdout: true Cmd: - /bin/sh - -c 第 第 6 章 章 管理 管理镜 镜像流 像流 39 6.7. 使用镜像流 下面章节介绍如何使用镜像流和 imagestreamtag。 6.7.1. 获取有关镜像流的信息 Image Created: 2 weeks ago Author:Arch: amd64 Entrypoint: container-entrypoint Command: /bin/sh -c $STI_SCRIPTS_PATH/usage Working Dir: /opt/app-root/src User: 1001 Exposes Ports: 8080/tcp Docker Starting pod/ip-10-0-147-35ec2internal-debug ... To use host binaries, run `chroot /host` sh-4.2# chroot /host sh-4.2# cat /etc/containers/registries unqualified-search-registries = ["registry.access.redhat 0 码力 | 92 页 | 971.35 KB | 1 年前3
OpenShift Container Platform 4.9 节点secret-example-pod spec: containers: - name: secret-test-container image: busybox command: [ "/bin/sh", "-c", "cat /etc/secret-volume/*" ] volumeMounts: 1 - name: secret-volume secret-example-pod spec: containers: - name: secret-test-container image: busybox command: [ "/bin/sh", "-c", "export" ] env: - name: TEST_SECRET_USERNAME_ENV_VAR valueFrom: containers: - name: test-container image: gcr.io/google_containers/busybox command: [ "/bin/sh", "-c", "env" ] env: 1 - name: SPECIAL_LEVEL_KEY 2 valueFrom: configMapKeyRef:0 码力 | 374 页 | 3.80 MB | 1 年前3
OpenShift Container Platform 4.14 镜像# install the artifacts make install popd #!/bin/bash # run the application /opt/application/run.sh #!/bin/bash pushd ${HOME} if [ -d deps ]; then # all deps contents to tar stream tar cf - openshift.io/run-level 被 设置为 0 或 1。依赖于准入插件(如 pod 安全准入、安全性上下文约束、集群资源配额和 镜像引用解析)的功能无法在高特权项目中工作。 - /bin/sh - -c - tar -C /tmp -xf - && /usr/libexec/s2i/assemble Entrypoint: - container-entrypoint 命令添加指向其中一个现有标签的标签: 例如: 输出示例 出示例 确认镜像流有两个标签,3.5 指向外部容器镜像,latest 指向同一镜像,因为它基于第一个标签创 Command: /bin/sh -c $STI_SCRIPTS_PATH/usage Working Dir: /opt/app-root/src User: 1001 Exposes Ports: 8080/tcp Docker0 码力 | 118 页 | 1.13 MB | 1 年前3
OpenShift Container Platform 4.7 镜像# install the artifacts make install popd #!/bin/bash # run the application /opt/application/run.sh 第 第 4 章 章 创 创建 建镜 镜像 像 33 usage 脚本: 脚本: 其他资源 S2I 镜像创建教程 4.4. 关于测试 SOURCE-TO-IMAGE 镜像 作为 Source-to-Image 846ca524bf07c04a6f6c9e103a76 ContainerConfig: AttachStdout: true Cmd: - /bin/sh - -c - tar -C /tmp -xf - && /usr/libexec/s2i/assemble Entrypoint: - container-entrypoint Image Created: 2 weeks ago Author:Arch: amd64 Entrypoint: container-entrypoint Command: /bin/sh -c $STI_SCRIPTS_PATH/usage Working Dir: /opt/app-root/src User: 1001 Exposes Ports: 8080/tcp Docker 0 码力 | 123 页 | 1.20 MB | 1 年前3
OpenShift Container Platform 4.6 节点secret-example-pod spec: containers: - name: secret-test-container image: busybox command: [ "/bin/sh", "-c", "cat /etc/secret-volume/*" ] volumeMounts: 1 - name: secret-volume secret-example-pod spec: containers: - name: secret-test-container image: busybox command: [ "/bin/sh", "-c", "export" ] env: - name: TEST_SECRET_USERNAME_ENV_VAR valueFrom: containers: - name: test-container image: gcr.io/google_containers/busybox command: [ "/bin/sh", "-c", "env" ] env: 1 - name: SPECIAL_LEVEL_KEY 2 valueFrom: configMapKeyRef:0 码力 | 404 页 | 3.60 MB | 1 年前3
OpenShift Container Platform 4.10 CLI 工具clusterIP }' -- register_dns.sh # Observe changes to services filtered by a label selector oc observe namespaces -l regist-dns=true --template '{ .spec.clusterIP }' -- register_dns.sh # Partially update /var/lib/test-image.sh # Set the post-commit hook to execute a shell script oc set build-hook bc/mybuild --post-commit --script="/var/lib/test-image.sh param1 param2 && /var/lib/done.sh" # Clear the /var/lib/migrate-db.sh # Set a mid deployment hook along with additional environment variables oc set deployment-hook dc/myapp --mid --volumes=data -e VAR1=value1 -e VAR2=value2 -- /var/lib/prepare-deploy.sh #0 码力 | 120 页 | 1.04 MB | 1 年前3
OpenShift Container Platform 4.8 容器镜像仓库(Registry)$ oc debug nodes/sh-4.2# chroot /host sh-4.2# oc login -u kubeadmin -p https://api-int. . :6443 sh-4.2# podman login -u kubeadmin -p 送镜像。否则,下一步中的podman push将失败。为了进行测试,您可以创 建一个新项目来推送镜像。 c. 将新标记的镜像推送到 registry: Login Succeeded! sh-4.2# podman pull name.io/image sh-4.2# podman tag name.io/image image-registry.openshift-image- registry.svc:5000/openshift/image 流程 1. 使用带有 deployments 的oc logs命令查看容器镜像 registry 的日志: 输 输出示例 出示例 4.5. 访问REGISTRY的指标数据(METRICS) sh-4.2# podman push image-registry.openshift-image-registry.svc:5000/openshift/image $ oc get pods -n 0 码力 | 39 页 | 415.94 KB | 1 年前3
共 35 条
- 1
- 2
- 3
- 4













