Giter Site home page Giter Site logo

examples's People

Contributors

brendanburns avatar brendandburns avatar formichunter avatar jbeda avatar jennerwein avatar juliogomez avatar kennetvu avatar lachie83 avatar mikeboensel avatar nillsf avatar smartbit avatar yuya-takeyama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

Error to setup sentinnel and replicate data between nodes

Hello,

Pods are setup on my GCP cluster but sentinel returns an error and replication between nodes is not ok.

If I try to determine which server the Redis sentinel believes is the master, I get the following :
$ kubectl exec redis-2 -c redis -- redis-cli -p 26379 sentinel get-master-addr-by-name redis
Could not connect to Redis at 127.0.0.1:26379: Connection refused

If I check sentinel logs
$ kubectl logs statefulsets/redis sentinel
Waiting for server
ping: bad address 'redis-0.redis'

And if I set foo 10 on redis-0 I don't get key on redis-2

Why I get bad address ?
What can I do ?
Thank you

Examples of lessons 2-4

Why does examples start from chapter when examples are available starting from chapter 2 in the book? And why are examples separate from guard repository anyway? The book has a chaotic structure and so the examples. It takes a while to get an overview and what to do first.

Error: unknown flag: --from-file

Hey! When I run this command from the book for example 14-3:

kubectl apply cm --from-file ghost-config.js ghost-config

I get this error:

Error: unknown flag: --from-file

I'm on kubectl version:

Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3", GitCommit:"f0efb3cb883751c5ffdbe6d515f3cb4fbe7b7acd", GitTreeState:"clean", BuildDate:"2017-11-08T18:39:33Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"dirty", BuildDate:"2017-06-22T04:31:09Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

Do I need to be on an older version for that invocation to work?

For anyone else with this problem, I used this command to get it working:

kubectl create configmap ghost-config --from-file ghost-config.js

Example 8-1-kuard-rs.yaml does not work

Trying to run the example 8-1-kuard-rs.yaml with kubectl v1.16.3 and minikube v.1.6.2 and getting validation error:

➜ kubernetes-up-and-running_examples git:(master) ✗ kubectl apply -f 8-1-kuard-rs.yaml
error: error validating "8-1-kuard-rs.yaml": error validating data: ValidationError(ReplicaSet.spec): missing required field "selector" in io.k8s.api.apps.v1.ReplicaSetSpec; if you choose to ignore these errors, turn validation off with --validate=false
➜ kubernetes-up-and-running_examples git:(master) ✗ kubectl apply -f 8-1-kuard-rs.yaml
The ReplicaSet "kuard" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"kuard", "version":"2"}: `selector` does not match template `labels`
➜ kubernetes-up-and-running_examples git:(master) ✗ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-13T11:23:11Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
➜ kubernetes-up-and-running_examples git:(master) ✗ minikube version
minikube version: v1.6.2
commit: 54f28ac5d3a815d1196cd5d57d707439ee4bb392

13-2yaml can not work

kubectl create -f 13-2.yaml
13-2 yaml is writed as

kind: Service
apiVersion: v1
metadata:
name: external-ip-database
I get the error

The Service "external-ip-database" is invalid: spec.ports: Required value

5-1 yaml gives error

When trying to deploy the 5-1 example yaml:
$ kubectl apply -f kuard-pod.yaml
error: error validating "kuard-pod.yaml": error validating data: ValidationError(Pod.metadata): unknown field "spec" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta; if you choose to ignore these errors, turn validation off with --validate=false

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4", GitTreeState:"clean", BuildDate:"2017-11-29T22:43:34Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}

Update: Example 5-2 worked ok.
Also updated error message to correct one

-jjd

14-10-redis.yaml error : Error from server (BadRequest): a container name must be specified for pod redis-0, choose one of: [redis sentinel]

Hello,

Thank you for the book, great help.
I try to use the Redis configuration on my prod on GCP but following the steps, I get the following error :

Error from server (BadRequest): a container name must be specified for pod redis-0, choose one of: [redis sentinel]

My configuration is the same present in the book
https://github.com/kubernetes-up-and-running/examples/blob/master/14-10-redis.yaml

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: redis
spec:
replicas: 3
serviceName: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- command: [sh, -c, source /redis-config/init.sh ]
image: redis:3.2.7-alpine
name: redis
ports:
- containerPort: 6379
name: redis
volumeMounts:
- mountPath: /redis-config
name: config
- mountPath: /redis-data
name: data
- command: [sh, -c, source /redis-config/sentinel.sh]
image: redis:3.2.7-alpine
name: sentinel
volumeMounts:
- mountPath: /redis-config
name: config
volumes:
- configMap:
defaultMode: 420
name: redis-config
name: config
- emptyDir:
name: data

For example :
po/redis-0 1/2 CrashLoopBackOff 4 2m
po/redis-1 1/2 CrashLoopBackOff 4 2m

Same error :
$ kubectl logs po/redis-1 -p
Error from server (BadRequest): a container name must be specified for pod redis-1, choose one of: [redis sentinel]

Thank you for your help,

Julien

Example 5-1-kuard-pod.yaml error

When I run
kubectl apply -f examples/5-1-kuard-pod.yaml
I get this error:
error: error validating "examples/5-1-kuard-pod.yaml": error validating data: found invalid field spec for v1.ObjectMeta; if you choose to ignore these errors, turn validation off with --validate=false
And when I add --validate=false and run:
kubectl apply -f examples/5-1-kuard-pod.yaml --validate=false
I get this error:
The Pod "kuard" is invalid: spec.containers: Required value
I am running K8S on Azure.

5-2. kuard-pod-health.yaml does not work

I have the following conf saved in kuard-prod-health.yaml

apiVersion: v1
kind: Pod
metadata:
  name: kuard
spec:
  containers:
    - image: gcr.io/kuar-demo/kuard-amd64:1
      name: kuard
      livenessProbe:
        httpGet:
          path: /healthy
          port: 8080
        initialDelaySeconds: 5
        timeoutSeconds: 1
        periodSeconds: 10
        failureThreshold: 3
      ports:
        - containerPort: 8080
          name: http
          protocol: TCP

However when I try to apply the conf:
kubectl apply -f kuard-prod-health.yaml

I get this error:

The Pod "kuard" is invalid: spec: Forbidden: pod updates may not change fields other than spec.containers[*].image, spec.initContainers[*].image, spec.activeDeadlineSeconds or spec.tolerations (only additions to existing tolerations)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.