<p>In my case problem was related with droped IPtables FORWARD policy. I had investigated it with the help of "microk8s.inspect" command. InitContainer couldn't get access to the Internet and it stopped deployment of whole pod with main container. Solving was easy - "sudo iptables -P FORWARD ACCEPT" and redeployment with Helm.</p>

CC BY-SA 4.0
2019-01-14T15:05:50.947Z
2019-01-14T15:05:50.947Z
Bogdan Pisarenko
<p>I try to deploy Jenkins in local Kubernetes cluster with Helm from repo stable/jenkins:lts. But after deployment I get pod which has status "<code>pod has unbound immediate PersistentVolumeClaims</code>". PVC has status "bound" without any errors.</p>

<p>My environment: virtual machine with Linux Ubuntu 18.x where there is installed microk8s. When I deploy I change only node type and persistence size.</p>

<p>Helm chart config:</p>

<pre><code>NAME:   inclined-eagle
REVISION: 1
RELEASED: Fri Jan 11 21:35:47 2019
CHART: jenkins-0.28.6
USER-SUPPLIED VALUES:
Master:
  ServiceType: NodePort
Persistence:
  Size: 4Gi

COMPUTED VALUES:
Agent:
  AlwaysPullImage: false
  Component: jenkins-slave
  CustomJenkinsLabels: []
  Enabled: true
  Image: jenkins/jnlp-slave
  ImageTag: 3.27-1
  NodeSelector: {}
  PodRetention: Never
  Privileged: false
  resources:
    limits:
      cpu: 200m
      memory: 256Mi
    requests:
      cpu: 200m
      memory: 256Mi
  volumes: null
Master:
  AdditionalConfig: {}
  AdminUser: admin
  CLI: false
  CSRF:
    DefaultCrumbIssuer:
      Enabled: true
      ProxyCompatability: true
  Component: jenkins-master
  CustomConfigMap: false
  DisabledAgentProtocols:
  - JNLP-connect
  - JNLP2-connect
  ExtraPorts: null
  HealthProbeLivenessFailureThreshold: 12
  HealthProbeReadinessPeriodSeconds: 10
  HealthProbes: true
  HealthProbesLivenessTimeout: 90
  HealthProbesReadinessTimeout: 60
  HostNetworking: false
  Image: jenkins/jenkins
  ImagePullPolicy: Always
  ImageTag: lts
  Ingress:
    Annotations: {}
    ApiVersion: extensions/v1beta1
    TLS: null
  InitScripts: null
  InstallPlugins:
  - kubernetes:1.14.0
  - workflow-job:2.31
  - workflow-aggregator:2.6
  - credentials-binding:1.17
  - git:3.9.1
  LoadBalancerSourceRanges:
  - 0.0.0.0/0
  Name: jenkins-master
  NodeSelector: {}
  NumExecutors: 0
  OverwriteConfig: false
  PodAnnotations: {}
  ServiceAnnotations: {}
  ServiceLabels: {}
  ServicePort: 8080
  ServiceType: NodePort
  SlaveListenerPort: 50000
  SlaveListenerServiceAnnotations: {}
  SlaveListenerServiceType: ClusterIP
  Tolerations: {}
  UsePodSecurityContext: true
  UseSecurity: true
  resources:
    limits:
      cpu: 2000m
      memory: 2048Mi
    requests:
      cpu: 50m
      memory: 256Mi
NetworkPolicy:
  ApiVersion: networking.k8s.io/v1
  Enabled: false
Persistence:
  AccessMode: ReadWriteOnce
  Annotations: {}
  Enabled: true
  Size: 4Gi
  mounts: null
  volumes: null
backup:
  annotations:
    iam.amazonaws.com/role: jenkins
  destination: s3://nuvo-jenkins-data/backup
  enabled: false
  env:
  - name: AWS_REGION
    value: us-east-1
  extraArgs: []
  image:
    repository: nuvo/kube-tasks
    tag: 0.1.2
  resources:
    limits:
      cpu: 1
      memory: 1Gi
    requests:
      cpu: 1
      memory: 1Gi
  schedule: 0 2 * * *
rbac:
  install: false
  roleBindingKind: ClusterRoleBinding
  roleKind: ClusterRole
  roleRef: cluster-admin
  serviceAccountName: default

