If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
cluster-ip
ClusterIP to be assigned to the service. Leave empty to auto-allocate, or set to ‘None’ to create a headless service.
container-port
Synonym for –target-port
dry-run
false
If true, only print the object that would be sent, without sending it.
external-ip
Additional external IP address (not managed by Kubernetes) to accept for the service. If this IP is routed to a node, the service can be accessed by this IP in addition to its generated service IP. 用于接受服务的额外的外部IP地址(不被kubernetes管理)。如果这个IP被路由到一个节点,则这个服务处理被它产生的service IP接入外,还可以被这个IP接入。
filename
f
[]
Filename, directory, or URL to files identifying the resource to expose a service
generator
service/v2
The name of the API generator to use. There are 2 generators: ‘service/v1’ and ‘service/v2’. The only difference between them is that service port in v1 is named ‘default’, while it is left unnamed in v2. Default is ‘service/v2’.
labels
l
Labels to apply to the service created by this call.
load-balancer-ip
IP to assign to the Load Balancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).
name
The name for the newly created object.
no-headers
false
When using the default or custom-column output format, don’t print headers (default print headers).
output
o
Output format. One of: json|yaml|wide|name|custom-columns=…|custom-columns-file=…|go-template=…|go-template-file=…|jsonpath=…|jsonpath-file=… See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
output-version
DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: ‘jobs.v1.batch/myjob’).
overrides
An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.
port
The port that the service should serve on. Copied from the resource being exposed, if unspecified
protocol
The network protocol for the service to be created. Default is ‘TCP’.
record
false
Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.
recursive
R
false
Process the directory used in -f, –filename recursively. Useful when you want to manage related manifests organized within the same directory.
save-config
false
If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.
selector
A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.)
session-affinity
If non-empty, set the session affinity for the service to this; legal values: ‘None’, ‘ClientIP’
show-all
a
false
When printing, show all resources (default hide terminated pods.)
show-labels
false
When printing, show all labels as the last column (default hide labels column)
sort-by
If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. ‘{.metadata.name}’). The field in the API resource specified by this JSONPath expression must be an integer or a string.
target-port
Name or number for the port on the container that the service should direct traffic to. Optional.
template
Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
type
Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is ‘ClusterIP’.
Precondition for current size. Requires that the current size of the resource match this value in order to scale.
filename
f
[]
Filename, directory, or URL to files identifying the resource to set a new size
include-extended-apis
true
If true, include definitions of new APIs via calls to the API server. [default true]
output
o
Output mode. Use “-o name” for shorter output (resource/name).
record
false
Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.
recursive
R
false
Process the directory used in -f, –filename recursively. Useful when you want to manage related manifests organized within the same directory.
replicas
-1
The new desired number of replicas. Required.
resource-version
Precondition for resource version. Requires that the current resource version match this value in order to scale.
timeout
0s
The length of time to wait before giving up on a scale operation, zero means don’t wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
(4)kubectl autoscale
5. Cluster Manager Commands 集群管理命令
(1)kubectl cetificate
修改证书资源对象
(2)kubectl cluster-info
查看集群信息
(3)kubectl top
显示资源 cpu 内存 存储使用情况
(4)kubectl cordon
标记节点为不可调度
(5)kubectl uncordon
指定节点为可调度
(6)kubectl drain
安全的驱逐节点的所有pod
(7)kubectl taint(污点和容忍)
Taint(污点)和 Toleration(容忍)可以作用于 node 和 pod 上,其目的是优化 pod 在集群间的调度,这跟节点亲和性类似,只不过它们作用的方式相反,具有 taint 的 node 和 pod 是互斥关系,而具有节点亲和性关系的 node 和 pod 是相吸的。另外还有可以给 node 节点设置 label,通过给 pod 设置 nodeSelector 将 pod 调度到具有匹配标签的节点上。
Taint 和 toleration 相互配合,可以用来避免 pod 被分配到不合适的节点上。每个节点上都可以应用一个或多个 taint ,这表示对于那些不能容忍这些 taint 的 pod,是不会被该节点接受的。如果将 toleration 应用于 pod 上,则表示这些 pod 可以(但不要求)被调度到具有相应 taint 的节点上。
You will need to set your firewall(s) to allow access to the following ports:
SMTP: 25
POP3: 110
IMAP: 143
SMTP Secure: 465
MSA: 587
IMAP Secure: 993
POP3 Secure: 995
By default, the Cloud Panel Firewall denies access to all but the most commonly-used ports.
Install Postfix
To install Postfix, first update your packages:
sudo apt-get update
Then install Postfix:
sudo apt-get install postfix
Postfix is installed by default on most Ubuntu 16.04 systems, so this command will most likely exit with a message that postfix is already the newest version (3.1.0-3)..
If Postfix continues with an installation, simply accept all of the defaults at each prompt to complete the process.
Configure Postfix
After the installation is complete, run the command to configure Postfix:
sudo dpkg-reconfigure postfix
Enter the following values at the prompts, replacing example.com with your own domain name. Use the up arrow and down arrow to move up and down to highlight answers, and Enter to select your answer.
Select OK to proceed.
Choose Internet Site.
System Mail Name: example.com
Root and postmaster mail recipient: root
Other destinations for mail: example.com, localhost.example.com, localhost
Force synchronous updates on mail queue?: No
Local networks: 127.0.0.0/8
Use procmail for local delivery?: No
Mailbox size limit (bytes): 0
Local address extension character: +
Internet protocols to use: all
After the initial Postfix configuration has been done, you can change Postfix settings with the command:
sudo postconf -e '[new setting]'
Create an SSL certificate
We will create a self-signed SSL certificate to secure incoming and outgoing email connections:
Answer the questions at the prompts, or just hit [Enter] to leave an answer blank. This command will create two files: mailserver.key and mailserver.crt.
Next, create the file /etc/postfix/sasl/smtpd.conf and open it for editing:
sudo nano /etc/postfix/sasl/smtpd.conf
Add the following content:
pwcheck_method: saslauthd
mech_list: plain login
After you have finished configuring Postfix, restart the Postfix daemon with the command:
sudo systemctl restart postfix
Install SASL
Postfix will use SASL to handle the authentication with SMTP AUTH. Now that Postfix has been configured to use SMTP AUTH, install SASL with the command:
Note: If you get an error message that /var/spool/postfix/var/run/saslauthd does not exist, ignore it. This directory will be created when you start the SASL daemon.