[root@master opt]# mkdir manifest
[root@master opt]# ls
manifest
查看deployment类型资源编排怎么定义
deployment类型
[root@master ~]# kubectl explain deployment
KIND: Deployment
VERSION: apps/v1
DESCRIPTION:
Deployment enables declarative updates for Pods and ReplicaSets.
.......
pod类型
[root@master ~]# kubectl explain pods
KIND: Pod
VERSION: v1
DESCRIPTION:
Pod is a collection of containers that can run on a host. This resource is
created by clients and scheduled onto hosts.
FIELDS:
apiVersion
APIVersion defines the versioned schema of this representation of an
object. Servers should convert recognized schemas to the latest internal
value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind
Kind is a string value representing the REST resource this object
represents. Servers may infer this from the endpoint the client submits
requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata
service类型
[root@master ~]# kubectl explain service
KIND: Service
VERSION: v1
DESCRIPTION:
Service is a named abstraction of software service (for example, mysql)
consisting of local port (for example 3306) that the proxy listens on, and
the selector that determines which pods will answer requests sent through
the proxy.
FIELDS:
apiVersion
APIVersion defines the versioned schema of this representation of an
object. Servers should convert recognized schemas to the latest internal
value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind
Kind is a string value representing the REST resource this object
represents. Servers may infer this from the endpoint the client submits
requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata
Standard object's metadata. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec
Spec defines the behavior of a service.
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status
Most recently observed status of the service. Populated by the system.
Read-only. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
[root@master manifest]# kubectl get pods
NAME READY STATUS RESTARTS AGE
web-5dc777c866-9xz9b 1/1 Running 0 95s
web-5dc777c866-bpp2c 1/1 Running 0 97s
web-5dc777c866-zf4js 1/1 Running 0 96s
[root@master manifest]# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 443/TCP 3d
web NodePort 10.101.176.221 8001:32673/TCP 8m2s
[root@master manifest]# kubectl get ns
NAME STATUS AGE
default Active 3d1h
kube-node-lease Active 3d1h
kube-public Active 3d1h
kube-system Active 3d1h
runtime Active 92s
[root@master manifest]# kubectl get pods -n runtime
NAME READY STATUS RESTARTS AGE
web-5dc777c866-cngw5 1/1 Running 0 2m10s
web-5dc777c866-sbxzf 1/1 Running 0 2m10s
web-5dc777c866-shxhp 1/1 Running 0 2m10s
[root@master manifest]# kubectl get svc -n runtime
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
web NodePort 10.110.105.67 8001:32530/TCP 21s
#创建了命名空间只能这样查看
[root@master manifest]# kubectl get deployment -n runtime
NAME READY UP-TO-DATE AVAILABLE AGE
web 3/3 3 3 40s
[root@master manifest]# kubectl get deployment
No resources found in default namespace.
创建haproxy
创建镜像
[root@master manifest]# kubectl run web --image sktystwd/apache:v0.1
pod/web created
[root@master manifest]# kubectl run web1 --image sktystwd/apache:v0.2
pod/web1 created
添加service
[root@master manifest]# kubectl expose pods web --port 80 --target-port 80
service/web exposed
[root@master manifest]# kubectl expose pods web1 --port 80 --target-port 80
service/web1 exposed
[root@master manifest]# kubectl get svcNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 443/TCP 3d1h
web ClusterIP 10.109.58.148 80/TCP 10s
web1 ClusterIP 10.107.246.15 80/TCP 4s
访问
[root@master manifest]# curl 10.109.58.148
test page with v1
[root@master manifest]# curl 10.107.246.15
test page with v2
把IP写入一个文件中
[root@master opt]# mkdir data
[root@master opt]# ls
apache cni containerd date manifest
[root@master opt]# cd date/
[root@master date]# ls
[root@master date]# vim bs.tst
[root@master date]# cat bs.tst
10.109.58.148
10.107.246.15
[root@master manifest]# kubectl create -f deployment3.yaml
pod/haproxy created
service/haproxy created
[root@master manifest]# kubectl get pods
NAME READY STATUS RESTARTS AGE
haproxy 0/1 ContainerCreating 0 58s
web 1/1 Running 0 54m
web1 1/1 Running 0 54m
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000777c3290, pid=5632, tid=6656
#
# JRE version: Java(TM) SE Ru
Spring 中提供一些Aware相关de接口,BeanFactoryAware、 ApplicationContextAware、ResourceLoaderAware、ServletContextAware等等,其中最常用到de匙ApplicationContextAware.实现ApplicationContextAwaredeBean,在Bean被初始后,将会被注入 Applicati
在Java项目中,我们通常会自己写一个DateUtil类,处理日期和字符串的转换,如下所示:
public class DateUtil01 {
private SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public void format(Date d
问题描述:
在实现类中的某一或某几个Override方法发生编译错误如下:
Name clash: The method put(String) of type XXXServiceImpl has the same erasure as put(String) of type XXXService but does not override it
当去掉@Over