HOOKS:
---
# inclined-eagle-ui-test-1mhfp
apiVersion: v1
kind: Pod
metadata:
  name: "inclined-eagle-ui-test-1mhfp"
  annotations:
    "helm.sh/hook": test-success
spec:
  initContainers:
    - name: "test-framework"
      image: "dduportal/bats:0.4.0"
      command:
      - "bash"
      - "-c"
      - |
        set -ex
        # copy bats to tools dir
        cp -R /usr/local/libexec/ /tools/bats/
      volumeMounts:
      - mountPath: /tools
        name: tools
  containers:
    - name: inclined-eagle-ui-test
      image: jenkins/jenkins:lts
      command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
      volumeMounts:
      - mountPath: /tests
        name: tests
        readOnly: true
      - mountPath: /tools
        name: tools
  volumes:
  - name: tests
    configMap:
      name: inclined-eagle-jenkins-tests
  - name: tools
    emptyDir: {}
  restartPolicy: Never
MANIFEST:

---
# Source: jenkins/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: inclined-eagle-jenkins
  labels:
    app: inclined-eagle-jenkins
    chart: "jenkins-0.28.6"
    release: "inclined-eagle"
    heritage: "Tiller"
type: Opaque
data:

  jenkins-admin-password: "enkyZlZqdVdqMw=="

  jenkins-admin-user: "YWRtaW4="
