k8s配置拉取镜像密钥
2024-09-08 18:30:22
一、部署步骤
二、创建阿里云镜像仓库
1、进入阿里云容器镜像服务,创建个人版实例
2、设置登录密码后完成镜像仓库创建
三、创建Secret绑定镜像仓库账号
[root@localhost ~]# kubectl create secret docker-registry dockerhub --docker-server=registry.cn-hangzhou.aliyuncs.com --docker-username=XXX --docker-password=XXX --namespace=XXX
四、创建Deployment绑定Secret
[root@master ~]# cat >> /root/deployment.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: hello-world
spec:
imagePullSecrets:
- name: dockerhub
containers:
- name: hello-world
image: registry.cn-hangzhou.aliyuncs.com/test/hello-world:1d4ac56c-1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3003
name: http
protocol: TCP
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 3003
scheme: HTTP
initialDelaySeconds: 120
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 3003
scheme: HTTP
initialDelaySeconds: 120
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
memory: 1Gi
requests:
memory: 1Gi
EOF
最新文章
- 逻辑回归 Logistic Regression
- CentOS7 Tomcat 环境部署
- iOS内支付
- 利用Oracle自带的impdp和expdp进行简单备份
- java 枚举类型知识点记录
- 简短总结一下C#里跨线程更新UI(转)
- 二. Socket用法
- 在VC中集成cURL
- 《C专家编程》之一
- Spark技术内幕:Stage划分及提交源代码分析
- python学习 day13 装饰器(一)&;推导式
- EF Core 小坑:DbContextPool 会引起数据库连接池连接耗尽
- Spring boot 配置https 实现java通过https接口访问
- 发布WebApi项目时,提示未包含bin\yourDocumentationFile.xml文档文件
- MongoDB pymongo模块
- 添加网络ADB的方法(含以太网和无线)
- gamit安装
- nginx.conf 配置详解
- 每月IT摘录201807
- PostgreSQL 区域设置