Kubernetes: Difference between revisions

From Skytech
Jump to navigation Jump to search
(Created page with "Category: Linux = Petsets = <pre> Skip to content Personal Open source Business Explore Sign upSign inPricingBlogSupport This repository Search Watch 1,512 Star 18,56...")
 
No edit summary
Line 1: Line 1:
[[ Category: Linux ]]
[[ Category:Linux ]]

= How to access Pods externally =
* http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/


= Petsets =
= Petsets =

Revision as of 07:55, 23 June 2018


How to access Pods externally

Petsets

Skip to content
Personal Open source Business Explore
Sign upSign inPricingBlogSupport
This repository
Search
 Watch 1,512  Star 18,562  Fork 6,134 kubernetes/kubernetes
 Code  Issues 4,613  Pull requests 678  Projects 7  Wiki  Pulse  Graphs
Branch: master Find file Copy pathkubernetes/test/e2e/testing-manifests/petset/redis/petset.yaml
f2bab13  4 days ago
@janetkuo janetkuo Remove 0 terminationGracePeriodSeconds from statefulset manifests
2 contributors @janetkuo @bprashanth
RawBlameHistory    
98 lines (97 sloc)  2.66 KB
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: rd
spec:
  serviceName: "redis"
  replicas: 3
  template:
    metadata:
      labels:
        app: redis
      annotations:
        pod.alpha.kubernetes.io/initialized: "true"
        pod.alpha.kubernetes.io/init-containers: '[
            {
                "name": "install",
                "image": "gcr.io/google_containers/redis-install-3.2.0:e2e",
                "imagePullPolicy": "Always",
                "args": ["--install-into=/opt", "--work-dir=/work-dir"],
                "volumeMounts": [
                    {
                        "name": "opt",
                        "mountPath": "/opt"
                    },
                    {
                        "name": "workdir",
                        "mountPath": "/work-dir"
                    }
                ]
            },
            {
                "name": "bootstrap",
                "image": "debian:jessie",
                "command": ["/work-dir/peer-finder"],
                "args": ["-on-start=\"/work-dir/on-start.sh\"", "-service=redis"],
                "env": [
                  {
                      "name": "POD_NAMESPACE",
                      "valueFrom": {
                          "fieldRef": {
                              "apiVersion": "v1",
                              "fieldPath": "metadata.namespace"
                          }
                      }
                   }
                ],
                "volumeMounts": [
                    {
                        "name": "opt",
                        "mountPath": "/opt"
                    },
                    {
                        "name": "workdir",
                        "mountPath": "/work-dir"
                    }
                ]
            }
        ]'
    spec:
      containers:
      - name: redis
        image: debian:jessie
        ports:
        - containerPort: 6379
          name: peer
        command:
        - /opt/redis/redis-server
        args:
        - /opt/redis/redis.conf
        readinessProbe:
          exec:
            command:
            - sh
            - -c
            - "/opt/redis/redis-cli -h $(hostname) ping"
          initialDelaySeconds: 15
          timeoutSeconds: 5
        volumeMounts:
        - name: datadir
          mountPath: /data
        - name: opt
          mountPath: /opt
      volumes:
      - name: opt
        emptyDir: {}
      - name: workdir
        emptyDir: {}
  volumeClaimTemplates:
  - metadata:
      name: datadir
      annotations:
        volume.alpha.kubernetes.io/storage-class: anything
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 1Gi