---
# Source: jenkins/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: inclined-eagle-jenkins
data:
  config.xml: |-
    &lt;?xml version='1.0' encoding='UTF-8'?&gt;
    &lt;hudson&gt;
      &lt;disabledAdministrativeMonitors/&gt;
      &lt;version&gt;lts&lt;/version&gt;
      &lt;numExecutors&gt;0&lt;/numExecutors&gt;
      &lt;mode&gt;NORMAL&lt;/mode&gt;
      &lt;useSecurity&gt;true&lt;/useSecurity&gt;
      &lt;authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy"&gt;
        &lt;denyAnonymousReadAccess&gt;true&lt;/denyAnonymousReadAccess&gt;
      &lt;/authorizationStrategy&gt;
      &lt;securityRealm class="hudson.security.LegacySecurityRealm"/&gt;
      &lt;disableRememberMe&gt;false&lt;/disableRememberMe&gt;
      &lt;projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/&gt;
      &lt;workspaceDir&gt;${JENKINS_HOME}/workspace/${ITEM_FULLNAME}&lt;/workspaceDir&gt;
      &lt;buildsDir&gt;${ITEM_ROOTDIR}/builds&lt;/buildsDir&gt;
      &lt;markupFormatter class="hudson.markup.EscapedMarkupFormatter"/&gt;
      &lt;jdks/&gt;
      &lt;viewsTabBar class="hudson.views.DefaultViewsTabBar"/&gt;
      &lt;myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/&gt;
      &lt;clouds&gt;
        &lt;org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud plugin="kubernetes@1.14.0"&gt;
          &lt;name&gt;kubernetes&lt;/name&gt;
          &lt;templates&gt;
            &lt;org.csanchez.jenkins.plugins.kubernetes.PodTemplate&gt;
              &lt;inheritFrom&gt;&lt;/inheritFrom&gt;
              &lt;name&gt;default&lt;/name&gt;
              &lt;instanceCap&gt;2147483647&lt;/instanceCap&gt;
              &lt;idleMinutes&gt;0&lt;/idleMinutes&gt;
              &lt;label&gt;inclined-eagle-jenkins-slave &lt;/label&gt;
              &lt;nodeSelector&gt;&lt;/nodeSelector&gt;
                &lt;nodeUsageMode&gt;NORMAL&lt;/nodeUsageMode&gt;
              &lt;volumes&gt;
              &lt;/volumes&gt;
              &lt;containers&gt;
                &lt;org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate&gt;
                  &lt;name&gt;jnlp&lt;/name&gt;
                  &lt;image&gt;jenkins/jnlp-slave:3.27-1&lt;/image&gt;
                  &lt;privileged&gt;false&lt;/privileged&gt;
                  &lt;alwaysPullImage&gt;false&lt;/alwaysPullImage&gt;
                  &lt;workingDir&gt;/home/jenkins&lt;/workingDir&gt;
                  &lt;command&gt;&lt;/command&gt;
                  &lt;args&gt;${computer.jnlpmac} ${computer.name}&lt;/args&gt;
                  &lt;ttyEnabled&gt;false&lt;/ttyEnabled&gt;
                  # Resources configuration is a little hacky. This was to prevent breaking
                  # changes, and should be cleanned up in the future once everybody had
                  # enough time to migrate.
                  &lt;resourceRequestCpu&gt;200m&lt;/resourceRequestCpu&gt;
                  &lt;resourceRequestMemory&gt;256Mi&lt;/resourceRequestMemory&gt;
                  &lt;resourceLimitCpu&gt;200m&lt;/resourceLimitCpu&gt;
                  &lt;resourceLimitMemory&gt;256Mi&lt;/resourceLimitMemory&gt;
                  &lt;envVars&gt;
                    &lt;org.csanchez.jenkins.plugins.kubernetes.ContainerEnvVar&gt;
                      &lt;key&gt;JENKINS_URL&lt;/key&gt;
                      &lt;value&gt;http://inclined-eagle-jenkins:8080&lt;/value&gt;
                    &lt;/org.csanchez.jenkins.plugins.kubernetes.ContainerEnvVar&gt;
                  &lt;/envVars&gt;
                &lt;/org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate&gt;
              &lt;/containers&gt;
              &lt;envVars/&gt;
              &lt;annotations/&gt;
              &lt;imagePullSecrets/&gt;
              &lt;nodeProperties/&gt;
              &lt;podRetention class="org.csanchez.jenkins.plugins.kubernetes.pod.retention.Default"/&gt;
            &lt;/org.csanchez.jenkins.plugins.kubernetes.PodTemplate&gt;&lt;/templates&gt;
          &lt;serverUrl&gt;https://kubernetes.default&lt;/serverUrl&gt;
          &lt;skipTlsVerify&gt;false&lt;/skipTlsVerify&gt;
          &lt;namespace&gt;default&lt;/namespace&gt;
          &lt;jenkinsUrl&gt;http://inclined-eagle-jenkins:8080&lt;/jenkinsUrl&gt;
          &lt;jenkinsTunnel&gt;inclined-eagle-jenkins-agent:50000&lt;/jenkinsTunnel&gt;
          &lt;containerCap&gt;10&lt;/containerCap&gt;
          &lt;retentionTimeout&gt;5&lt;/retentionTimeout&gt;
          &lt;connectTimeout&gt;0&lt;/connectTimeout&gt;
          &lt;readTimeout&gt;0&lt;/readTimeout&gt;
          &lt;podRetention class="org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never"/&gt;
        &lt;/org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud&gt;
      &lt;/clouds&gt;
      &lt;quietPeriod&gt;5&lt;/quietPeriod&gt;
      &lt;scmCheckoutRetryCount&gt;0&lt;/scmCheckoutRetryCount&gt;
      &lt;views&gt;
        &lt;hudson.model.AllView&gt;
          &lt;owner class="hudson" reference="../../.."/&gt;
          &lt;name&gt;All&lt;/name&gt;
          &lt;filterExecutors&gt;false&lt;/filterExecutors&gt;
          &lt;filterQueue&gt;false&lt;/filterQueue&gt;
          &lt;properties class="hudson.model.View$PropertyList"/&gt;
        &lt;/hudson.model.AllView&gt;
      &lt;/views&gt;
      &lt;primaryView&gt;All&lt;/primaryView&gt;
      &lt;slaveAgentPort&gt;50000&lt;/slaveAgentPort&gt;
      &lt;disabledAgentProtocols&gt;
        &lt;string&gt;JNLP-connect&lt;/string&gt;
        &lt;string&gt;JNLP2-connect&lt;/string&gt;
      &lt;/disabledAgentProtocols&gt;
      &lt;label&gt;&lt;/label&gt;
      &lt;crumbIssuer class="hudson.security.csrf.DefaultCrumbIssuer"&gt;
        &lt;excludeClientIPFromCrumb&gt;true&lt;/excludeClientIPFromCrumb&gt;
      &lt;/crumbIssuer&gt;
      &lt;nodeProperties/&gt;
      &lt;globalNodeProperties/&gt;
      &lt;noUsageStatistics&gt;true&lt;/noUsageStatistics&gt;
    &lt;/hudson&gt;
  jenkins.model.JenkinsLocationConfiguration.xml: |-
    &lt;?xml version='1.1' encoding='UTF-8'?&gt;
    &lt;jenkins.model.JenkinsLocationConfiguration&gt;
      &lt;adminAddress&gt;&lt;/adminAddress&gt;
      &lt;jenkinsUrl&gt;http://inclined-eagle-jenkins:8080&lt;/jenkinsUrl&gt;
    &lt;/jenkins.model.JenkinsLocationConfiguration&gt;
  jenkins.CLI.xml: |-
    &lt;?xml version='1.1' encoding='UTF-8'?&gt;
    &lt;jenkins.CLI&gt;
      &lt;enabled&gt;false&lt;/enabled&gt;
    &lt;/jenkins.CLI&gt;
  apply_config.sh: |-
    mkdir -p /usr/share/jenkins/ref/secrets/;
    echo "false" &gt; /usr/share/jenkins/ref/secrets/slave-to-master-security-kill-switch;
    yes n | cp -i /var/jenkins_config/config.xml /var/jenkins_home;
    yes n | cp -i /var/jenkins_config/jenkins.CLI.xml /var/jenkins_home;
    yes n | cp -i /var/jenkins_config/jenkins.model.JenkinsLocationConfiguration.xml /var/jenkins_home;
    # Install missing plugins
    cp /var/jenkins_config/plugins.txt /var/jenkins_home;
    rm -rf /usr/share/jenkins/ref/plugins/*.lock
    /usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
    # Copy plugins to shared volume
    yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
  plugins.txt: |-
    kubernetes:1.14.0
    workflow-job:2.31
    workflow-aggregator:2.6
    credentials-binding:1.17
    git:3.9.1
---
# Source: jenkins/templates/test-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: inclined-eagle-jenkins-tests
data:
  run.sh: |-
    @test "Testing Jenkins UI is accessible" {
      curl --retry 48 --retry-delay 10 inclined-eagle-jenkins:8080/login
    }
---
# Source: jenkins/templates/home-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: inclined-eagle-jenkins
  labels:
    app: inclined-eagle-jenkins
    chart: "jenkins-0.28.6"
    release: "inclined-eagle"
    heritage: "Tiller"
spec:
  accessModes:
    - "ReadWriteOnce"
  resources:
    requests:
      storage: "4Gi"
---
# Source: jenkins/templates/jenkins-agent-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: inclined-eagle-jenkins-agent
  labels:
    app: inclined-eagle-jenkins
    chart: "jenkins-0.28.6"
    component: "inclined-eagle-jenkins-master"
spec:
  ports:
    - port: 50000
      targetPort: 50000

      name: slavelistener
  selector:
    component: "inclined-eagle-jenkins-master"
  type: ClusterIP
---
# Source: jenkins/templates/jenkins-master-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: inclined-eagle-jenkins
  labels:
    app: inclined-eagle-jenkins
    heritage: "Tiller"
    release: "inclined-eagle"
    chart: "jenkins-0.28.6"
    component: "inclined-eagle-jenkins-master"
spec:
  ports:
    - port: 8080
      name: http
      targetPort: 8080

  selector:
    component: "inclined-eagle-jenkins-master"
  type: NodePort
---
# Source: jenkins/templates/jenkins-master-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: inclined-eagle-jenkins
  labels:
    heritage: "Tiller"
    release: "inclined-eagle"
    chart: "jenkins-0.28.6"
    component: "inclined-eagle-jenkins-master"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      component: "inclined-eagle-jenkins-master"
  template:
    metadata:
      labels:
        app: inclined-eagle-jenkins
        heritage: "Tiller"
        release: "inclined-eagle"
        chart: "jenkins-0.28.6"
        component: "inclined-eagle-jenkins-master"
      annotations:
        checksum/config: 4eebbff9187d5eadf249ff0106423ec0b571659e014ed75f2abef5619afc24f9
    spec:
      securityContext:
        runAsUser: 0
      serviceAccountName: "default"
      initContainers:
        - name: "copy-default-config"
          image: "jenkins/jenkins:lts"
          imagePullPolicy: "Always"
          command: [ "sh", "/var/jenkins_config/apply_config.sh" ]
          resources:
            limits:
              cpu: 2000m
              memory: 2048Mi
            requests:
              cpu: 50m
              memory: 256Mi

          volumeMounts:
            -
              mountPath: /var/jenkins_home
              name: jenkins-home
            -
              mountPath: /var/jenkins_config
              name: jenkins-config
            -
              mountPath: /var/jenkins_plugins
              name: plugin-dir
            -
              mountPath: /usr/share/jenkins/ref/secrets/
              name: secrets-dir
      containers:
        - name: inclined-eagle-jenkins
          image: "jenkins/jenkins:lts"
          imagePullPolicy: "Always"
          args: [ "--argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)",  "--argumentsRealm.roles.$(ADMIN_USER)=admin"]
          env:
            - name: JAVA_OPTS
              value: ""
            - name: JENKINS_OPTS
              value: ""
            - name: ADMIN_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: inclined-eagle-jenkins
                  key: jenkins-admin-password
            - name: ADMIN_USER
              valueFrom:
                secretKeyRef:
                  name: inclined-eagle-jenkins
                  key: jenkins-admin-user
          ports:
            - containerPort: 8080
              name: http
            - containerPort: 50000
              name: slavelistener
          livenessProbe:
            httpGet:
              path: "/login"
              port: http
            initialDelaySeconds: 90
            timeoutSeconds: 5
            failureThreshold: 12
          readinessProbe:
            httpGet:
              path: "/login"
              port: http
            initialDelaySeconds: 60
            periodSeconds: 10
          # Resources configuration is a little hacky. This was to prevent breaking
          # changes, and should be cleanned up in the future once everybody had
          # enough time to migrate.
          resources:

            limits:
              cpu: 2000m
              memory: 2048Mi
            requests:
              cpu: 50m
              memory: 256Mi


          volumeMounts:
            -
              mountPath: /var/jenkins_home
              name: jenkins-home
              readOnly: false
            -
              mountPath: /var/jenkins_config
              name: jenkins-config
              readOnly: true
            -
              mountPath: /usr/share/jenkins/ref/plugins/
              name: plugin-dir
              readOnly: false
            -
              mountPath: /usr/share/jenkins/ref/secrets/
              name: secrets-dir
              readOnly: false
      volumes:
      - name: jenkins-config
        configMap:
          name: inclined-eagle-jenkins
      - name: plugin-dir
        emptyDir: {}
      - name: secrets-dir
        emptyDir: {}
      - name: jenkins-home
        persistentVolumeClaim:
          claimName: inclined-eagle-jenkins
</code></pre>

<p>pod's log:</p>

<pre><code>container "inclined-eagle-jenkins" in pod "inclined-eagle-jenkins-65c8f989d-lglfc" is waiting to start: PodInitializing
</code></pre>

<p>There is also warning message among events:</p>

<pre><code>AssumePod failed: pod 6bf15a11-168a-11e9-b322-0800277359c7 is in the cache, so can't be assumed
</code></pre>

CC BY-SA 4.0
2019-01-12T17:32:30.310Z
Could you add the modified helm chart you try to deploy and add the log?
030
CC BY-SA 4.0
2019-01-12T18:02:48.337Z
Same problem with default value of Persistence.Size(8Gi)
Bogdan Pisarenko
<jenkins><kubernetes><deployment><helm>
Pod's state "pod has unbound immediate PersistentVolumeClaims" when deploy Jenkins with Helm chart
Bogdan Pisarenko
# Pod's state "pod has unbound immediate PersistentVolumeClaims" when deploy Jenkins with Helm chart

(Asked by: username_0 on 2019-01-12)

I try to deploy Jenkins in local Kubernetes cluster with Helm from repo stable/jenkins:lts. But after deployment I get pod which has status "pod has unbound immediate PersistentVolumeClaims". PVC has status "bound" without any errors.
My environment: virtual machine with Linux Ubuntu 18.x where there is installed microk8s. When I deploy I change only node type and persistence size.
Helm chart config:
NAME:   inclined-eagle
REVISION: 1
RELEASED: Fri Jan 11 21:35:47 2019
CHART: jenkins-0.28.6
USER-SUPPLIED VALUES:
Master:
  ServiceType: NodePort
Persistence:
  Size: 4Gi

COMPUTED VALUES:
Agent:
  AlwaysPullImage: false
  Component: jenkins-slave
  CustomJenkinsLabels: []
  Enabled: true
  Image: jenkins/jnlp-slave
  ImageTag: 3.27-1
  NodeSelector: {}
  PodRetention: Never
  Privileged: false
  resources:
    limits:
      cpu: 200m
      memory: 256Mi
    requests:
      cpu: 200m
      memory: 256Mi
  volumes: null
Master:
  AdditionalConfig: {}
  AdminUser: admin
  CLI: false
  CSRF:
    DefaultCrumbIssuer:
      Enabled: true
      ProxyCompatability: true
  Component: jenkins-master
  CustomConfigMap: false
  DisabledAgentProtocols:
  - JNLP-connect
  - JNLP2-connect
  ExtraPorts: null
  HealthProbeLivenessFailureThreshold: 12
  HealthProbeReadinessPeriodSeconds: 10
  HealthProbes: true
  HealthProbesLivenessTimeout: 90
  HealthProbesReadinessTimeout: 60
  HostNetworking: false
  Image: jenkins/jenkins
  ImagePullPolicy: Always
  ImageTag: lts
  Ingress:
    Annotations: {}
    ApiVersion: extensions/v1beta1
    TLS: null
  InitScripts: null
  InstallPlugins:
  - kubernetes:1.14.0
  - workflow-job:2.31
  - workflow-aggregator:2.6
  - credentials-binding:1.17
  - git:3.9.1
  LoadBalancerSourceRanges:
  - 0.0.0.0/0
  Name: jenkins-master
  NodeSelector: {}
  NumExecutors: 0
  OverwriteConfig: false
  PodAnnotations: {}
  ServiceAnnotations: {}
  ServiceLabels: {}
  ServicePort: 8080
  ServiceType: NodePort
  SlaveListenerPort: 50000
  SlaveListenerServiceAnnotations: {}
  SlaveListenerServiceType: ClusterIP
  Tolerations: {}
  UsePodSecurityContext: true
  UseSecurity: true
  resources:
    limits:
      cpu: 2000m
      memory: 2048Mi
    requests:
      cpu: 50m
      memory: 256Mi
NetworkPolicy:
  ApiVersion: networking.k8s.io/v1
  Enabled: false
Persistence:
  AccessMode: ReadWriteOnce
  Annotations: {}
  Enabled: true
  Size: 4Gi
  mounts: null
  volumes: null
backup:
  annotations:
    iam.amazonaws.com/role: jenkins
  destination: s3://nuvo-jenkins-data/backup
  enabled: false
  env:
  - name: AWS_REGION
    value: us-east-1
  extraArgs: []
  image:
    repository: nuvo/kube-tasks
    tag: 0.1.2
  resources:
    limits:
      cpu: 1
      memory: 1Gi
    requests:
      cpu: 1
      memory: 1Gi
  schedule: 0 2 * * *
rbac:
  install: false
  roleBindingKind: ClusterRoleBinding
  roleKind: ClusterRole
  roleRef: cluster-admin
  serviceAccountName: default

HOOKS:
---
# inclined-eagle-ui-test-1mhfp
apiVersion: v1
kind: Pod
metadata:
  name: "inclined-eagle-ui-test-1mhfp"
  annotations:
    "helm.sh/hook": test-success
spec:
  initContainers:
    - name: "test-framework"
      image: "dduportal/bats:0.4.0"
      command:
      - "bash"
      - "-c"
      - |
        set -ex
        # copy bats to tools dir
        cp -R /usr/local/libexec/ /tools/bats/
      volumeMounts:
      - mountPath: /tools
        name: tools
  containers:
    - name: inclined-eagle-ui-test
      image: jenkins/jenkins:lts
      command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
      volumeMounts:
      - mountPath: /tests
        name: tests
        readOnly: true
      - mountPath: /tools
        name: tools
  volumes:
  - name: tests
    configMap:
      name: inclined-eagle-jenkins-tests
  - name: tools
    emptyDir: {}
  restartPolicy: Never
MANIFEST:

---
# Source: jenkins/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: inclined-eagle-jenkins
  labels:
    app: inclined-eagle-jenkins
    chart: "jenkins-0.28.6"
    release: "inclined-eagle"
    heritage: "Tiller"
type: Opaque
data:

  jenkins-admin-password: "enkyZlZqdVdqMw=="

  jenkins-admin-user: "YWRtaW4="
---
# Source: jenkins/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: inclined-eagle-jenkins
data:
  config.xml: |-
    
    
      
      lts
      0
      NORMAL
      true
      
        true
      
      
      false
      
      ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}
      ${ITEM_ROOTDIR}/builds
      
      
      
      
      
        
          kubernetes
          
            
              
              default
              2147483647
              0
              inclined-eagle-jenkins-slave 
              
                NORMAL
              
              
              
                
                  jnlp
                  jenkins/jnlp-slave:3.27-1
                  false
                  false
                  /home/jenkins
                  
                  ${computer.jnlpmac} ${computer.name}
                  false
                  # Resources configuration is a little hacky. This was to prevent breaking
                  # changes, and should be cleanned up in the future once everybody had
                  # enough time to migrate.
                  200m
                  256Mi
                  200m
                  256Mi
                  
                    
                      JENKINS_URL
                      http://inclined-eagle-jenkins:8080
                    
                  
                
              
              
              
              
              
              
            
          https://kubernetes.default
          false
          default
          http://inclined-eagle-jenkins:8080
          inclined-eagle-jenkins-agent:50000
          10
          5
          0
          0
          
        
      
      5
      0
      
        
          
          All
          false
          false
          
        
      
      All
      50000
      
        JNLP-connect
        JNLP2-connect
      
      
      
        true
      
      
      
      true
    
  jenkins.model.JenkinsLocationConfiguration.xml: |-
    
    
      
      http://inclined-eagle-jenkins:8080
    
  jenkins.CLI.xml: |-
    
    
      false
    
  apply_config.sh: |-
    mkdir -p /usr/share/jenkins/ref/secrets/;
    echo "false" > /usr/share/jenkins/ref/secrets/slave-to-master-security-kill-switch;
    yes n | cp -i /var/jenkins_config/config.xml /var/jenkins_home;
    yes n | cp -i /var/jenkins_config/jenkins.CLI.xml /var/jenkins_home;
    yes n | cp -i /var/jenkins_config/jenkins.model.JenkinsLocationConfiguration.xml /var/jenkins_home;
    # Install missing plugins
    cp /var/jenkins_config/plugins.txt /var/jenkins_home;
    rm -rf /usr/share/jenkins/ref/plugins/*.lock
    /usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
    # Copy plugins to shared volume
    yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
  plugins.txt: |-
    kubernetes:1.14.0
    workflow-job:2.31
    workflow-aggregator:2.6
    credentials-binding:1.17
    git:3.9.1
---
# Source: jenkins/templates/test-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: inclined-eagle-jenkins-tests
data:
  run.sh: |-
    @test "Testing Jenkins UI is accessible" {
      curl --retry 48 --retry-delay 10 inclined-eagle-jenkins:8080/login
    }
---
# Source: jenkins/templates/home-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: inclined-eagle-jenkins
  labels:
    app: inclined-eagle-jenkins
    chart: "jenkins-0.28.6"
    release: "inclined-eagle"
    heritage: "Tiller"
spec:
  accessModes:
    - "ReadWriteOnce"
  resources:
    requests:
      storage: "4Gi"
---
# Source: jenkins/templates/jenkins-agent-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: inclined-eagle-jenkins-agent
  labels:
    app: inclined-eagle-jenkins
    chart: "jenkins-0.28.6"
    component: "inclined-eagle-jenkins-master"
spec:
  ports:
    - port: 50000
      targetPort: 50000

      name: slavelistener
  selector:
    component: "inclined-eagle-jenkins-master"
  type: ClusterIP
---
# Source: jenkins/templates/jenkins-master-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: inclined-eagle-jenkins
  labels:
    app: inclined-eagle-jenkins
    heritage: "Tiller"
    release: "inclined-eagle"
    chart: "jenkins-0.28.6"
    component: "inclined-eagle-jenkins-master"
spec:
  ports:
    - port: 8080
      name: http
      targetPort: 8080

  selector:
    component: "inclined-eagle-jenkins-master"
  type: NodePort
---
# Source: jenkins/templates/jenkins-master-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: inclined-eagle-jenkins
  labels:
    heritage: "Tiller"
    release: "inclined-eagle"
    chart: "jenkins-0.28.6"
    component: "inclined-eagle-jenkins-master"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      component: "inclined-eagle-jenkins-master"
  template:
    metadata:
      labels:
        app: inclined-eagle-jenkins
        heritage: "Tiller"
        release: "inclined-eagle"
        chart: "jenkins-0.28.6"
        component: "inclined-eagle-jenkins-master"
      annotations:
        checksum/config: 4eebbff9187d5eadf249ff0106423ec0b571659e014ed75f2abef5619afc24f9
    spec:
      securityContext:
        runAsUser: 0
      serviceAccountName: "default"
      initContainers:
        - name: "copy-default-config"
          image: "jenkins/jenkins:lts"
          imagePullPolicy: "Always"
          command: [ "sh", "/var/jenkins_config/apply_config.sh" ]
          resources:
            limits:
              cpu: 2000m
              memory: 2048Mi
            requests:
              cpu: 50m
              memory: 256Mi

          volumeMounts:
            -
              mountPath: /var/jenkins_home
              name: jenkins-home
            -
              mountPath: /var/jenkins_config
              name: jenkins-config
            -
              mountPath: /var/jenkins_plugins
              name: plugin-dir
            -
              mountPath: /usr/share/jenkins/ref/secrets/
              name: secrets-dir
      containers:
        - name: inclined-eagle-jenkins
          image: "jenkins/jenkins:lts"
          imagePullPolicy: "Always"
          args: [ "--argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)",  "--argumentsRealm.roles.$(ADMIN_USER)=admin"]
          env:
            - name: JAVA_OPTS
              value: ""
            - name: JENKINS_OPTS
              value: ""
            - name: ADMIN_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: inclined-eagle-jenkins
                  key: jenkins-admin-password
            - name: ADMIN_USER
              valueFrom:
                secretKeyRef:
                  name: inclined-eagle-jenkins
                  key: jenkins-admin-user
          ports:
            - containerPort: 8080
              name: http
            - containerPort: 50000
              name: slavelistener
          livenessProbe:
            httpGet:
              path: "/login"
              port: http
            initialDelaySeconds: 90
            timeoutSeconds: 5
            failureThreshold: 12
          readinessProbe:
            httpGet:
              path: "/login"
              port: http
            initialDelaySeconds: 60
            periodSeconds: 10
          # Resources configuration is a little hacky. This was to prevent breaking
          # changes, and should be cleanned up in the future once everybody had
          # enough time to migrate.
          resources:

            limits:
              cpu: 2000m
              memory: 2048Mi
            requests:
              cpu: 50m
              memory: 256Mi


          volumeMounts:
            -
              mountPath: /var/jenkins_home
              name: jenkins-home
              readOnly: false
            -
              mountPath: /var/jenkins_config
              name: jenkins-config
              readOnly: true
            -
              mountPath: /usr/share/jenkins/ref/plugins/
              name: plugin-dir
              readOnly: false
            -
              mountPath: /usr/share/jenkins/ref/secrets/
              name: secrets-dir
              readOnly: false
      volumes:
      - name: jenkins-config
        configMap:
          name: inclined-eagle-jenkins
      - name: plugin-dir
        emptyDir: {}
      - name: secrets-dir
        emptyDir: {}
      - name: jenkins-home
        persistentVolumeClaim:
          claimName: inclined-eagle-jenkins

pod's log:
container "inclined-eagle-jenkins" in pod "inclined-eagle-jenkins-65c8f989d-lglfc" is waiting to start: PodInitializing

There is also warning message among events:
AssumePod failed: pod 6bf15a11-168a-11e9-b322-0800277359c7 is in the cache, so can't be assumed

**Tags:** jenkins, kubernetes, deployment, helm

> **Comments:**
> **username_1**: Could you add the modified helm chart you try to deploy and add the log?  
> **username_0**: Same problem with default value of Persistence.Size(8Gi)  

---

## 1 answers

### Answer by username_0 on 2019-01-14. Score: 0 | Accepted answer

In my case problem was related with droped IPtables FORWARD policy. I had investigated it with the help of "microk8s.inspect" command. InitContainer couldn't get access to the Internet and it stopped deployment of whole pod with main container. Solving was easy - "sudo iptables -P FORWARD ACCEPT" and redeployment with Helm.


---

