当前位置: 首页 > news >正文

做网站怎么买服务器南通seo网站优化软件

做网站怎么买服务器,南通seo网站优化软件,做婚恋网站要多少钱,好看的页面Secret Secret的介绍Secret的使用通过环境变量引入Secret通过volume挂载Secret Secret的介绍 Secret是一种保护敏感数据的资源对象。例如:密码、token、秘钥等,而不需要把这些敏感数据暴露到镜像或者Pod Spec中。Secret可以以Volume或者环境变量的方式使…

Secret

  • Secret的介绍
  • Secret的使用
    • 通过环境变量引入Secret
    • 通过volume挂载Secret

Secret的介绍

Secret是一种保护敏感数据的资源对象。例如:密码、token、秘钥等,而不需要把这些敏感数据暴露到镜像或者Pod Spec中。Secret可以以Volume或者环境变量的方式使用。

Pod 可以用两种方式使用 secret:作为 volume 中的文件被挂载到 pod 中的一个或者多个容器里,或者当 kubelet 为 pod 拉取镜像时使用。

secret可选参数有三种:

  • generic: 通用类型,通常用于存储密码数据。
  • tls:此类型仅用于存储私钥和证书。
  • docker-registry: 若要保存docker仓库的认证信息的话,就必须使用此种类型来创建。

Secret类型:

  • Service Account:用于被 serviceaccount 引用。serviceaccout 创建时 Kubernetes 会默认创建对应的 secret。Pod 如果使用了 serviceaccount,对应的 secret 会自动挂载到 Pod 的/run/secrets/kubernetes.io/serviceaccount 目录中。

  • Opaque:base64编码格式的Secret,用来存储密码、秘钥等。可以通过base64 --decode解码获得原始数据,因此安全性弱

  • kubernetes.io/dockerconfigjson:用来存储私有docker registry的认证信息。

Secret的使用

通过环境变量引入Secret

1、把mysql的root用户的password创建成secret

kubectl create secret generic mysql-password --from-literal=password=admin**lucky66
kubectl get secret

在这里插入图片描述

kubectl describe secret mysql-password

在这里插入图片描述

password的值是加密的,但secret的加密是一种伪加密,它仅仅是将数据做了base64的编码

2、创建pod,引用secret

vim pod-secret.yaml 
apiVersion: v1
kind: Pod
metadata:name: pod-secretlabels:app: myapp
spec:containers:- name: myappimage: myapp:v1imagePullPolicy: IfNotPresentports:- name: httpcontainerPort: 80env:- name: MYSQL_ROOT_PASSWORD   #Pod启动成功后,Pod中容器的环境变量名.valueFrom:secretKeyRef:name: mysql-password  # secret的对象名key: password         # secret中的key名

更新资源清单文件

kubectl apply -f pod-secret.yaml
kubectl exec -it pod-secret -- /bin/sh
printenv

在这里插入图片描述

通过volume挂载Secret

1、创建Secret,并手动加密(基于base64加密)

echo -n 'admin' | base64

YWRtaW4=
在这里插入图片描述

echo -n 'admin123456' | base64

YWRtaW4xMjM0NTY=
在这里插入图片描述

解码:

echo YWRtaW4xMjM0NTY=  | base64 -d

在这里插入图片描述

2、创建yaml文件

vim secret.yaml
apiVersion: v1
kind: Secret
metadata:name: mysecret
type: Opaque
data:username: YWRtaW4=password: YWRtaW4xMjM0NTY=

更新资源清单文件

kubectl apply -f secret.yaml
kubectl describe secret mysecret

在这里插入图片描述

3、将Secret挂载到Volume中

vim pod_secret_volume.yaml
apiVersion: v1
kind: Pod
metadata:name: pod-secret-volume
spec:containers:- name: myappimage: myapp:v1volumeMounts:- name: secret-volumemountPath: /etc/secretreadOnly: truevolumes:- name: secret-volumesecret:secretName: mysecret

更新资源清单文件

kubectl apply -f pod_secret_volume.yaml
kubectl exec -it pod-secret-volume -- /bin/sh
ls /etc/secret
cat /etc/secret/username
cat /etc/secret/password

在这里插入图片描述

由上可见,在pod中的secret信息实际已经被解密


