我下载了在后台作为守护进程执行的centos基础镜像,然后累了进不了终端,进不去。
我的主机是 Ubuntu 16.04。
以下是我执行的步骤:
主机操作系统版本 Ubuntu16.04
root@jim-Ubuntu1504:/home/jim/web# lsb_release -a No LSB modules are
available. Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS
Release: 16.04 Codename: xenial
root@jim-Ubuntu1504:/home/jim/web#
Run Code Online (Sandbox Code Playgroud)
通过以下命令启动docker
root@jim-Ubuntu1504:/home/jim/web# docker run -d --name=my_centos centos
Unable to find image 'centos:latest' locally
latest: Pulling from library/centos
a3ed95caeb02: Pull complete
da71393503ec: Pull complete
Digest: sha256:1a62cd7c773dd5c6cf08e2e28596f6fcc99bd97e38c9b324163e0da90ed27562
Status: Downloaded newer image for centos:latest
63f4b8fce1bd44253bb420436da3ad5b8f532b253fc9e74ff52ad1b2f9844251
root@jim-Ubuntu1504:/home/jim/web# docker exec -i -t my_centos bash
Error response from daemon: Container 63f4b8fce1bd44253bb420436da3ad5b8f532b253fc9e74ff52ad1b2f9844251 is not running
Run Code Online (Sandbox Code Playgroud)
不知道为什么要退出
root@jim-Ubuntu1504:/home/jim/web# docker ps -a …Run Code Online (Sandbox Code Playgroud) 朋友们,
我现在厌倦了 Azure DevOps/VSTS。Jenkins 要好得多,现在仍然如此,只是我的组织想要使用 Azure DevOps。
我有一个谜团需要帮助来解开。
以下是我的笔记本电脑中的存储库,它没有未跟踪或未提交的更改。
git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
git remote -v
origin https://github.com/xxx/terraformvsts.git (fetch)
origin https://github.com/xxx/terraformvsts.git (push)
Run Code Online (Sandbox Code Playgroud)
你猜怎么着,Azure Devops 在每次构建执行时总是抱怨它有“DETACHED HEAD”。
请注意“结帐”阶段的以下内容:
2019-02-05T05:55:33.2076875Z Note: checking out 'aad90fceecf39a7731c356ebfe2b547ddbce99e6'.
2019-02-05T05:55:33.2076992Z
2019-02-05T05:55:33.2077872Z You are in 'detached HEAD' state. You can look around, make experimental
2019-02-05T05:55:33.2077939Z changes and commit them, and you can discard any commits you make in this
2019-02-05T05:55:33.2078179Z state without impacting …Run Code Online (Sandbox Code Playgroud) I have done exploration and I want to stick customized module concept rather than to use the Azure public registry of modules.
Source code location is here
https://github.com/ameyaagashe/help_me_cross_2
Run Code Online (Sandbox Code Playgroud)
I run terraform on command line with below arguments:
terraform plan -var "resource_group_name=nxt-grp-prd-manage-rgp-au-se" -var "virtual_network_name=virtual_network_1" -var "sql_subnet_name=subnet_1" -var "app_subnet_name=subnet_2" -var "application_nsg=test_nsg" -var "count_vm=2" -var "sql_host_basename=sqlvms" -var "app_host_basename=appvms" -var "storage_account_suffix=sta" -var "virtual_machine_size=Standard_B1ms" -var "virtual_machine_image_publisher=MicrosoftWindowsServer" -var "virtual_machine_image_offer=WindowsServer" -var "virtual_machine_image_sku=2012-R2-Datacenter" -var "virtual_machine_image_version=latest" -var "username=devopsadmin" -var "password=Angular12#$%"
Run Code Online (Sandbox Code Playgroud)
However, I am getting errors like below:
Error: Reference …Run Code Online (Sandbox Code Playgroud) azure-virtual-machine azure-virtual-network azure-security terraform-provider-azure
我在一个组织 ABC 中,它有三个 Azure DevOps 项目,即 A、B 和 C。一切都在 Azure Repos 下,这意味着我们没有使用 GitHub。
我正在尝试在项目 C 中签出项目 A 和 B 的存储库。每个项目都将拥有自己的微服务,但共享平台服务将自动执行需要部署到 AKS 中的内容。
问题陈述:当我尝试从项目 C 中的项目 A 和 B 中签出存储库时,出现如下错误。片段如下:
resources:
repositories:
- repository: microservice-a
type: git
name: 'InPlaceCommunications/microservice-a'
ref: master
- repository: microservice-b
type: git
name: 'Project B/microservice-b'
ref: master
Run Code Online (Sandbox Code Playgroud)
但是,我收到如下错误:
remote: TF401019: The Git repository with name or identifier microservice-a does not exist or you do not have permissions for the operation you are attempting.
Run Code Online (Sandbox Code Playgroud)
任何指导将不胜感激。
我确实注意到,我拥有自己克隆存储库的完全权限,但这并没有发生在管道上。
看来我的 .gitignore 不符合预期。
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .gitignore
new file: win_2016_datacentre_vm/.terraform/plugins/linux_amd64/lock.json
new file: win_2016_datacentre_vm/.terraform/plugins/linux_amd64/terraform-provider-azurerm_v1.16.0_x4
new file: win_2016_datacentre_vm/aos-1.tfvars
new file: win_2016_datacentre_vm/aos-1.v1/.terraform/plugins/linux_amd64/lock.json
new file: win_2016_datacentre_vm/aos-1.v1/.terraform/plugins/linux_amd64/terraform-provider-azurerm_v1.16.0_x4
new file: win_2016_datacentre_vm/aos-1.v1/aos-1.plan
new file: win_2016_datacentre_vm/aos-1.v1/aos-1.tf
new file: win_2016_datacentre_vm/aos-1.v1/aos-1.tfvars
new file: win_2016_datacentre_vm/aos-1.v1/terraform.tfstate
new file: win_2016_datacentre_vm/aos-1.v1/terraform.tfstate.backup
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in …Run Code Online (Sandbox Code Playgroud) 我有一个 ServiceAccount YAML 文件,我将它应用到一个新集群。
我的 YAML 如下所示:
apiVersion: v1
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: 2019-03-20T23:17:42Z
name: default
namespace: dev4
resourceVersion: "80999"
selfLink: /api/v1/namespaces/dev4/serviceaccounts/default
uid: 5c6e0d09-4b66-11e9-b4e3-0a779a87bb40
secrets:
- name: default-token-tl4dd
- apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"ServiceAccount","metadata":{"annotations":{},"name":"pod-labeler","namespace":"dev4"}}
creationTimestamp: 2020-04-21T05:46:25Z
name: pod-labeler
namespace: dev4
resourceVersion: "113455688"
selfLink: /api/v1/namespaces/dev4/serviceaccounts/pod-labeler
uid: 702dadda-8393-11ea-abd9-0a768ca51346
secrets:
- name: pod-labeler-token-6vgp7
kind: List
metadata:
resourceVersion: ""
selfLink: ""
Run Code Online (Sandbox Code Playgroud)
当我申请 1.16 版的新 EKS 集群时,通过命令kubectl apply -f <yaml file>
我收到如下错误:
Warning: kubectl apply should …Run Code Online (Sandbox Code Playgroud) 我有一个模块定义如下:
===
提供商.tf
provider "kubernetes" {
#load_config_file = "false"
host = azurerm_kubernetes_cluster.aks.kube_config.0.host
username = azurerm_kubernetes_cluster.aks.kube_config.0.username
password = azurerm_kubernetes_cluster.aks.kube_config.0.password
client_certificate = base64decode(azurerm_kubernetes_cluster.aks.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.aks.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.aks.kube_config.0.cluster_ca_certificate)
}
Run Code Online (Sandbox Code Playgroud)
输出.tf
output "node_resource_group" {
value = azurerm_kubernetes_cluster.aks.node_resource_group
description = "The name of resource group where the AKS Nodes are created"
}
output "kubeConfig" {
value = azurerm_kubernetes_cluster.aks.kube_config_raw
description = "Kubeconfig of AKS Cluster"
}
output "host" {
value = azurerm_kubernetes_cluster.aks.kube_config.0.host
}
output "client_key" {
value = azurerm_kubernetes_cluster.aks.kube_config.0.client_key
}
output "client_certificate" …Run Code Online (Sandbox Code Playgroud) 我创建了一个 bash 脚本,因为我想通过 Jenkins 作业启动和停止虚拟机。脚本内容如下
set -x
applicationId = "xxxxxxxxxxxxxxxx"
tenantID="xxxxxxxxxxxxxxxxx"
password = "jenkins"
az login --service-principal --username "${applicationId}" --password "{$password}" --tenant "{tenantID}"
export resource_group=rg_networking
# declare an array variable
declare -a host_list=("<Array of Host Space sepperated>")
## now loop through the above array
for i in "${host_list[@]}"
do
echo "Stopping Virtual Machine $i"
az vm stop --name "${i}" --resource-group "${resource_group}"
done
exit 0
Run Code Online (Sandbox Code Playgroud)
运行 Jenkins 作业时收到的错误消息如下:
Get Token request returned http error: 400 and server response: {"error":"invalid_request","error_description":"AADSTS90002: Requested …Run Code Online (Sandbox Code Playgroud) azure-devops ×2
git ×2
kubernetes ×2
amazon-eks ×1
azure-aks ×1
azure-cli ×1
bash ×1
docker ×1
github ×1
syntax ×1
terraform ×1