k8s 自动创建云硬盘 kubernetes --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-mysql-keycloak-dev spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: cbs # volumeName: pvc-mysql-keycloak-dev # selector: # matchLabels: # app: pv-mysql-keycloak-dev --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: mysql-keycloak-deploy-dev spec: replicas: 1 template: metadata: labels: app: mysql-keycloak-dev spec: containers: - name: mysql-keycloak-dev image: mysql:5.7 ports: - containerPort: 8080 volumeMounts: - name: mysql-data mountPath: /var/lib/mysql env: - name: MYSQL_ROOT_PASSWORD value: Lookeng2018 - name: MYSQL_DATABASE value: keycloak volumes: - name: mysql-data persistentVolumeClaim: claimName: pvc-mysql-keycloak-dev --- apiVersion: v1 kind: Service metadata: name: mysql-keycloak-service-dev spec: selector: app: mysql-keycloak-dev ports: - name: tcp3306 protocol: TCP port: 3306 targetPort: 3306 type: ClusterIP 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 ---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: pvc-mysql-keycloak-devspec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: cbs # volumeName: pvc-mysql-keycloak-dev # selector: # matchLabels: # app: pv-mysql-keycloak-dev ---apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: mysql-keycloak-deploy-devspec: replicas: 1 template: metadata: labels: app: mysql-keycloak-dev spec: containers: - name: mysql-keycloak-dev image: mysql:5.7 ports: - containerPort: 8080 volumeMounts: - name: mysql-data mountPath: /var/lib/mysql env: - name: MYSQL_ROOT_PASSWORD value: Lookeng2018 - name: MYSQL_DATABASE value: keycloak volumes: - name: mysql-data persistentVolumeClaim: claimName: pvc-mysql-keycloak-dev---apiVersion: v1kind: Servicemetadata: name: mysql-keycloak-service-devspec: selector: app: mysql-keycloak-dev ports: - name: tcp3306 protocol: TCP port: 3306 targetPort: 3306 type: ClusterIP &nbs… Read More
k8s + spring boot 部署配置 ## YAML Template. --- #not work apiVersion: apps/v1 apiVersion: extensions/v1beta1 kind: Deployment metadata: name: oms-deploy-dev spec: replicas: 1 template: metadata: labels: app: oms-dev spec: imagePullSecrets: - name: tencent-sss-docker containers: - name: oms imagePullPolicy: Always image: ccr.ccs.tencentyun.com/sss/oms:latest env: - name: SPRING_PROFILES_ACTIVE value: dev ports: - containerPort: 80 livenessProbe: httpGet: path: /actuator/health port: 80 scheme: HTTP initialDelaySeconds: 60 timeoutSeconds: 2 successThreshold: 1 failureThreshold: 5 readinessProbe: httpGet: path: /actuator/health port: 80 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 5 --- kind: Service apiVersion: v1 metadata: name: oms-service-dev spec: selector: app: oms-dev ports: - protocol: TCP port: 80 targetPort: 80 type: NodePort --- #balancer + ingress ok apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: description: ddddd kubernetes.io/ingress.class: qcloud ##后台查到的 # qcloud_cert_id: JIUrBtas name: miniapp-dev-ingress namespace: default spec: rules: - host: miniapp-dev.test.com http: paths: - backend: serviceName: oms-service-dev servicePort: 80 path: / tls: - secretName: miniapp-dev-ingress status: loadBalancer: ingress: # - ip: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 ## YAML Template.---#not work apiVersion: apps/v1apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: oms-deploy-devspec: replicas: 1 template: metadata: labels: app: oms-dev spec: imagePullSecrets: - name: tencent-sss-docker containers: - name: oms imagePullPolicy: Always image: ccr.ccs.tencentyun.com/sss/oms:latest env: - name: SPRING_PROFILES_ACTIVE value: dev ports: - containerPort: 80 livenessProbe: httpGet: path: /actuator/health port: 80 scheme: HTTP initialDelaySeconds: 60 timeoutSeconds: 2 successThreshold: 1 failureThreshold: 5 readinessProbe: httpGet: path: /actuator/health port: 80 scheme: HTTP initialDelaySeconds: 30 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 5 --- kind: ServiceapiVersion: v1metadata: name: oms-service-devspec: selector: app: oms-dev ports: - protocol: TCP port: 80 targetPort: 80 type: NodePort---#balancer + ingress ok apiVersion: extensions/v1beta1kind: Ingressmetadata: annotations: description: ddddd kubernetes.io/ingress.class: qcloud ##后台查到的# qcloud_cert_id: JIUrBtas name: miniapp-dev-ingress namespace: defaultspec: rules: - host: miniapp-dev.test.com http: paths: - backend: serviceName: oms-service-dev servicePort: 80 path: / tls: - secretName: miniapp-dev-ingressstatus: loadBalancer: ingress:# - ip: … Read More
k8s 删除 pod 成功后 还是显示 status Terminating 问题: k8s 删除不了 pod 删除成功,但是 kubectl get pod 还是显示 status Te… Read More
k8s service loadBalancer ip 如何指定 问题: 解决: YAML status: loadBalancer: ingress: - ip: 111.230.208.140 1234 status: loadBalancer: ingress: - ip: 111.230.208.140 … Read More
gradle 使用aliyun maven repositories repositories { maven {url 'http://maven.aliyun.com/nexus/content/groups/public/'} mavenCentral() } 1234 repositories {maven {url 'http://maven.aliyun.com/nexus/content/groups/public/'}mavenCentral()} &… Read More