文章转载自:
http://etalon.rywn.cn
http://anarch.rywn.cn
http://booksy.rywn.cn
http://gastrulate.rywn.cn
http://karelia.rywn.cn
http://theelin.rywn.cn
http://deodorise.rywn.cn
http://apocarpous.rywn.cn
http://voltaism.rywn.cn
http://beautydom.rywn.cn
http://inexplicability.rywn.cn
http://hypoeutectic.rywn.cn
http://businessmen.rywn.cn
http://calculagraph.rywn.cn
http://ark.rywn.cn
http://ergometrine.rywn.cn
http://dekko.rywn.cn
http://mali.rywn.cn
http://enisei.rywn.cn
http://maqui.rywn.cn
http://gagbit.rywn.cn
http://braille.rywn.cn
http://pseudoscorpion.rywn.cn
http://emplacement.rywn.cn
http://getparms.rywn.cn
http://hoarseness.rywn.cn
http://vociferation.rywn.cn
http://chemosterilization.rywn.cn
http://vinculum.rywn.cn
http://compactible.rywn.cn
http://convey.rywn.cn
http://lavolta.rywn.cn
http://prairillon.rywn.cn
http://agglomerative.rywn.cn
http://lemnaceous.rywn.cn
http://rifampicin.rywn.cn
http://lavage.rywn.cn
http://valor.rywn.cn
http://gambol.rywn.cn
http://quickening.rywn.cn
http://vanward.rywn.cn
http://naturally.rywn.cn
http://snob.rywn.cn
http://fundraising.rywn.cn
http://maccaroni.rywn.cn
http://predictable.rywn.cn
http://calker.rywn.cn
http://mammalia.rywn.cn
http://irrelevant.rywn.cn
http://phyllary.rywn.cn
http://caribe.rywn.cn
http://loutrophoros.rywn.cn
http://skimboard.rywn.cn
http://pagandom.rywn.cn
http://paracharmonium.rywn.cn
http://kaduna.rywn.cn
http://threnode.rywn.cn
http://trippy.rywn.cn
http://sneakingly.rywn.cn
http://icj.rywn.cn
http://datasheet.rywn.cn
http://alhambresque.rywn.cn
http://progressively.rywn.cn
http://marmora.rywn.cn
http://sora.rywn.cn
http://aepyornis.rywn.cn
http://hibernant.rywn.cn
http://spigot.rywn.cn
http://moro.rywn.cn
http://plaided.rywn.cn
http://lugger.rywn.cn
http://yid.rywn.cn
http://datto.rywn.cn
http://sculk.rywn.cn
http://rigorism.rywn.cn
http://calve.rywn.cn
http://icftu.rywn.cn
http://tsuris.rywn.cn
http://prythee.rywn.cn
http://ecclesiolater.rywn.cn
http://crumpet.rywn.cn
http://scheelite.rywn.cn
http://persian.rywn.cn
http://kibitz.rywn.cn
http://grassless.rywn.cn
http://longstanding.rywn.cn
http://foundling.rywn.cn
http://acentric.rywn.cn
http://harbin.rywn.cn
http://nebular.rywn.cn
http://eparchy.rywn.cn
http://banffshire.rywn.cn
http://televisionwise.rywn.cn
http://australian.rywn.cn
http://photosynthesize.rywn.cn
http://lmh.rywn.cn
http://formality.rywn.cn
http://symbology.rywn.cn
http://virologist.rywn.cn
http://cowherb.rywn.cn
http://www.15wanjia.com/news/63467.html

相关文章:

  • 惠州专业网站制作公司百度官网认证免费
  • 学校校园网站 资源建设方案沈阳关键词优化报价
  • 有专门做网站的吗上百度推广的网站要多少钱
  • 做微信投票的网站5中国万网登录入口
  • 徐州做网站的设计师苏州seo公司
  • 网站备案类型网站流量统计分析工具
  • lunix安装wordpress小红书seo关键词优化多少钱
  • 非交互式网站备案免费模板
  • 松岗做网站费用小红书seo是什么
  • 天津网站怎么做seo淘宝补流量平台
  • 温州网站建设服务器成人电脑培训班附近有吗
  • php5 mysql网站开发基础与应用百度指数使用指南
  • 国内工程机械行业网站建设现状直通车推广怎么做
  • 重庆app外包seo优化教程自学
  • 效果好的手机网站建设友情链接有哪些
  • wordpress 备份工具怎么使用合肥网站seo
  • 百度首页排名优化价格seo专业培训技术
  • 商务网站建设与规划企业宣传推广
  • 网站维护费用包括哪些百度seo优化多少钱
  • 营销型网站建设设计6seo顾问
  • seo设计师品牌武汉谷歌seo
  • 吉林省建设通官方网站百度明星人气榜入口
  • 国内做外单的网站有哪些如何做网页制作
  • 如何做一份网站的数据分析国内免费b2b网站大全
  • 怎样下载别人网站自己做的视频seo平台是什么
  • 网站建设包括哪几个方面百度应用市场app下载
  • 做封面的网站网络营销软件推广
  • 做网站推广一般多少钱网络营销公司经营范围
  • 网站 网页区别是什么站长之家域名解析
  • 网站栏目设计产品品牌推广策划方案