当前位置:网站首页>KubeVirt CICD Tekton (2) - task run:datavolume & ssh-key
KubeVirt CICD Tekton (2) - task run:datavolume & ssh-key
2022-06-09 20:41:00 【Backend cloud】
establish DataVolume
[[email protected] ~]$ kubectl get DataVolume
error: the server doesn't have a resource type "DataVolume"
# No installation Containerized Data Importer, First deployment CDI.
[[email protected] ~]$ echo $VERSION
v1.49.0
[[email protected] ~]$ kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-operator.yaml
namespace/cdi created
customresourcedefinition.apiextensions.k8s.io/cdis.cdi.kubevirt.io created
clusterrole.rbac.authorization.k8s.io/cdi-operator-cluster created
clusterrolebinding.rbac.authorization.k8s.io/cdi-operator created
serviceaccount/cdi-operator created
role.rbac.authorization.k8s.io/cdi-operator created
rolebinding.rbac.authorization.k8s.io/cdi-operator createde
deployment.apps/cdi-operator created
configmap/cdi-operator-leader-election-helper created
[[email protected] ~]$ kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-cr.yaml
cdi.cdi.kubevirt.io/cdi created
[[email protected] ~]$ kubectl get DataVolume
No resources found in default namespace.
[[email protected] taskruns]$ kubectl get pod -ncdi
NAME READY STATUS RESTARTS AGE
cdi-apiserver-67b544479b-frkpl 1/1 Running 0 81s
cdi-deployment-d9bfbdd55-bpcs5 1/1 Running 0 94s
cdi-operator-6c789c4bc5-6pxng 1/1 Running 0 2m9s
cdi-uploadproxy-b6d5657fd-5t8c5 1/1 Running 0 90s
[[email protected] taskruns]$ cat create-dv-from-manifest-taskrun.yaml
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: create-dv-from-manifest-taskrun
spec:
serviceAccountName: create-datavolume-from-manifest-task
taskRef:
kind: ClusterTask
name: create-datavolume-from-manifest
params:
- name: waitForSuccess
value: 'true'
- name: manifest
value: |
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
generateName: example-dv-
spec:
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
volumeMode: Filesystem
source:
blank: {}[[email protected] taskruns]$ kubectl create -f create-dv-from-manifest-taskrun.yaml
taskrun.tekton.dev/create-dv-from-manifest-taskrun createdlanguage-bash Copy code waitForSuccess = true, signify container Need to wait DataVolume Ready To set the status to Completed.
[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
create-dv-from-manifest-taskrun-pod 1/1 Running 0 72s[[email protected] taskruns]$ kubectl logs create-dv-from-manifest-taskrun-pod
Created example-dv-67t4j Datavolume in default namespace.
Waiting for Ready condition.
datavolume.cdi.kubevirt.io/example-dv-67t4j condition met[[email protected] taskruns]$ kubectl get dv
NAME PHASE PROGRESS RESTARTS AGE
example-dv-67t4j Succeeded 100.0% 3m14s[[email protected] taskruns]$ kubectl get pvNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvc-268ecfec-1706-4fea-9ef8-9dde3b466d80 100Mi RWO Delete Bound default/example-dv-67t4j standard 17s[[email protected] taskruns]$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
example-dv-67t4j Bound pvc-268ecfec-1706-4fea-9ef8-9dde3b466d80 100Mi RWO standard 22s[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
create-dv-from-manifest-taskrun-pod 0/1 Completed 0 2m39s[[email protected] taskruns]$ kubectl get dv example-dv-67t4j -o yaml
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
creationTimestamp: "2022-06-02T02:05:38Z"
generateName: example-dv-
generation: 7
name: example-dv-67t4j
namespace: default
resourceVersion: "37955"
uid: b6f97382-3936-4d7c-b3b3-0c3028624a9e
spec:
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
volumeMode: Filesystem source:
blank: {}status:
claimName: example-dv-67t4j
conditions:
- lastHeartbeatTime: "2022-06-02T02:05:40Z"
lastTransitionTime: "2022-06-02T02:05:40Z"
message: PVC example-dv-67t4j Bound
reason: Bound
status: "True"
type: Bound
- lastHeartbeatTime: "2022-06-02T02:05:47Z"
lastTransitionTime: "2022-06-02T02:05:47Z"
status: "True"
type: Ready
- lastHeartbeatTime: "2022-06-02T02:05:45Z"
lastTransitionTime: "2022-06-02T02:05:45Z"
message: Import Complete
reason: Completed
status: "False"
type: Running
phase: Succeeded
progress: 100.0%[[email protected] taskruns]$language-bash Copy code generate ssh key
[[email protected] taskruns]$ cat generate-ssh-keys-simple-taskrun.yaml
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: generate-ssh-keys-simple-taskrun
spec:
serviceAccountName: generate-ssh-keys-task
taskRef:
kind: ClusterTask
name: generate-ssh-keys
params: [][[email protected] taskruns]$ kubectl apply -f generate-ssh-keys-simple-taskrun.yaml
taskrun.tekton.dev/generate-ssh-keys-simple-taskrun created[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
generate-ssh-keys-simple-taskrun-pod 0/1 Init:0/2 0 2s[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
generate-ssh-keys-simple-taskrun-pod 0/1 PodInitializing 0 6s[[email protected] taskruns]$ kubectl describe pod generate-ssh-keys-simple-taskrun-pod
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 8h default-scheduler Successfully assigned default/generate-ssh-keys-simple-taskrun-pod to minikube
Normal Pulled 8h kubelet Container image "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/entrypoint:[email protected]:4fc8631a27bdd1b4c149a08b7db0465a706559ccddd979d0b9dbc93ef676105d" already present on machine
Normal Created 8h kubelet Created container place-tools
Normal Started 8h kubelet Started container place-tools
Normal Pulled 8h kubelet Container image "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/entrypoint:[email protected]:4fc8631a27bdd1b4c149a08b7db0465a706559ccddd979d0b9dbc93ef676105d" already present on machine
Normal Created 8h kubelet Created container step-init
Normal Started 8h kubelet Started container step-init
Normal Pulling 8h kubelet Pulling image "quay.io/kubevirt/tekton-task-generate-ssh-keys:v0.9.2"
Normal Pulled 8h kubelet Successfully pulled image "quay.io/kubevirt/tekton-task-generate-ssh-keys:v0.9.2" in 25.144859196s
Normal Created 8h kubelet Created container step-generate-ssh-keys
Normal Started 8h kubelet Started container step-generate-ssh-keys[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
generate-ssh-keys-simple-taskrun-pod 0/1 Completed 0 37s[[email protected] taskruns]$ kubectl logs generate-ssh-keys-simple-taskrun-pod
Generating public/private rsa key pair.
Your identification has been saved in /tmp/sshkey-2709323324/id_rsa.
Your public key has been saved in /tmp/sshkey-2709323324/id_rsa.pub.
The key fingerprint is:
SHA256:0iOp+jpw1k/C0XC6HloxerAG9NuG3miZ/Ex7K6db7/M [email protected]
The key's randomart image is:
+---[RSA 4096]----+
| |
| . . . |
|. . = |
|. ..= .o |
| . *+=+ S |
|. *oO+.o . |
| =o=B* . |
| oO+o+o.. |
| ++o**.oooE |
+----[SHA256]-----+
[[email protected] taskruns]$ kubectl get secret
NAME TYPE DATA AGE
cleanup-vm-task-token-m7lzb kubernetes.io/service-account-token 3 17h
create-datavolume-from-manifest-task-token-6m89v kubernetes.io/service-account-token 3 17h
create-vm-from-manifest-task-token-g84vz kubernetes.io/service-account-token 3 17h
default-token-xfdcb kubernetes.io/service-account-token 3 18h
execute-in-vm-task-token-4vfgw kubernetes.io/service-account-token 3 17h
generate-ssh-keys-task-token-bb5n4 kubernetes.io/service-account-token 3 17h
private-key-kpmzz kubernetes.io/ssh-auth 1 2m3s
private-key-phd6j kubernetes.io/ssh-auth 1 24s
private-key-rgn2s kubernetes.io/ssh-auth 1 13m
public-key-g2dpg Opaque 1 24s
wait-for-vmi-status-task-token-mzdpw kubernetes.io/service-account-token 3 17h
[[email protected] taskruns]$ kubectl get secret public-key-g2dpg -o yaml
apiVersion: v1
data:
id-rsa-bbmlc.pub: c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFDQVFDdkFIN1dnNjhpTnp2M0dnRXZMMW15VU1LLzRMNEZKdWhjR3lHS3IzREV5V2Vaa3BlanJRVGFBQVlRTmRRM2RnSjR2YVIwS1Y5NW10blNPSWNQeUYzcWlBZitjTjM5eHdqMGw2eEpQQW04dk5pTCtPcS9XWnRQUllEaHRIeFNYbUdIdFhiSFV3cS9pWkxkUEIySVhuL1JUendud2NURW0vWmI0c0pGOEhxclRXa1RyQlJFcWpTVmtabE1aUWNOVVZpQXZ2THVpcGIyWURtOGluRStvYnF6SXVRdEVZb25JVHdRV292ZHUzeTZEY0NIdmdsV2htUm5LVlorOEk3d0pEeHNJcGZ3VCsxVERiN25jQUI0VDBnNWQxd2ZCOWFpZEFwNktlZ295UWh3cUY3RWVrMWJPTCtaWXJUS2lYeUdJZFRISHlhWmN4REVacWN1SUI0MjBrRS9ibEIzTGpZYTBrS3BDVVBvQ2VNYjV2UmgvZFNkUDNRRGxmUEZpamlTQW1Lb01hWk04TzNVMGVKNFN6aGtVZGdkaXF6NVE5T0VWaFVVY3RSZ1EzNTFXelFnbXFVRTVXd0U2dTZ6SjZRNUlURytjL3hXZUg4Z2xqc3Q2d3lCU0tlYWhXbVpOTytZUDl4OVhHOTl2NnRTdW9UeVk3bC9OSzBFWFYxM3lraTBneUtVQmg4aW9EekxPbFRoczdmcGFLMkozYlliYSszdmNwUHUrSTJvZEwvVmFGamtCQUlCS2VVSkF0alNoNlpLODNwQlh0TVZqOUttaDRJU252R0hNc0M0dmhTMVpFZHNGbEI3Mi8zVW54V1gwV3FLeTdxbDBmY3dzdExNTHh2dHhHdG4xUWdWb2YzL01wQmpxazRSdzlPU3hSekZZNTI1eFcrNXNwb0ZUbGJLOXc9PSBkZWZhdWx0QGdlbmVyYXRlZAo=
kind: Secret
metadata:
creationTimestamp: "2022-06-02T01:36:07Z"
generateName: public-key-
name: public-key-g2dpg
namespace: default
resourceVersion: "29728"
uid: 4b75065c-a57a-470c-9b14-fa017e52e337
type: Opaque
# Execute another taskrun
[[email protected] taskruns]$ cat generate-ssh-keys-advanced-taskrun.yaml
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: generate-ssh-keys-advanced-taskrun
spec:
serviceAccountName: generate-ssh-keys-task
taskRef:
kind: ClusterTask
name: generate-ssh-keys
params:
- name: publicKeySecretName
value: my-client-public-secret
- name: privateKeySecretName
value: my-client-private-secret
- name: privateKeyConnectionOptions
value:
- 'user:root'
- 'disable-strict-host-key-checking:true'
- 'additional-ssh-options:-p 8022'
- name: additionalSSHKeygenOptions
value: '-t rsa-sha2-512 -b 4096'[[email protected] taskruns]$ kubectl apply -f generate-ssh-keys-advanced-taskrun.yaml
taskrun.tekton.dev/generate-ssh-keys-advanced-taskrun created[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
generate-ssh-keys-advanced-taskrun-pod 0/1 Init:1/2 0 3s[[email protected] taskruns]$ kubectl get pod
NAME READY STATUS RESTARTS AGE
generate-ssh-keys-advanced-taskrun-pod 0/1 Completed 0 7s[[email protected] taskruns]$ kubectl get secret
NAME TYPE DATA AGE
cleanup-vm-task-token-m7lzb kubernetes.io/service-account-token 3 17h
create-datavolume-from-manifest-task-token-6m89v kubernetes.io/service-account-token 3 17h
create-vm-from-manifest-task-token-g84vz kubernetes.io/service-account-token 3 17h
default-token-xfdcb kubernetes.io/service-account-token 3 18h
execute-in-vm-task-token-4vfgw kubernetes.io/service-account-token 3 17h
generate-ssh-keys-task-token-bb5n4 kubernetes.io/service-account-token 3 17h
my-client-private-secret kubernetes.io/ssh-auth 4 5s
my-client-public-secret Opaque 1 5s
private-key-kpmzz kubernetes.io/ssh-auth 1 5m22s
private-key-phd6j kubernetes.io/ssh-auth 1 3m43s
private-key-rgn2s kubernetes.io/ssh-auth 1 16m
public-key-g2dpg Opaque 1 3m43s
wait-for-vmi-status-task-token-mzdpw kubernetes.io/service-account-token 3 17h[[email protected] taskruns]$ kubectl get secret my-client-public-secret -o yaml
apiVersion: v1
data:
id-rsa-69hcj.pub: c3NoLXJzYSBBQUFB< Omit >YXRlZAo=kind: Secret
metadata:
creationTimestamp: "2022-06-02T01:39:45Z"
name: my-client-public-secret
namespace: default
resourceVersion: "30747"
uid: 9b01e460-f6ba-420f-b4e7-8cf0aa077f61
type: Opaque[[email protected] taskruns]$ kubectl get secret my-client-private-secret -o yaml
apiVersion: v1
data:
additional-ssh-options: LXAgODAyMg==
disable-strict-host-key-checking: dHJ1ZQ==
ssh-privatekey: LS0tLS1CRUdJTiBPUEV< Omit >TBRR2RsYm1WeVlYUmxaQUVDQXc9PQotLS0tLUVORCBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K
user: cm9vdA==kind: Secret
metadata:
creationTimestamp: "2022-06-02T01:39:45Z"
name: my-client-private-secret
namespace: default
resourceVersion: "30748"
uid: 76698051-5fe3-452c-9a34-1de28259e0f3
type: kubernetes.io/ssh-authlanguage-bash Copy code 边栏推荐
- HMI 串口屏 SD卡/TF卡升级的 bug
- C # on the application of polymorphism
- C interface class learning
- The processor of this virtual machine supports different functions than the processor of the virtual machine that holds the state of the virtual machine
- C#中运算符重载的例子
- Examples of operator overloading in C #
- C#中委托与事件之间的一些应用
- pyQt QWidget禁止非当前窗口的操作
- CVPR2022 Oral | 用于实时地图视图语义分割的跨视图Transformer
- c#逆序排序
猜你喜欢

Bug in upgrading SD card / TF card of HMI serial interface screen

HMI 联机下载失败的问题及解决方案
![[database data recovery] SQL Server database data recovery case](/img/82/99d3135b6f412a532444e80c2d7faa.jpg)
[database data recovery] SQL Server database data recovery case

Problems and solutions of HMI online download failure

Kalman filter (KF) unscented Kalman filter (UKF)

深夜小酌,50道经典SQL题,真香~
Who says redis can't save big keys

HMI 创建工程生成字库的一个潜在bug

The HMI Software memory is abnormal, resulting in a crash exit bug
![[tgowt] cmake to Ninja construction](/img/e9/8ce56c421ee98c0b36464fc65dd39d.png)
[tgowt] cmake to Ninja construction
随机推荐
C#关于多态的应用
每日一题——leecode59( 螺旋矩阵 II)
做副业赚钱,这几个热门自媒体平台收益超多
KubeVirt网络源码分析(2)
数据处理基本流程
Share 16 useful typescript and JS tips
KubeVirt CICD Tekton (2) - task run:datavolume & ssh-key
压缩文件报错 tar: Exiting with failure status due to previous errors
Jerry's map modification app_ config. Video of H_ Rec buffer mode and output frame rate [chapter]
内卷大厂系列《线段树-会议室问题》
华为云Stack首席架构师:打造“称手”的数字化工具,答好政企IT数字化转型这道必选题
目标分割之--Unet对多类别数据集的语义分割
moderlarts第二次培训笔记
Gamefi's new departure, aquanee will log in to gate and bitmart on June 9
Jerry's modification to improve the output frame rate of camera source video [chapter]
C#中default的关键词用法
Application of anonymous function in C #
C#中的匿名函数的应用
Jerry's Bluetooth distribution network [chapter]
SSL (secure socket layer) digital certificate