argo的输入输出--output和input输出目录或文件到下一步骤(4)
- UID
- 1066743
|
argo的输入输出--output和input输出目录或文件到下一步骤(4)
在配置文件中统一配置minio存储引擎
minio存储引擎是argo自带的存储引擎。可以很方便的安装。
使用minio之前需要先安装,步骤如下:
官网步骤参考:
Install an Artifact Repository
需要翻墙
brew install kubernetes-helm # mac
helm init
helm install stable/minio --name argo-artifacts --set service.type=LoadBalancer --set persistence.enabled=false
使用命令编辑配置文件如下:
kubectl edit configmap workflow-controller-configmap -n argo
增加内容如下:
data:
config: |
artifactRepository:
s3:
bucket: my-bucket
endpoint: argo-artifacts-minio.default:9000
insecure: true
# accessKeySecret and secretKeySecret are secret selectors.
# It references the k8s secret named 'argo-artifacts-minio'
# which was created during the minio helm install. The keys,
# 'accesskey' and 'secretkey', inside that secret are where the
# actual minio credentials are stored.
accessKeySecret:
name: argo-artifacts
key: accesskey
secretKeySecret:
name: argo-artifacts
key: secretkey
注意,这里的账号密码accessKeySecret和secretKeySecret的name和key都要根据自己的环境来设置。
而不是使用官网上的
AccessKey: AKIAIOSFODNN7EXAMPLE
SecretKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
获取步骤如下:
kubectl get secret
输出如下:
NAME TYPE DATA AGE
argo-artifacts Opaque 2 4h
default-token-2cvxb kubernetes.io/service-account-token 3 61d
#则argo-artifacts是我们需要的name
kubectl get secret/argo-artifacts -o wide
kubectl describe secret/argo-artifacts
输出
Name: argo-artifacts
Namespace: default
Labels: app=minio
chart=minio-1.9.1
heritage=Tiller
release=argo-artifacts
Annotations: <none>
Type: Opaque
Data
====
accesskey: 20 bytes
secretkey: 40 bytes
可以看到确实包含两个密钥文件。
但是要看到里面的密钥值比较麻烦,需要新建一个挂载这个secret的pod才能看到,步骤如下:
创建一个Pod通过卷访问秘密数据
下面是一个配置文件可以用来创建一个Pod:
vi secret-pod.yaml
输入内容如下:
apiVersion: v1
kind: Pod
metadata:
name: secret-test-pod
spec:
containers:
- name: test-container
image: nginx
volumeMounts:
# name must match the volume name below
- name: secret-volume
mountPath: /etc/secret-volume
# The secret data is exposed to Containers in the Pod through a Volume.
volumes:
- name: secret-volume
secret:
secretName: argo-artifacts |
|
|
|
|
|