Warning: Array to string conversion in /home/wwwroot/myf5/wp-content/plugins/wpjam-basic/public/wpjam-utils.php on line 496
安装NGINX官方helm repo
helm repo add nginx-stable https://helm.nginx.com/stable
安装过程演示
[root@k8s-master-v1-16 ~]# helm repo add nginx-stable https://helm.nginx.com/stable
"nginx-stable" has been added to your repositories
[root@k8s-master-v1-16 ~]# helm search repo nginx-stable
NAME CHART VERSION APP VERSION DESCRIPTION
nginx-stable/nginx-ingress 0.5.2 1.7.2 NGINX Ingress Controller
[root@k8s-master-v1-16 ~]# helm install myic nginx-stable/nginx-ingress -n ic-test --set controller.ingressClass=test-ingress
Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "transportservers.k8s.nginx.org" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "myic"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "ic-test"
(由于之前手工部署过了相关CRD资源,这些CRD并不属于某个namespace,所以helm报冲突,删除手工部署的CRD重新执行)
[root@k8s-master-v1-16 ~]# helm install myic nginx-stable/nginx-ingress -n ic-test --create-namespace --set controller.ingressClass=test-ingress
NAME: myic
LAST DEPLOYED: Sun Jun 28 19:18:34 2020
NAMESPACE: ic-test
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The NGINX Ingress Controller has been installed.
[root@k8s-master-v1-16 ~]# helm list -n ic-test
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
myic ic-test 1 2020-06-28 19:18:34.80694826 +0800 CST deployed nginx-ingress-0.5.2 1.7.2
[root@k8s-master-v1-16 ~]# kubectl get deploy myic-nginx-ingress -n ic-test -o yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
meta.helm.sh/release-name: myic
meta.helm.sh/release-namespace: ic-test
creationTimestamp: "2020-06-28T11:18:35Z"
generation: 1
labels:
app.kubernetes.io/instance: myic
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: myic-nginx-ingress
helm.sh/chart: nginx-ingress-0.5.2
name: myic-nginx-ingress
namespace: ic-test
resourceVersion: "30857629"
selfLink: /apis/apps/v1/namespaces/ic-test/deployments/myic-nginx-ingress
uid: 959981b3-6942-4e85-98e9-7d8fc5a51e63
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: myic-nginx-ingress
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
prometheus.io/port: "9113"
prometheus.io/scrape: "true"
creationTimestamp: null
labels:
app: myic-nginx-ingress
spec:
containers:
- args:
- -nginx-plus=false
- -nginx-configmaps=$(POD_NAMESPACE)/myic-nginx-ingress
- -default-server-tls-secret=$(POD_NAMESPACE)/myic-nginx-ingress-default-server-secret
- -ingress-class=test-ingress
- -use-ingress-class-only=false
- -health-status=false
- -health-status-uri=/nginx-health
- -nginx-debug=false
- -v=1
- -nginx-status=true
- -nginx-status-port=8080
- -nginx-status-allow-cidrs=127.0.0.1
- -report-ingress-status
- -external-service=myic-nginx-ingress
- -enable-leader-election=true
- -leader-election-lock-name=myic-nginx-ingress-leader-election
- -enable-prometheus-metrics=true
- -prometheus-metrics-listen-port=9113
- -enable-custom-resources=true
- -enable-tls-passthrough=false
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
image: nginx/nginx-ingress:1.7.2
imagePullPolicy: IfNotPresent
name: myic-nginx-ingress
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
- containerPort: 9113
name: prometheus
protocol: TCP
resources: {}
securityContext:
allowPrivilegeEscalation: true
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
runAsUser: 101
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: myic-nginx-ingress
serviceAccountName: myic-nginx-ingress
terminationGracePeriodSeconds: 30
status:
conditions:
- lastTransitionTime: "2020-06-28T11:18:35Z"
lastUpdateTime: "2020-06-28T11:18:35Z"
message: Deployment does not have minimum availability.
reason: MinimumReplicasUnavailable
status: "False"
type: Available
- lastTransitionTime: "2020-06-28T11:18:35Z"
lastUpdateTime: "2020-06-28T11:18:35Z"
message: ReplicaSet "myic-nginx-ingress-69dcfbb87f" is progressing.
reason: ReplicaSetUpdated
status: "True"
type: Progressing
observedGeneration: 1
replicas: 1
unavailableReplicas: 1
updatedReplicas: 1
[root@k8s-master-v1-16 ~]# kubectl get all -n ic-test
NAME READY STATUS RESTARTS AGE
pod/myic-nginx-ingress-69dcfbb87f-6zqfn 0/1 ContainerCreating 0 2m6s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/myic-nginx-ingress LoadBalancer 10.101.100.233 <pending> 80:32379/TCP,443:31638/TCP 2m7s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/myic-nginx-ingress 0/1 1 0 2m6s
NAME DESIRED CURRENT READY AGE
replicaset.apps/myic-nginx-ingress-69dcfbb87f 1 1 0 2m6s
[root@k8s-master-v1-16 ~]# kubectl get cm -n ic-test
NAME DATA AGE
istio-ca-root-cert 1 2m15s
myic-nginx-ingress 0 2m15s
myic-nginx-ingress-leader-election 0 2m15s
[root@k8s-master-v1-16 ~]# kubectl get secrets -n ic-test
NAME TYPE DATA AGE
default-token-94dmh kubernetes.io/service-account-token 3 2m26s
myic-nginx-ingress-default-server-secret Opaque 2 2m26s
myic-nginx-ingress-token-bwh7p kubernetes.io/service-account-token 3 2m26s
sh.helm.release.v1.myic.v1 helm.sh/release.v1 1 2m26s
[root@k8s-master-v1-16 ~]# helm uninstall myic -n ic-test
release "myic" uninstalled
Array
文章评论