如何从kubernetes节点删除所有内容?
内容包括部署,副本集等.我试图单独删除deplyoments.但kubrenetes再次重现了所有豆荚.
有没有办法删除节点中存在的所有副本集?
Forbidden!Configured service account doesn't have access. Service account may have been revoked. User "system:serviceaccount:default:default" cannot get services in the namespace "mycomp-services-process"
对于上述问题,我创建了"mycomp-service-process"命名空间并检查了问题.
但它再次显示这样的消息:
Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. User "system:serviceaccount:mycomp-services-process:default" cannot get services in the namespace "mycomp-services-process"
今天我在运行kubeadm join --token 189518.c21306e71082d6ec命令时用v1.7.1重新创建了我的集群,它给出了以下错误.这在以前版本的kubernetes中使用过.在这个版本中有什么变化,我们如何解决这个问题?
[root@k8s17-02 ~]# kubeadm join --token 189518.c21306e71082d6ec 192.168.15.91:6443
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Running pre-flight checks
[preflight] WARNING: hostname "" could not be reached
[preflight] WARNING: hostname "" lookup : no such host
[preflight] Some fatal errors occurred:
hostname "" a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex …Run Code Online (Sandbox Code Playgroud) 我们正尝试使用AWS Elastic Block Store(EBS)在AWS实例中配置kubernetes RC.这是我们的控制器yaml文件的关键部分 -
volumeMounts:
- mountPath: "/opt/phabricator/repo"
name: ebsvol
volumes:
-
name: ebsvol
awsElasticBlockStore:
volumeID: aws://us-west-2a/vol-*****
fsType: ext4
Run Code Online (Sandbox Code Playgroud)
我们的rc可以启动pod并且工作正常而不将其安装到AWS EBS,但是在AWS EBS中安装了卷,它给了我们 -
Fri, 11 Sep 2015 11:29:14 +0000 Fri, 11 Sep 2015 11:29:34 +0000 3 {kubelet 172.31.24.103} failedMount Unable to mount volumes for pod "phabricator-controller-zvg7z_default": error listing AWS instances: NoCredentialProviders: no valid providers in chain
Fri, 11 Sep 2015 11:29:14 +0000 Fri, 11 Sep 2015 11:29:34 +0000 3 {kubelet 172.31.24.103} failedSync Error syncing pod, skipping: error listing …Run Code Online (Sandbox Code Playgroud) 我有 mysql 5.7 容器拒绝访问 wordpress 容器的问题。我正在使用 docker-compose 并且我正在 Mac OSX 上运行 docker。Docker 应该是可用的最新版本。
这是我的 docker-compose.yml
version: '2'
services:
wordpress:
depends_on:
- db
image: wordpress:latest
container_name: wordpress
ports:
- "8000:80"
- "443:443"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_NAME: blog
WORDPRESS_DB_USER: blog_admin
WORDPRESS_DB_PASSWORD: userpasswd
networks:
- wordpress_net
db:
image: mysql:5.7
container_name: db
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpasswd
MYSQL_DATABASE: blog
MYSQL_USER: blog_admin
MYSQL_PASSWORD: userpasswd
networks:
- wordpress_net
networks:
wordpress_net:
volumes:
db_data:
Run Code Online (Sandbox Code Playgroud)
来自 db 容器的日志是:
2017-05-12T23:28:06.138429Z 321 [Note] …Run Code Online (Sandbox Code Playgroud) 作为概念证明,我们正在尝试使用牧场主的Kubernetes.目前,我们共有10台环境机器.
我需要评估在Rancher环境中如何设置Kubernetes API.在K8S仪表板上,只有服务"kubernetes"在端口443上的"默认"命名空间中运行.
我想知道Rancher如何使用哪些容器来运行API?在标签orchestration = true(master-master,master-slave)的主机上使用什么HA模型?API通信流程?外部用户可以从中获得什么?
将不胜感激任何类型的提示,链接和文档.
我在使用 Elasticsearch 6.0 时遇到了一个奇怪的问题。
\n\n我有一个具有以下映射的索引:
\n\n{\n "cities": {\n "mappings": {\n "cities": {\n "properties": {\n "city": {\n "properties": {\n "id": {\n "type": "long"\n },\n "name": {\n "properties": {\n "en": {\n "type": "text",\n "fields": {\n "keyword": {\n "type": "keyword",\n "ignore_above": 256\n }\n }\n },\n "it": {\n "type": "text",\n "fields": {\n "keyword": {\n "type": "keyword",\n "ignore_above": 256\n }\n }\n }\n }\n },\n "slug": {\n "properties": {\n "en": {\n "type": "text",\n "fields": {\n "keyword": {\n "type": "keyword",\n "ignore_above": 256\n }\n }\n },\n …Run Code Online (Sandbox Code Playgroud) 我试图在AWS Codebuild构建期间将一些环境变量设置为构建步骤的一部分。尚未设置变量,以下是一些日志:
[Container] 2018/06/05 17:54:16 Running command export TRAVIS_BRANCH=master
[Container] 2018/06/05 17:54:16 Running command export TRAVIS_COMMIT=$(git rev-parse HEAD)
[Container] 2018/06/05 17:54:17 Running command echo $TRAVIS_COMMIT
[Container] 2018/06/05 17:54:17 Running command echo $TRAVIS_BRANCH
[Container] 2018/06/05 17:54:17 Running command TRAVIS_COMMIT=$(git rev-parse HEAD)
[Container] 2018/06/05 17:54:17 Running command echo $TRAVIS_COMMIT
[Container] 2018/06/05 17:54:17 Running command exit
[Container] 2018/06/05 17:54:17 Running command echo Installing semantic-release...
Installing semantic-release...
Run Code Online (Sandbox Code Playgroud)
因此,您会注意到,无论我如何设置变量,当我回显它时,它总是空的。
以上是使用此buildspec制作的
version: 0.1
# REQUIRED ENVIRONMENT VARIABLES
# AWS_KEY - AWS Access Key ID
# AWS_SEC …Run Code Online (Sandbox Code Playgroud) 我在docker-compose.yml上构建了这个图像
version: '2'
services:
webserver:
build: ./docker/webserver
image: image_name
ports:
- "80:80"
- "443:443"
volumes:
- /Users/user_name/Sites/site:/var/www/html
Run Code Online (Sandbox Code Playgroud)
并在Dockerfile上有这个命令
FROM php:7-apache
RUN apt-get update -y && apt-get install -y libpng-dev && apt-get
install -y libcurl4-openssl-dev
RUN docker-php-ext-install pdo pdo_mysql gd curl
RUN a2enmod rewrite
RUN service apache2 restart
Run Code Online (Sandbox Code Playgroud)
但是我明白了
Forbidden
You don't have permission to access / on this server.
Apache/2.4.10 (Debian) Server at localhost Port 80
Run Code Online (Sandbox Code Playgroud)
当我去localhost.
我和Mac合作.我已经将docker文件用于其他项目,并且都运行良好.我错过了什么?
记录响应
无法提供目录/ var/www/html /:找不到匹配的DirectoryIndex(index.php,index.html),以及Options指令禁止的服务器生成的目录索引
我对kube-dns有一个奇怪的错误.
环境:使用kops在AWS上部署的单个主服务器和几个节点的集群.Kubernetes版本1.8.4.
问题是我的pod中的DNS名称解析(集群内部或外部名称)都很脆弱.经过故障排除后我才明白,只有当pod安装在特定节点上时才会出现问题,该节点是运行kube-dns pod的其中一个副本的节点.
这些是我的kube-dns pods:
$ kubectl -n kube-system get po -l k8s-app=kube-dns -o wide
NAME READY STATUS RESTARTS AGE IP NODE
kube-dns-7f56f9f8c7-2ztbn 3/3 Running 0 2d 100.96.8.239 node01
kube-dns-7f56f9f8c7-h5w29 3/3 Running 0 17d 100.96.7.114 node02
Run Code Online (Sandbox Code Playgroud)
如果我运行测试POD强制它运行node02一切似乎很好.我可以解决任何(有效的)DNS名称,完全没有问题.
如果我在node01名称解析上运行相同的测试POD 是片状的:有时它会失败(大约50%的时间),并出现以下错误
$ dig google.com
;; reply from unexpected source: 100.96.8.239#53, expected 100.64.0.10#53
Run Code Online (Sandbox Code Playgroud)
其余的时间它完美无缺:
$ dig google.com
; <<>> DiG 9.10.4-P3 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24454 …Run Code Online (Sandbox Code Playgroud) #!/usr/bin/env bash
DOCUMENT_ROOT=/var/www/html/
rm index.php
cd modules/mymodules/
perl -p -i -e 's/x.xx.xx.y/dd.dd.ddd.dd/g' `grep -ril y.yy.yy.y *`
Run Code Online (Sandbox Code Playgroud)
显示 显示警告
-i used with no filenames on the command line, reading from STDIN.
Run Code Online (Sandbox Code Playgroud)
它阻止运行其余脚本。
有什么解决办法吗?
其实我需要跑步
perl -p -i -e 's/x.xx.xx.y/dd.dd.ddd.dd/g' `grep -ril y.yy.yy.y *`
Inside a shell script
Run Code Online (Sandbox Code Playgroud)
我正在使用 ubuntu 和 docker。
使用 kubectl 时找不到状态 jsonpath。pod json 有一个状态字段,但它是一个数组。
kubectl get pods --column=Status:.status[*]
Run Code Online (Sandbox Code Playgroud)
数组中有多个元素,如何选择一个来反映真实 Pod 状态?
kubernetes ×7
docker ×4
bash ×2
amazon-ec2 ×1
apache ×1
api ×1
completion ×1
containers ×1
jsonpath ×1
kube-dns ×1
kubeadm ×1
kubectl ×1
linux ×1
mysql ×1
perl ×1
rancher ×1
replication ×1
server ×1
shell ×1
ubuntu-14.04 ×1
wordpress ×1