deploy on GKE fail to set static ip
BaiShaoqi opened this issue · comments
Hi,
I am trying to deploy postfacto on gke cluster, and set a static ip for it, then I can create a domain name for the static ip, so that I can access postfacto by https://domain_name.com/retros
but failed when deploy postfacto by set a static ip, anything wrong with my process ?
create a gke cluster
gcloud container clusters create --num-nodes=2 --zone=us-central1-c gp-releng-cluster-us
make kubectl can access the gke cluster
gcloud container clusters get-credentials --zone=us-central1-c gp-releng-cluster-us
create a static ip
gcloud compute addresses create postfacto-gp-releng-static-global-ip --global
download latested postfacto: https://github.com/pivotal/postfacto/releases/download/4.2.0/package.zip
and install postfacto on the gke cluster using the static ip that have created.
unzip package.zip
cd package/tkg
helm install -f config.yaml postfacto-gp-releng postfacto-0.5.0-beta.tgz
the config.yaml is
ingress:
annotations:
kubernetes.io/ingress.global-static-ip-name: postfacto-gp-releng-static-global-ip
the deployment then failed.
$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/postfacto-gp-releng-774b9779fd-7wvdb 0/1 Init:CrashLoopBackOff 17 65m
pod/postfacto-gp-releng-postgresql-0 1/1 Running 0 65m
pod/postfacto-gp-releng-redis-master-0 1/1 Running 0 65m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.51.240.1 <none> 443/TCP 2d2h
service/postfacto-gp-releng ClusterIP 10.51.246.255 <none> 80/TCP 65m
service/postfacto-gp-releng-postgresql ClusterIP 10.51.255.170 <none> 5432/TCP 65m
service/postfacto-gp-releng-postgresql-headless ClusterIP None <none> 5432/TCP 65m
service/postfacto-gp-releng-redis-headless ClusterIP None <none> 6379/TCP 65m
service/postfacto-gp-releng-redis-master ClusterIP 10.51.254.136 <none> 6379/TCP 65m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/postfacto-gp-releng 0/1 1 0 65m
NAME DESIRED CURRENT READY AGE
replicaset.apps/postfacto-gp-releng-774b9779fd 1 1 0 65m
NAME READY AGE
statefulset.apps/postfacto-gp-releng-postgresql 1/1 65m
statefulset.apps/postfacto-gp-releng-redis-master 1/1 65m
the failed pod is
$ kubectl get pod/postfacto-gp-releng-774b9779fd-7wvdb --output=yaml
apiVersion: v1
kind: Pod
metadata:
annotations:
kubernetes.io/limit-ranger: 'LimitRanger plugin set: cpu request for container
postfacto; cpu request for init container psql-wait'
creationTimestamp: "2020-08-06T08:35:39Z"
generateName: postfacto-gp-releng-774b9779fd-
labels:
app.kubernetes.io/instance: postfacto-gp-releng
app.kubernetes.io/name: postfacto
pod-template-hash: 774b9779fd
name: postfacto-gp-releng-774b9779fd-7wvdb
namespace: default
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: ReplicaSet
name: postfacto-gp-releng-774b9779fd
uid: be7adf67-c8b5-41af-8452-2dc978897788
resourceVersion: "688368"
selfLink: /api/v1/namespaces/default/pods/postfacto-gp-releng-774b9779fd-7wvdb
uid: 8c9d3741-aca1-4774-a5a3-72f292204e64
spec:
containers:
- env:
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: postgresql-password
name: postfacto-gp-releng-postgresql
- name: DATABASE_URL
value: postgres://postgres:$(POSTGRESQL_PASSWORD)@postfacto-gp-releng-postgresql
- name: SECRET_KEY_BASE
value: Oo9uggNADF
- name: DISABLE_SSL_REDIRECT
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
key: redis-password
name: postfacto-gp-releng-redis
- name: REDIS_URL
value: redis://:$(REDIS_PASSWORD)@postfacto-gp-releng-redis-master
- name: GOOGLE_OAUTH_CLIENT_ID
image: postfacto/postfacto:4.2.0
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: postfacto
ports:
- containerPort: 3000
name: http
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
requests:
cpu: 100m
securityContext: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: postfacto-gp-releng-token-dghxm
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
initContainers:
- command:
- sh
- -c
- for i in {1..33}; do sleep 3; if PGPASSWORD=$POSTGRESQL_PASSWORD psql -h postfacto-gp-releng-postgresql
-U postgres; then exit 0; fi; done; exit 1
env:
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: postgresql-password
name: postfacto-gp-releng-postgresql
image: postgres
imagePullPolicy: Always
name: psql-wait
resources:
requests:
cpu: 100m
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: postfacto-gp-releng-token-dghxm
readOnly: true
nodeName: gke-gp-releng-cluster-us-default-pool-a8cdb7ed-gmvd
priority: 0
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: postfacto-gp-releng
serviceAccountName: postfacto-gp-releng
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 300
volumes:
- name: postfacto-gp-releng-token-dghxm
secret:
defaultMode: 420
secretName: postfacto-gp-releng-token-dghxm
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2020-08-06T08:35:39Z"
message: 'containers with incomplete status: [psql-wait]'
reason: ContainersNotInitialized
status: "False"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2020-08-06T08:35:39Z"
message: 'containers with unready status: [postfacto]'
reason: ContainersNotReady
status: "False"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2020-08-06T08:35:39Z"
message: 'containers with unready status: [postfacto]'
reason: ContainersNotReady
status: "False"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2020-08-06T08:35:39Z"
status: "True"
type: PodScheduled
containerStatuses:
- image: postfacto/postfacto:4.2.0
imageID: ""
lastState: {}
name: postfacto
ready: false
restartCount: 0
state:
waiting:
reason: PodInitializing
hostIP: 10.128.0.49
initContainerStatuses:
- containerID: docker://3d93a8afab873afe0fac1e4c9790c9b6779d3efe59bc697ed1ec3141007290a7
image: postgres:latest
imageID: docker-pullable://postgres@sha256:86faa9d3c37c8a7db15b13dfdd9cc59c0f30c665f0c5dc082a07faceb3e56958
lastState:
terminated:
containerID: docker://3d93a8afab873afe0fac1e4c9790c9b6779d3efe59bc697ed1ec3141007290a7
exitCode: 1
finishedAt: "2020-08-06T09:38:45Z"
reason: Error
startedAt: "2020-08-06T09:38:42Z"
name: psql-wait
ready: false
restartCount: 17
state:
waiting:
message: Back-off 5m0s restarting failed container=psql-wait pod=postfacto-gp-releng-774b9779fd-7wvdb_default(8c9d3741-aca1-4774-a5a3-72f292204e64)
reason: CrashLoopBackOff
phase: Pending
podIP: 10.48.0.21
qosClass: Burstable
startTime: "2020-08-06T08:35:39Z"